Commit 607da737 authored by 雷明明's avatar 雷明明

init

parent d34508fa
......@@ -141,5 +141,17 @@
</dependencies>
<build>
<!--指定resource中的xml和properties以及html文件编译到类路径中,
供运行的时候使用-->
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
package com.jz.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 CrosConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowCredentials(true)
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.maxAge(3600);
}
}
\ No newline at end of file
package com.jz.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
// http://localhost:8084/swagger-ui.html 原路径
// http://localhost:8084/doc.html 新路径
// 配置swagger2核心配置 docket
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) // 指定api类型为swagger2
.apiInfo(apiInfo()) // 用于定义api文档汇总信息
.select()
.apis(RequestHandlerSelectors
.basePackage("com.jz.controller")) // 指定controller包
.paths(PathSelectors.any()) // 所有controller
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("接口api") // 文档页标题
.contact(new Contact("见著科技",
"https://www.jz.com",
"abc@jz.com")) // 联系人信息
.description("31所api接口文档") // 详细信息
.version("1.0.0") // 文档版本号
.termsOfServiceUrl("https://www.xxx.com") // 网站地址
.build();
}
}
package com.jz.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ResourceUtils;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @ClassName:WebMvcConfig
* @Auther: lei
* @Description:
* @Date: 2023-02-08 14
*/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
}
############################################################
#
# web访问端口号 约定:8088
#
############################################################
server:
port: ${PORT:8084}
tomcat:
uri-encoding: UTF-8
max-http-header-size: 80KB
############################################################
#
# 配置数据源信息
#
############################################################
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.oscar.Driver
url: jdbc:oscar://${DB_HOST:192.168.0.180}:2003/OSRDB?serverTimezone=UTC&useSSL=FALSE
username: ${DB_USERNAME:HYHMES}
password: ${DB_PASSWORD:admin}
hikari:
connection-timeout: 30000 # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
minimum-idle: 5 # 最小连接数
maximum-pool-size: 20 # 最大连接数
auto-commit: true # 自动提交
idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
pool-name: DateSourceHikariCP # 连接池名字
max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
connection-test-query: SELECT 1
#json文件传输地址配置
my-json-file:
status:
order: true #是否开启order执行程序
special-page: true #是否开启special-page执行程序
user: true #是否开启user执行程序
path:
order: D:\jsonFile\orderData\
order-file: D:\jsonFile\fileData\
special-page: D:\jsonFile\specialPage\
user: D:\jsonFile\userData\
export-path:
execute: D:\jsonExport\executeData\
result: D:\jsonExport\resultData\
module: D:\jsonExport\moduleFileData\
user: D:\jsonExport\personnelData\
\ No newline at end of file
############################################################
#
# web访问端口号 约定:8088
#
############################################################
server:
port: ${PORT:8084}
tomcat:
uri-encoding: UTF-8
max-http-header-size: 80KB
############################################################
#
# 配置数据源信息
#
############################################################
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.oscar.Driver
url: jdbc:oscar://${DB_HOST:localhost}:2003/OSRDB?serverTimezone=UTC&useSSL=FALSE
username: ${DB_USERNAME:HYHMES}
password: ${DB_PASSWORD:admin}
hikari:
connection-timeout: 30000 # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
minimum-idle: 5 # 最小连接数
maximum-pool-size: 20 # 最大连接数
auto-commit: true # 自动提交
idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
pool-name: DateSourceHikariCP # 连接池名字
max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
connection-test-query: SELECT 1
#json文件传输地址配置
my-json-file:
status:
order: true #是否开启order执行程序
special-page: true #是否开启special-page执行程序
user: true #是否开启user执行程序
path:
order: D:\jsonFile\orderData\
order-file: D:\jsonFile\fileData\
special-page: D:\jsonFile\specialPage\
user: D:\jsonFile\userData\
export-path:
execute: D:\jsonExport\executeData\
result: D:\jsonExport\resultData\
module: D:\jsonExport\moduleFileData\
user: D:\jsonExport\personnelData\
\ No newline at end of file
############################################################
#
# web访问端口号 约定:8088
#
############################################################
server:
port: ${PORT:8084}
tomcat:
uri-encoding: UTF-8
max-http-header-size: 80KB
############################################################
#
# 配置数据源信息
#
############################################################
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.oscar.Driver
url: jdbc:oscar://${DB_HOST:10.83.100.150}:2003/OSRDB?serverTimezone=UTC&useSSL=FALSE
username: ${DB_USERNAME:SYSDBA}
password: ${DB_PASSWORD:szoscar55}
hikari:
connection-timeout: 30000 # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
minimum-idle: 5 # 最小连接数
maximum-pool-size: 20 # 最大连接数
auto-commit: true # 自动提交
idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
pool-name: DateSourceHikariCP # 连接池名字
max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
connection-test-query: SELECT 1
#json文件传输地址配置
my-json-file:
status:
order: true #是否开启order执行程序
special-page: true #是否开启special-page执行程序
user: true #是否开启user执行程序
path:
order: /usr/local/jsonFile/orderData/
order-file: /usr/local/jsonFile/fileData/
special-page: /usr/local/jsonFile/specialPage/
user: /usr/local/jsonFile/userData/
export-path:
execute: /usr/local/jsonExport/executeData/
result: /usr/local/jsonExport/resultData/
module: /usr/local/jsonExport/moduleFileData/
user: /usr/local/jsonExport/personnelData/
############################################################
#
# web访问端口号 约定:8088
#
############################################################
server:
port: ${PORT:8084}
tomcat:
uri-encoding: UTF-8
max-http-header-size: 80KB
############################################################
#
# 配置数据源信息
#
############################################################
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.oscar.Driver
url: jdbc:oscar://${DB_HOST:47.92.102.113}:2003/OSRDB?serverTimezone=UTC&useSSL=FALSE
username: ${DB_USERNAME:HYHMES}
password: ${DB_PASSWORD:admin}
hikari:
connection-timeout: 30000 # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
minimum-idle: 5 # 最小连接数
maximum-pool-size: 20 # 最大连接数
auto-commit: true # 自动提交
idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
pool-name: DateSourceHikariCP # 连接池名字
max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
connection-test-query: SELECT 1
#json文件传输地址配置
my-json-file:
status:
order: true #是否开启order执行程序
special-page: true #是否开启special-page执行程序
user: true #是否开启user执行程序
path:
order: E:\jsonFile\orderData\
order-file: E:\jsonFile\fileData\
special-page: E:\jsonFile\specialPage\
user: E:\jsonFile\userData\
export-path:
execute: E:\jsonExport\executeData\
result: E:\jsonExport\resultData\
module: E:\jsonExport\moduleFileData\
user: E:\jsonExport\personnelData\
\ No newline at end of file
spring:
# 环境 dev:开发环境|test:测试环境|prod:生产环境
profiles:
# active: pro #产品环境的配置文件
active: dev #180数据库 的配置
# active: local #本地的配置
# active: test #113测试环境配置文件
servlet:
multipart:
enabled: true
max-file-size: 100MB
max-request-size: 100MB
log4j.rootLogger=INFO,stdout,file
log4j.additivity.org.apache=true
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.threshold=DEBUG
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.DatePattern='.'yyyy-MM-dd-HH-mm
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.file.Threshold=ERROR
log4j.appender.file.append=true
log4j.appender.file.File=/workspaces/logs/mes-api/Syslog.log
log4j.logger.org.mybatis=ERROR
log4j.logger.java.sql=ERROR
log4j.logger.java.sql.statement=ERROR
log4j.logger.java.sql.ResultSet=ERROR
log4j.logger.java.sql.PreparedStatement=ERROR
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment