commit b578a5b25008aa8b4f5fa54bc2db13ea8287a206 Author: 宇宙皮皮娃 <2964346877@qq.com> Date: Thu Mar 9 15:48:32 2023 +0800 v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a8a1e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +docus-services/docus-services-system1/ + +### IntelliJ IDEA ### +*.log +.idea +*.iws +*.iml +*.ipr +mvnw* +*.cmd +*.mvn +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ +logs* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3cc485f --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ + +框架说明 + + +项目结构 +``` +backup --业务模块 备份 + controller --前端接口层 + param --接口参数 + vo --返回视图 + feign --服务接口层 + infrastructure --基础设施层 + cache --mybatis 和 feign 接口的缓存层 + client --访问对外接口,例如 feign ,ws 等 + dao --连接数据库 + job --xxl-job + service --业务代码 + impl --service 实现类 +inspection -- 业务模块 采集器 + controller --前端接口层 + param --接口参数 + vo --返回视图 + feign --服务接口层 + infrastructure --基础设施层 + cache --mybatis 和 feign 接口的缓存层 + client --访问对外接口,例如 feign ,ws 等 + dao --连接数据库 + job --xxl-job + service --业务代码 + impl --service 实现类 +``` + + +这个是一个模板,需要启动新项目的,复制一份,并且修改 项目名称以及修改docus-demo 跟项目名称一致即可启动。 diff --git a/WinSW.exe b/WinSW.exe new file mode 100644 index 0000000..6806bb4 Binary files /dev/null and b/WinSW.exe differ diff --git a/assembly.xml b/assembly.xml new file mode 100644 index 0000000..b6fb827 --- /dev/null +++ b/assembly.xml @@ -0,0 +1,73 @@ + + + exe + + dir + + false + + + + + /lib + ${basedir}/target/lib + + + + /config + ${basedir}/target/resources + 0755 + + *.xml + *.yml + *.properties + + + + + /dataConfig + ${basedir}/target/dataConfig + 0755 + + *.json + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.bat + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.xml + + + + + / + ${basedir} + 0755 + + *.exe + + + + + ${basedir}/target + / + 0755 + + ${project.build.finalName}.jar + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e8cf8ae --- /dev/null +++ b/pom.xml @@ -0,0 +1,330 @@ + + + + com.docus + docus-bom + 1.0-SNAPSHOT + + 4.0.0 + + docus-mzzy-collector + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + checker-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + + + org.springframework.boot + spring-boot-starter-web + + + com.docus + docus-mybatisplus-starter + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + HdrHistogram + org.hdrhistogram + + + jsr305 + com.google.code.findbugs + + + + + mysql + mysql-connector-java + 8.0.28 + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.bgee.log4jdbc-log4j2 + log4jdbc-log4j2-jdbc4.1 + + + com.alibaba + druid + 1.2.4 + compile + + + com.baomidou + mybatis-plus-generator + 3.4.1 + compile + + + org.apache.velocity + velocity-engine-core + 2.0 + + + com.xuxueli + xxl-job-core + + + com.docus + docus-base-starter + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + com.docus + docus-tool-starter + + + + com.docus + docus-shiro-starter + + + + com.docus + docus-excel-starter + 0.0.1-SNAPSHOT + + + + com.docus + docus-base-starter + + + springfox-core + io.springfox + + + springfox-schema + io.springfox + + + springfox-spi + io.springfox + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + com.microsoft.sqlserver + sqljdbc4 + 4.0 + + + + + + + src/main/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.4 + + ZIP + + + non-exists + non-exists + + + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + target/lib + false + false + runtime + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + **/*.* + + + + ${project.build.directory}/resources + + + + copy-bin + package + + copy-resources + + + + + src/main/resources + true + + bin/*.xml + bin/*.bat + *.yml + + + + ${project.build.directory}/resources + + + + copy-data-config + package + + copy-resources + + + + + ../../dataConfig + true + + + ${project.build.directory}/dataConfig + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + **/*.yml + + + + + + maven-assembly-plugin + + + + ${project.artifactId} + false + + assembly.xml + + + make-assembly + package + + single + + + + + + + + + + + dev + + prod + + + true + + + + + + + + diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java new file mode 100644 index 0000000..225ee49 --- /dev/null +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -0,0 +1,19 @@ +package com.docus.server; + + + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +@Slf4j +//@EnableFeignClients(basePackages = ("com.feign")) +//@EnableHystrix +@SpringBootApplication(scanBasePackages ={"com.docus"}) +public class AppRunBootstrap { + public static void main(String[] args) { + System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); + SpringApplication.run(AppRunBootstrap.class,args); + } +} diff --git a/src/main/java/com/docus/server/MybatisPlusGenerator.java b/src/main/java/com/docus/server/MybatisPlusGenerator.java new file mode 100644 index 0000000..d3fe0b5 --- /dev/null +++ b/src/main/java/com/docus/server/MybatisPlusGenerator.java @@ -0,0 +1,95 @@ +package com.docus.server;//package com.docus.server.clinicqualitycontrol.all; +// +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; + +import java.util.HashMap; +import java.util.Map; + +/** + * mybatis plus代码生成器 + */ +public class MybatisPlusGenerator { + + public static void main(String[] args) { + //获得entity目录 + String entity = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\entity\\"; + //获取mapper目录 + String mapper = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\mapper"; + //获取mapper的xml目录 + String mapperxml = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\resources\\mapper"; + //获取模块名 + //获取service目录 + String service = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\facade"; + //获得serviceimpl目录 + String serviceImpl = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\service"; + +// //获得controller目录 + String controller = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-controller\\src\\main\\java\\com\\docus\\services\\system\\controller"; + //1,代码生成器 + AutoGenerator mpg = new AutoGenerator(); + // 2、全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); //重新生成时文件是否覆盖 + + //UserServie + //gc.setServiceName("%sService"); //去掉Service接口的首字母I + gc.setAuthor("jiashi"); //自定义作者 + gc.setOpen(false); //生成后是否打开资源管理器 + gc.setIdType(IdType.INPUT); //主键策略 + gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 + gc.setSwagger2(true);//开启Swagger2模式 + mpg.setGlobalConfig(gc); + + //数据库配置 + DataSourceConfig dataSourceConfig = new DataSourceConfig(); + dataSourceConfig.setUrl("jdbc:log4jdbc:mysql://8.134.10.251:3306/docus_inspection?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"); + dataSourceConfig.setDriverName("net.sf.log4jdbc.sql.jdbcapi.DriverSpy"); + dataSourceConfig.setUsername("docus"); + dataSourceConfig.setPassword("docus702"); + mpg.setDataSource(dataSourceConfig); + + //包配置 + PackageConfig pc = new PackageConfig(); + //设置自定义输出目录(分布式项目使用) + Map pathInfo = new HashMap<>(); +// pathInfo.put(ConstVal.ENTITY_PATH, entity); +// pathInfo.put(ConstVal.MAPPER_PATH, mapper); +// pathInfo.put(ConstVal.XML_PATH, mapperxml); +// pathInfo.put(ConstVal.SERVICE_PATH, service); +// pathInfo.put(ConstVal.SERVICE_IMPL_PATH, serviceImpl); + pathInfo.put(ConstVal.CONTROLLER_PATH, controller); + pc.setPathInfo(pathInfo); + mpg.setPackageInfo(pc); + //设置自定义包名 + pc.setParent("com.docus.services.system"); + pc.setService("facade"); + pc.setServiceImpl("service"); + mpg.setPackageInfo(pc); + + // 5、策略配置 + StrategyConfig strategy = new StrategyConfig(); + + strategy.setInclude("inspection_status"); //要生成的表 + + strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 + strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀 + + strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 + strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 + + strategy.setRestControllerStyle(true); //restful api风格控制器 + strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 + + mpg.setStrategy(strategy); + + + // 6、执行 + mpg.execute(); + + //7,注意的是,需将service包中生成的serviceImpl中的@Service注解改成@DubboService注解 + } +} diff --git a/src/main/java/com/docus/server/XxlJobConfig.java b/src/main/java/com/docus/server/XxlJobConfig.java new file mode 100644 index 0000000..d9edbfa --- /dev/null +++ b/src/main/java/com/docus/server/XxlJobConfig.java @@ -0,0 +1,87 @@ +package com.docus.server; +import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2021/5/7 16:23 + * @UpdateUser: 曾文和 + * @UpdateDate: 2021/5/7 16:23 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ + + + +@Configuration +public class XxlJobConfig { + private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); + + @Value("${xxl.job.admin.addresses}") + private String adminAddresses; + + @Value("${xxl.job.accessToken}") + private String accessToken; + + @Value("${xxl.job.executor.appname}") + private String appname; + + @Value("${xxl.job.executor.address}") + private String address; + + @Value("${xxl.job.executor.ip}") + private String ip; + + @Value("${xxl.job.executor.port}") + private int port; + + @Value("${xxl.job.executor.logpath}") + private String logPath; + + @Value("${xxl.job.executor.logretentiondays}") + private int logRetentionDays; + + + @Bean + public XxlJobSpringExecutor xxlJobExecutor() { + logger.info(">>>>>>>>>>> xxl-job config init."); + XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); + xxlJobSpringExecutor.setAdminAddresses(adminAddresses); + xxlJobSpringExecutor.setAppname(appname); + xxlJobSpringExecutor.setAddress(address); + xxlJobSpringExecutor.setIp(ip); + xxlJobSpringExecutor.setPort(port); + xxlJobSpringExecutor.setAccessToken(accessToken); + xxlJobSpringExecutor.setLogPath(logPath); + xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); + + return xxlJobSpringExecutor; + } + + /** + * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP; + * + * 1、引入依赖: + * + * org.springframework.cloud + * spring-cloud-commons + * ${version} + * + * + * 2、配置文件,或者容器启动变量 + * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' + * + * 3、获取IP + * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + *//* + +*/ +} diff --git a/src/main/java/com/docus/server/backup/controller/Package.java b/src/main/java/com/docus/server/backup/controller/Package.java new file mode 100644 index 0000000..8ed63a0 --- /dev/null +++ b/src/main/java/com/docus/server/backup/controller/Package.java @@ -0,0 +1,5 @@ +package com.docus.server.backup.controller; + +public class Package { + +} diff --git a/src/main/java/com/docus/server/backup/controller/param/Package.java b/src/main/java/com/docus/server/backup/controller/param/Package.java new file mode 100644 index 0000000..d0de137 --- /dev/null +++ b/src/main/java/com/docus/server/backup/controller/param/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.controller.param; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/controller/vo/Package.java b/src/main/java/com/docus/server/backup/controller/vo/Package.java new file mode 100644 index 0000000..b2addde --- /dev/null +++ b/src/main/java/com/docus/server/backup/controller/vo/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.controller.vo; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/infrastructure/Package.java b/src/main/java/com/docus/server/backup/infrastructure/Package.java new file mode 100644 index 0000000..50853a3 --- /dev/null +++ b/src/main/java/com/docus/server/backup/infrastructure/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.infrastructure; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/infrastructure/cache/Package.java b/src/main/java/com/docus/server/backup/infrastructure/cache/Package.java new file mode 100644 index 0000000..61baaaf --- /dev/null +++ b/src/main/java/com/docus/server/backup/infrastructure/cache/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.infrastructure.cache; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/infrastructure/client/Package.java b/src/main/java/com/docus/server/backup/infrastructure/client/Package.java new file mode 100644 index 0000000..8add156 --- /dev/null +++ b/src/main/java/com/docus/server/backup/infrastructure/client/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.infrastructure.client; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/infrastructure/dao/Package.java b/src/main/java/com/docus/server/backup/infrastructure/dao/Package.java new file mode 100644 index 0000000..a9898d4 --- /dev/null +++ b/src/main/java/com/docus/server/backup/infrastructure/dao/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.infrastructure.dao; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/service/Package.java b/src/main/java/com/docus/server/backup/service/Package.java new file mode 100644 index 0000000..67866be --- /dev/null +++ b/src/main/java/com/docus/server/backup/service/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.service; + +public class Package { +} diff --git a/src/main/java/com/docus/server/backup/service/impl/Package.java b/src/main/java/com/docus/server/backup/service/impl/Package.java new file mode 100644 index 0000000..f618c4c --- /dev/null +++ b/src/main/java/com/docus/server/backup/service/impl/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.backup.service.impl; + +public class Package { +} diff --git a/src/main/java/com/docus/server/inspection/controller/TestController.java b/src/main/java/com/docus/server/inspection/controller/TestController.java new file mode 100644 index 0000000..493479c --- /dev/null +++ b/src/main/java/com/docus/server/inspection/controller/TestController.java @@ -0,0 +1,27 @@ +package com.docus.server.inspection.controller; + +import com.docus.infrastructure.util.easyexcel.ExcelUtil; +import com.docus.infrastructure.web.api.CommonResult; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +@RestController +public class TestController { + + + @RequestMapping("upload") + public void upload(MultipartFile multipartFile){ + List objects = ExcelUtil.readExcel(multipartFile, null); + System.out.println(objects); + } + + + @RequestMapping("test") + public CommonResult test(){ + + return CommonResult.success(""); + } +} diff --git a/src/main/java/com/docus/server/inspection/infrastructure/Package.java b/src/main/java/com/docus/server/inspection/infrastructure/Package.java new file mode 100644 index 0000000..c73e90e --- /dev/null +++ b/src/main/java/com/docus/server/inspection/infrastructure/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.inspection.infrastructure; + +public class Package { +} diff --git a/src/main/java/com/docus/server/inspection/service/Package.java b/src/main/java/com/docus/server/inspection/service/Package.java new file mode 100644 index 0000000..185553d --- /dev/null +++ b/src/main/java/com/docus/server/inspection/service/Package.java @@ -0,0 +1,4 @@ +package com.docus.server.inspection.service; + +public class Package { +} diff --git a/src/main/resources/bin/auto.bat b/src/main/resources/bin/auto.bat new file mode 100644 index 0000000..b07af42 --- /dev/null +++ b/src/main/resources/bin/auto.bat @@ -0,0 +1,6 @@ +@echo off + + +WinSW.exe status|findstr NonExistent && winsw install + +WinSW.exe status|findstr stopped && winsw start diff --git a/src/main/resources/bin/jenkins-update.bat b/src/main/resources/bin/jenkins-update.bat new file mode 100644 index 0000000..8bf21eb --- /dev/null +++ b/src/main/resources/bin/jenkins-update.bat @@ -0,0 +1,20 @@ +@echo off + +set deployDir=%1\@project.artifactId@ +if %deployDir%=="" set deployDir=d:\webroot\@project.artifactId@ + +set curr_file=%cd% +cd /d %deployDir% +call stop.bat +sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul +cd %curr_file% +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\dataConfig +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar +xcopy /Y/E/I * %deployDir% + +cd /d %deployDir% +call auto.bat +cd %curr_file% + diff --git a/src/main/resources/bin/start.bat b/src/main/resources/bin/start.bat new file mode 100644 index 0000000..58c25cb --- /dev/null +++ b/src/main/resources/bin/start.bat @@ -0,0 +1,21 @@ +set java_opts=-Xms512m -Xmx512m +set key="java_opts" + + +rem 文件不存在,就跳过 +if not exist java-ops.ini goto end + +for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do ( + if "%%i"==%key% set java_opts=%%j) +echo java_opts is : %java_opts% + +:end + +rem 启动java + +java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar + + + + + diff --git a/src/main/resources/bin/stop.bat b/src/main/resources/bin/stop.bat new file mode 100644 index 0000000..1e224c0 --- /dev/null +++ b/src/main/resources/bin/stop.bat @@ -0,0 +1,3 @@ +@echo off + +winsw stop diff --git a/src/main/resources/bin/update.bat b/src/main/resources/bin/update.bat new file mode 100644 index 0000000..67730ec --- /dev/null +++ b/src/main/resources/bin/update.bat @@ -0,0 +1,47 @@ +@echo off + +set curr_file=%cd% + +set parentDir=%1 +if %parentDir%=="" set deployDir=d:\webroot + + +set deployDir=%parentDir%\@project.artifactId@ + +set backupDir=%parentDir%\backup + +set dateStr=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2% + + +cd /d %deployDir% + +call stop.bat +sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul + +cd /d %parentDir% + +xcopy /Y/E/I project.artifactId@\lib %backupDir%\%dateStr%\@project.artifactId@lib +xcopy /Y/E/I project.artifactId@\config %backupDir%\%dateStr%\@project.artifactId@config +xcopy /Y/E/I project.artifactId@\*.jar %backupDir%\%dateStr%\@project.artifactId@ +xcopy /Y/E/I project.artifactId@\*.bat %backupDir%\%dateStr%\@project.artifactId@ +xcopy /Y/E/I project.artifactId@\*.exe %backupDir%\%dateStr%\@project.artifactId@ +xcopy /Y/E/I project.artifactId@\*.xml %backupDir%\%dateStr%\@project.artifactId@ + + +cd %curr_file% + +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar + + +xcopy /Y/E/I lib %deployDir%\lib +xcopy /Y/E/I config %deployDir%\config +xcopy /Y/E/I *.jar %deployDir% +xcopy /Y/E/I *.bat %deployDir% +xcopy /Y/E/I *.exe %deployDir% +xcopy /Y/E/I *.xml %deployDir% + +cd /d %deployDir% +call auto.bat +cd %curr_file% \ No newline at end of file diff --git a/src/main/resources/bin/winsw.xml b/src/main/resources/bin/winsw.xml new file mode 100644 index 0000000..de346eb --- /dev/null +++ b/src/main/resources/bin/winsw.xml @@ -0,0 +1,10 @@ + + docus-spring-template + 生产-模板-管理 + 生产-模板-管理 + Automatic + %BASE%\start.bat + + nacos + seata-server + \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..0b35348 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,70 @@ +server: + port: 9 +spring: + profiles: + active: dev + application: + name: @artifactId@ + datasource: + url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: docus + password: docus702 + driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + type: com.alibaba.druid.pool.DruidDataSource + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超 时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 + + redis: + host: redis.docus.cn + password: 123456 + cloud: + nacos: + discovery: + server-addr: nacos.docus.cn + namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5 + config: + server-addr: ${spring.cloud.nacos.discovery.server-addr} + namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5 + file-extension: yml + shared-configs: + - comm.${spring.cloud.nacos.config.file-extension} + + +docus: + dbtype: mysql + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + field-strategy: NOT_EMPTY + db-type: MYSQL +xxl: + job: + accessToken: + admin: + addresses: http://job.docus.cn:8180/xxl-job-admin + executor: + appname: docus-inspection + address: + ip: + port: 17781 + logretentiondays: 30 + logpath: D:/xxl-job/inspection diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 0000000..5cb6f99 --- /dev/null +++ b/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,2 @@ +# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..2c982f3 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,95 @@ + + + docus-server-fistpage + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n + + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}%d.%i.log + + 500MB + + 30 + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}external%d.%i.log + + 500MB + + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +