这里需求是表头有一部分是动态变化的,其他部分是固定的,通过自定义组件实现。
表格和列:
- 表格
<template>
@Configuration | |
public class FeignConfig implements RequestInterceptor | |
{ | |
@Value("${auth.user.token-header}") | |
private String tokenHeader; | |
@Override | |
public void apply(RequestTemplate requestTemplate) | |
{ | |
HttpServletRequest httpServletRequest = HttpContextUtils.getHttpServletRequest(); |
@Component | |
public class HttpContextUtils implements ApplicationContextAware | |
{ | |
public static ApplicationContext applicationContext; | |
public static HttpServletRequest getHttpServletRequest() | |
{ | |
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes(); | |
if (requestAttributes == null) | |
{ |
/** | |
* 将前台传递过来的日期格式的字符串,自动转化为Date类型 | |
*/ | |
@InitBinder | |
public void initBinder(WebDataBinder binder) | |
{ | |
// Date 类型转换 | |
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() | |
{ | |
@Override |
@Configuration | |
public class RestTemplateConfig | |
{ | |
@Bean | |
public RestTemplate restTemplate() | |
{ | |
ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient()); | |
return new RestTemplate(requestFactory); | |
} |
public JSONObject get(ServiceCatalogEnum service, Map<String, Object> paramMap) | |
{ | |
pointLog(service.getUrl(), service.getTip()); | |
HttpEntity requestEntity = new HttpEntity(null, HttpHeaderEnum.valueOf(service.getProvider()).get()); | |
try | |
{ | |
ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(httpUrlPrefix.get(service.getProvider()) + service.getUrl(), HttpMethod.GET, requestEntity, JSONObject.class, paramMap); | |
return responseEntity.getBody(); | |
} | |
catch (RestClientException e) |
netstat -ano
netstat -ano |findstr "8080"
netstat -ano |findstr "TIME_WAIT"
netstat -ano |find /i /c "TIME_WAIT"
regedit
进入注册表HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters
TCPTimedWaitDelay
,值数据: 30(TIME_WAIT的自动断开时间,默认为4分钟)private String createZipFile(List<BaseFile> fileList) { | |
String path = "/temp/download/"; | |
String filename = UUID.randomUUID().toString() + "_附件.zip"; | |
try (FileOutputStream out = new FileOutputStream(path + filename)) | |
{ | |
ZipOutputStream zip; | |
zip = new ZipOutputStream(new BufferedOutputStream(out)); | |
fileList.forEach(doc -> { | |
try | |
{ |