Compare commits
28 Commits
master
...
xmzyy-lian
Author | SHA1 | Date |
---|---|---|
|
41866475ff | 5 months ago |
|
55d7ef547e | 5 months ago |
|
81a2672a65 | 5 months ago |
|
59bba70ffe | 5 months ago |
|
eb30e54eef | 5 months ago |
|
dc62b04aee | 5 months ago |
|
a5ff268a86 | 5 months ago |
|
cc2b6d06d5 | 5 months ago |
|
1d15965dc9 | 5 months ago |
|
6201f3c7a5 | 5 months ago |
|
930a9b3494 | 6 months ago |
|
93b710be70 | 6 months ago |
|
c316a76c66 | 8 months ago |
|
79593b9a9d | 8 months ago |
|
cdbe3d579e | 8 months ago |
|
470192354a | 8 months ago |
|
46499927e1 | 10 months ago |
|
03eb85f2f9 | 10 months ago |
|
966e66abec | 12 months ago |
|
15462c6a27 | 12 months ago |
|
9fdc6a8dbc | 1 year ago |
|
2dcd666b7c | 1 year ago |
|
befeed1979 | 1 year ago |
|
7ad3f4f7b9 | 1 year ago |
|
26d841d833 | 1 year ago |
|
768bf819d4 | 1 year ago |
|
5f6feb7a57 | 1 year ago |
|
aaf6559e4d | 1 year ago |
@ -0,0 +1,22 @@
|
|||||||
|
package com.jiashi.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class CorsConfig implements WebMvcConfigurer {
|
||||||
|
@Override
|
||||||
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
|
// 所有接口
|
||||||
|
registry.addMapping("/**")
|
||||||
|
// 是否发送 Cookie
|
||||||
|
.allowCredentials(true)
|
||||||
|
// 支持域
|
||||||
|
.allowedOriginPatterns("*")
|
||||||
|
// 支持方法
|
||||||
|
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"})
|
||||||
|
.allowedHeaders("*")
|
||||||
|
.exposedHeaders("*");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package com.jiashi.config;
|
||||||
|
|
||||||
|
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
|
||||||
|
import com.google.common.base.Predicates;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.ParameterBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.service.ApiInfo;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api页面 /swagger-ui.html
|
||||||
|
* @author Zheng Jie
|
||||||
|
* @date 2018-11-23
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableSwagger2
|
||||||
|
@EnableSwaggerBootstrapUI
|
||||||
|
public class SwaggerConfig {
|
||||||
|
@Bean
|
||||||
|
public Docket createRestApi() {
|
||||||
|
ParameterBuilder ticketPar = new ParameterBuilder();
|
||||||
|
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.enable(true)
|
||||||
|
.apiInfo(apiInfo())
|
||||||
|
.select()
|
||||||
|
.paths(Predicates.not(PathSelectors.regex("/error.*")))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiInfo apiInfo() {
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
.title("接口文档")
|
||||||
|
.version("1.0")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.jiashi.controller;
|
||||||
|
|
||||||
|
import com.jiashi.CommonResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2025/2/16 15:52
|
||||||
|
*/
|
||||||
|
@Api(value = "测试", tags = "测试")
|
||||||
|
@RestController()
|
||||||
|
@RequestMapping("/test")
|
||||||
|
@Slf4j
|
||||||
|
public class TestController {
|
||||||
|
|
||||||
|
@ApiOperation("厦门中医院联众同步人工处理模拟数据")
|
||||||
|
@GetMapping("/listPatPicDirNotFound")
|
||||||
|
public CommonResult listPatPicDirNotFound(){
|
||||||
|
ArrayList<Map<String, Object>> maps = new ArrayList<>();
|
||||||
|
int idinit=2015;
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
idinit++;
|
||||||
|
map.put("id",idinit);
|
||||||
|
map.put("patno","0002015000"+idinit);
|
||||||
|
map.put("gestno","0002015000"+idinit+"001");
|
||||||
|
map.put("outdate",format.format(new Date()));
|
||||||
|
maps.add(map);
|
||||||
|
}
|
||||||
|
return CommonResult.success(maps);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.jiashi.dao;
|
||||||
|
|
||||||
|
import com.jiashi.service.CardInfoPath;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface CardInfoPathRepository extends JpaRepository<CardInfoPath, String>, JpaSpecificationExecutor<CardInfoPath> {
|
||||||
|
|
||||||
|
|
||||||
|
@Query(value = "select * from t_card_info_upload_path where path not in (select findpicpath from t_card_info_upload where state in (2,3,4) )",nativeQuery = true)
|
||||||
|
List<CardInfoPath> queryNotUsedPath();
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.jiashi.service;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "t_card_info_upload_path")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CardInfoPath {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name="path")
|
||||||
|
private String path;
|
||||||
|
@Column(name="flag")
|
||||||
|
private String flag;
|
||||||
|
@Column(name="patnopart")
|
||||||
|
private String patnopart;
|
||||||
|
@Column(name="datepart")
|
||||||
|
private String datepart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.jiashi.service;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PicturePk implements Serializable {
|
||||||
|
private String picname;
|
||||||
|
private String fileid;
|
||||||
|
}
|
@ -1,157 +0,0 @@
|
|||||||
package com.jiashi.service;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.jiashi.CommonResult;
|
|
||||||
import com.jiashi.FileUploader;
|
|
||||||
import com.jiashi.dao.DataQuery;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public class UpdateService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DataQuery dataQuery;
|
|
||||||
|
|
||||||
public List<CardInfo> updateData(){
|
|
||||||
List<CardInfo> cardInfos = dataQuery.dateQuery();
|
|
||||||
dataQuery.updateBatchState(cardInfos,1);
|
|
||||||
return cardInfos;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void upload() {
|
|
||||||
String uniUrl = "http://10.2.3.24";
|
|
||||||
List<CardInfo> cardInfos = null;
|
|
||||||
ExecutorService executor2 = Executors.newFixedThreadPool(2);
|
|
||||||
ExecutorService executor = Executors.newFixedThreadPool(5);
|
|
||||||
do {
|
|
||||||
try{
|
|
||||||
cardInfos = this.updateData();
|
|
||||||
List<Future> futures2 = new ArrayList<>();
|
|
||||||
for (CardInfo cardInfo : cardInfos) {
|
|
||||||
log.info("开始同步"+cardInfo.getPatno());
|
|
||||||
Future future2 = executor2.submit(()->{
|
|
||||||
try{
|
|
||||||
List<Picture> pictures = dataQuery.getPictures(cardInfo.getId());
|
|
||||||
if(pictures==null||pictures.size()==0){
|
|
||||||
//如果是空的则不同步
|
|
||||||
dataQuery.updateBatchState(cardInfo,5);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<Future> futures = new ArrayList<>();
|
|
||||||
for (Picture picture : pictures) {
|
|
||||||
Future future = executor.submit(() -> {
|
|
||||||
try {
|
|
||||||
String dir = "d:\\pic\\"+picture.getFileid();
|
|
||||||
// 创建File对象
|
|
||||||
File directory = new File(dir);
|
|
||||||
|
|
||||||
// 判断目录是否存在
|
|
||||||
if (!directory.exists()) {
|
|
||||||
// 目录不存在,创建目录
|
|
||||||
boolean created = directory.mkdirs();
|
|
||||||
if (created) {
|
|
||||||
log.info("目录创建成功:" + dir);
|
|
||||||
} else {
|
|
||||||
log.info("目录创建失败:" + dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String cmd = "D:\\lianzhong\\Debug\\Debug\\lianzhong.exe 003 192.168.8.74 " + cardInfo.getId() + " " + picture.getPicid() + " " + cardInfo.getPatno() + " " + cardInfo.getOutdateStr() + " " + picture.getPicname() + " " + picture.getFileUrl() + " " + uniUrl + " " + picture.getRotatedegree();
|
|
||||||
log.info(cmd);
|
|
||||||
java.lang.Process process = java.lang.Runtime.getRuntime().exec(cmd);//执行命令生成cube
|
|
||||||
process.waitFor();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
futures.add(future);
|
|
||||||
}
|
|
||||||
for (Future future : futures) {
|
|
||||||
try {
|
|
||||||
future.get();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (ExecutionException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<File> files = new ArrayList<>();
|
|
||||||
List<UploadInfo> uploadInfos = new ArrayList<>();
|
|
||||||
for(Picture picture : pictures){
|
|
||||||
files.add(new File(picture.getFileUrl()));
|
|
||||||
UploadInfo uploadInfo = new UploadInfo(cardInfo.getPatno(), cardInfo.getOutdateStr2(), picture.getPicname(), picture.getPicname(), picture.getPickind(), cardInfo.getId(), cardInfo.getPatname(), cardInfo.getIndateStr(), cardInfo.getPatsex());
|
|
||||||
uploadInfos.add(uploadInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 额外的表单字段参数
|
|
||||||
List<FormField> params = new ArrayList<>();
|
|
||||||
String s = new Gson().toJson(uploadInfos);
|
|
||||||
params.add(new FormField("uploadFileParams", s));
|
|
||||||
log.info("请求参数:"+s);
|
|
||||||
// 上传
|
|
||||||
try {
|
|
||||||
CommonResult commonResult = FileUploader.uploadFilesWithParams(files, "http://10.2.130.59:8712/api/downplatform/fileUploadJpg", params);
|
|
||||||
if(commonResult.getCode()==0){
|
|
||||||
dataQuery.updateBatchState(cardInfo,3);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
dataQuery.updateBatchState(cardInfo,4);
|
|
||||||
log.error(commonResult.getMsg());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
dataQuery.updateBatchState(cardInfo,4);
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
}
|
|
||||||
// 删除文件
|
|
||||||
// String dir = "d:\\pic\\"+cardInfo.getId();
|
|
||||||
// File file = new File(dir);
|
|
||||||
// FileUploader.deleteFolder(file);
|
|
||||||
}catch (Exception e){
|
|
||||||
dataQuery.updateBatchState(cardInfo,4);
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
futures2.add(future2);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (Future future : futures2) {
|
|
||||||
try {
|
|
||||||
future.get();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (ExecutionException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}while (cardInfos != null && cardInfos.size() > 0) ;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,150 +0,0 @@
|
|||||||
package com.jiashi.service;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [ {"inpatientNo":"35131", "disDate":"2020-07-30 00:00:00.000", "fileTitle":"0001.jpg", "uploadFileName":"1.jpg", "assortId":"078F7675CB0048EDBE586D59831C57B0" ,
|
|
||||||
* "patientId":"12312312",
|
|
||||||
* "name":"长三",
|
|
||||||
* "admissDate":"住院时间",
|
|
||||||
* "sex":"男女"
|
|
||||||
* }
|
|
||||||
* ]
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
|
|
||||||
public class UploadInfo {
|
|
||||||
private String inpatientNo;
|
|
||||||
private String disDate;
|
|
||||||
private String fileTitle;
|
|
||||||
private String uploadFileName;
|
|
||||||
private String assortId;
|
|
||||||
private String patientId;
|
|
||||||
private String name;
|
|
||||||
private String admissDate;
|
|
||||||
private String sex;
|
|
||||||
|
|
||||||
public UploadInfo(String inpatientNo, String disDate, String fileTitle, String uploadFileName, String assortId, String patientId, String name, String admissDate, String sex) {
|
|
||||||
this.inpatientNo = inpatientNo;
|
|
||||||
this.disDate = disDate;
|
|
||||||
this.fileTitle = fileTitle;
|
|
||||||
this.uploadFileName = uploadFileName;
|
|
||||||
this.assortId = assortId;
|
|
||||||
this.patientId = patientId;
|
|
||||||
this.name = name;
|
|
||||||
this.admissDate = admissDate;
|
|
||||||
this.sex = sex;
|
|
||||||
this.ssAssortId();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void ssAssortId() {
|
|
||||||
switch (assortId) {
|
|
||||||
case "1":
|
|
||||||
this.assortId = "2111";
|
|
||||||
break;
|
|
||||||
case "2":
|
|
||||||
this.assortId = "2112";
|
|
||||||
break;
|
|
||||||
case "3":
|
|
||||||
this.assortId = "2113";
|
|
||||||
break;
|
|
||||||
case "4":
|
|
||||||
this.assortId = "2114";
|
|
||||||
break;
|
|
||||||
case "5":
|
|
||||||
this.assortId = "2115";
|
|
||||||
break;
|
|
||||||
case "6":
|
|
||||||
this.assortId = "2116";
|
|
||||||
break;
|
|
||||||
case "7":
|
|
||||||
this.assortId = "2117";
|
|
||||||
break;
|
|
||||||
case "8":
|
|
||||||
this.assortId = "2118";
|
|
||||||
break;
|
|
||||||
case "9":
|
|
||||||
this.assortId = "2119";
|
|
||||||
break;
|
|
||||||
case "10":
|
|
||||||
this.assortId = "21110";
|
|
||||||
break;
|
|
||||||
case "11":
|
|
||||||
this.assortId = "21111";
|
|
||||||
break;
|
|
||||||
case "12":
|
|
||||||
this.assortId = "21112";
|
|
||||||
break;
|
|
||||||
case "13":
|
|
||||||
this.assortId = "21113";
|
|
||||||
break;
|
|
||||||
case "14":
|
|
||||||
this.assortId = "21114";
|
|
||||||
break;
|
|
||||||
case "15":
|
|
||||||
this.assortId = "21115";
|
|
||||||
break;
|
|
||||||
case "16":
|
|
||||||
this.assortId = "21116";
|
|
||||||
break;
|
|
||||||
case "17":
|
|
||||||
this.assortId = "21117";
|
|
||||||
break;
|
|
||||||
case "18":
|
|
||||||
this.assortId = "21118";
|
|
||||||
break;
|
|
||||||
case "19":
|
|
||||||
this.assortId = "21119";
|
|
||||||
break;
|
|
||||||
case "20":
|
|
||||||
this.assortId = "21120";
|
|
||||||
break;
|
|
||||||
case "21":
|
|
||||||
this.assortId = "21121";
|
|
||||||
break;
|
|
||||||
case "22":
|
|
||||||
this.assortId = "21122";
|
|
||||||
break;
|
|
||||||
case "23":
|
|
||||||
this.assortId = "21123";
|
|
||||||
break;
|
|
||||||
case "24":
|
|
||||||
this.assortId = "21124";
|
|
||||||
break;
|
|
||||||
case "25":
|
|
||||||
this.assortId = "21125";
|
|
||||||
break;
|
|
||||||
case "26":
|
|
||||||
this.assortId = "21126";
|
|
||||||
break;
|
|
||||||
case "27":
|
|
||||||
this.assortId = "21127";
|
|
||||||
break;
|
|
||||||
case "28":
|
|
||||||
this.assortId = "21128";
|
|
||||||
break;
|
|
||||||
case "29":
|
|
||||||
this.assortId = "21129";
|
|
||||||
break;
|
|
||||||
case "30":
|
|
||||||
this.assortId = "21130";
|
|
||||||
break;
|
|
||||||
case "31":
|
|
||||||
this.assortId = "21131";
|
|
||||||
break;
|
|
||||||
case "32":
|
|
||||||
this.assortId = "21132";
|
|
||||||
break;
|
|
||||||
case "33":
|
|
||||||
this.assortId = "21133";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.assortId = "21133";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.jiashi.service;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2025/2/16 22:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class XiamenZhongHospConfirm {
|
||||||
|
private String id;
|
||||||
|
private String patname;
|
||||||
|
private String patno;
|
||||||
|
private String gestno;
|
||||||
|
private String outdate;
|
||||||
|
private List<String> paths;
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
|
||||||
|
<configuration scan="true" scanPeriod="10 seconds">
|
||||||
|
|
||||||
|
<!-- 以下配置修改自springboot -->
|
||||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||||
|
<conversionRule conversionWord="wex"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||||
|
<conversionRule conversionWord="wEx"
|
||||||
|
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||||
|
|
||||||
|
<!-- Simple file output -->
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
|
||||||
|
<encoder>
|
||||||
|
<pattern>${FILE_LOG_PATTERN:-%d{yyyy-MM-dd HH:mm:ss.SSS} [${HOSTNAME}]${LOG_LEVEL_PATTERN:-%5p} ${PID:- }
|
||||||
|
--- [%t] %-40.40logger{39} %L : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}
|
||||||
|
</pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>log/discovery-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<maxFileSize>50MB</maxFileSize>
|
||||||
|
</rollingPolicy>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>debug</level>
|
||||||
|
</filter>
|
||||||
|
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
|
||||||
|
<prudent>true</prudent>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="FILE_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<queueSize>512</queueSize>
|
||||||
|
<appender-ref ref="FILE"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Console output -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
|
||||||
|
<encoder>
|
||||||
|
<pattern>${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint}
|
||||||
|
[${HOSTNAME}]%clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint}
|
||||||
|
%clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %L %clr(:){faint}
|
||||||
|
%m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}
|
||||||
|
</pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<!-- Only log level WARN and above -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>debug</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- For loggers in the these namespaces, log at all levels. -->
|
||||||
|
<logger name="pedestal" level="ALL"/>
|
||||||
|
<logger name="hammock-cafe" level="ALL"/>
|
||||||
|
<logger name="user" level="ALL"/>
|
||||||
|
|
||||||
|
<!--显示日志-->
|
||||||
|
<logger name="org.springframework.jdbc.core" additivity="false" level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
<appender-ref ref="FILE_ASYNC"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="FILE_ASYNC"/>
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" >
|
||||||
|
<title>静态资源hello</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
静态资源hello
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Reference in New Issue