Commit 6a0e641a by 吴学德

修改 pom文件

parent f32bb38b
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>school-center</artifactId>
<groupId>com.winsun.gdtel.gztel</groupId>
<version>0.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.winsun.gdtel.gztel</groupId>
<artifactId>new-user</artifactId> <artifactId>new-user</artifactId>
<version>0.0.2</version> <description>外呼集约系统主要服务模块</description>
<packaging>war</packaging> <version>0.0.1</version>
<name>new-user Maven Webapp</name> <dependencies>
<!-- FIXME change it to the project's website --> <!-- 为了节省内存,改用jetty -->
<url>http://www.example.com</url> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- 去除默认tomcat配置 -->
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
<!-- 去除默认日志配置 -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<!-- 为了节省内存,改用jetty -->
<properties> <!--spring boot依赖 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <dependency>
<maven.compiler.source>1.7</maven.compiler.source> <groupId>org.springframework.boot</groupId>
<maven.compiler.target>1.7</maven.compiler.target> <artifactId>spring-boot-starter-log4j2</artifactId>
</properties> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>junit</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
<artifactId>winsun-utils-redis</artifactId>
<version>${winsun-framework.version}</version>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
<artifactId>winsun-core-api</artifactId>
</dependency>
<!-- 数据库连接部分 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<artifactId>p6spy</artifactId>
<groupId>p6spy</groupId>
</dependency>
<dependency>
<artifactId>druid-spring-boot-starter</artifactId>
<groupId>com.alibaba</groupId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.gdtel.gztel</groupId>
<artifactId>common</artifactId>
<version>${service.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>new-user</finalName> <finalName>new-user</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <groupId>org.springframework.boot</groupId>
<version>3.1.0</version> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> <configuration>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --> <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
<plugin> </configuration>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> <resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build> </build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profileActive>local</profileActive>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<profileActive>dev</profileActive>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
</project> </project>
\ No newline at end of file
package com.winsun;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 系统启动入口
* @author Liph
*/
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableEurekaClient
@SpringBootApplication(exclude= {DruidDataSourceAutoConfigure.class})
@RefreshScope
@EnableFeignClients({"com.winsun","com.winsun.auth.core"})
@MapperScan(basePackages = {"com.winsun.*.mapper","com.winsun.mapper"})
@EnableScheduling // 开启定时任务
public class SchoolServiceApplication {
private final static Logger logger = LoggerFactory.getLogger(SchoolServiceApplication.class);
public static void main(String[] args) {
SpringApplication.run(SchoolServiceApplication.class, args);
logger.info("集约平台核心服务系统模块启动成功!!!");
}
}
package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.mapper.PackageMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author: chancy
* @Date: 2020/2/12 17:25
*/
@Slf4j
@RestController
@RequestMapping("/school/package")
public class PackageController {
private static PackageMapper packageMapper;
@Autowired
public PackageController(PackageMapper packageMapper){
PackageController.packageMapper=packageMapper;
}
@Permission(menuname = "添加套餐信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertPackage(){
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除套餐信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deletePackage(){
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改套餐信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updatePackage(){
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询套餐信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<Package>> selectPackage(){
return null;
}
}
package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.bean.Salesperson;
import com.winsun.mapper.SalespersonMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
* @Author: chancy
* @Date: 2020/2/12 17:26
*/
@Slf4j
@RestController
@RequestMapping("/school/salesperson")
public class SalespersonController {
private static SalespersonMapper salespersonMapper;
@Autowired
public SalespersonController(SalespersonMapper salespersonMapper){
SalespersonController.salespersonMapper=salespersonMapper;
}
@Permission(menuname = "添加合伙人信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertSalesperson(){
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除合伙人信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deleteSalesperson(){
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改合伙人信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateSalesperson(){
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询合伙人信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<Salesperson>> selectSalesperson(){
return null;
}
}
package com.winsun.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.bean.School;
import com.winsun.mapper.SchoolMapper;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.winsun.auth.core.common.model.ResponseData;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: chancy
* @Date: 2020/2/12 17:25
*/
@Slf4j
@RestController
@RequestMapping("/school/school")
public class SchoolController {
private static SchoolMapper schoolMapper;
@Autowired
public SchoolController(SchoolMapper schoolMapper){
SchoolController.schoolMapper=schoolMapper;
}
@Permission(menuname = "添加學校信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertSchool(@RequestParam("school")String school){
School school1 = JSON.parseObject(school, School.class);
schoolMapper.insert(school1);
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除學校信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deleteSchool(@RequestParam("id")String id){
schoolMapper.deleteById(id);
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改學校信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateSchool(@RequestParam("school")String school){
School school1 = JSON.parseObject(school, School.class);
Wrapper wrapper = new EntityWrapper<>();
wrapper.eq("id",school1.getId());
/**
* 待定............................
*/
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("school_name","");
schoolMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询學校信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<School>> selectSchool(@RequestParam("subName")String subName,@RequestParam("status")String status,
@RequestParam("schoolName")String schoolName){
return null;
}
}
eureka:
instance:
hostname: eureka
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://eureka:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
spring:
profiles:
active: dev
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
password: ${spring.rabbitmq.username}
username: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: jyyy-rabbitmq
port: 5672
username: guest
password: guest
redis:
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- jyyy-redis:6379
database: 0
host: jyyy-redis
port: 6379
password:
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
ip:
exprie: 600
prohibition: 600
datasource:
#url: jdbc:mysql://jyyy-mysql:3306/jyyy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
#username: root
#password: 123456
#filters: wall,mergeStat
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
timeoutInMilliseconds: 4500 #断路器超时时间,默认1000ms
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
\ No newline at end of file
eureka:
instance:
hostname: eureka
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://eureka:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
spring:
profiles:
active: prod
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
username: ${spring.rabbitmq.username}
password: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: rabbitmq
port: 5672
username: guest
password: guest
redis:
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- redis:6379
database: 0
host: redis
port: 6379
password: QpUd11WzsuBV3RZd
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
ip:
exprie: 600
prohibition: 600
datasource:
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
timeoutInMilliseconds: 4500 #断路器超时时间,默认1000ms
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
\ No newline at end of file
eureka:
instance:
hostname: localhost
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://localhost:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
fileUploadPath: tmpUpload/
spring:
profiles:
active: local
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
username: ${spring.rabbitmq.username}
password: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
redis:
# 是否使用集群模式
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- localhost:6379
database: 0
host: localhost
port: 6379
password:
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 50000
ip:
exprie: 600
prohibition: 600
datasource:
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
#断路器超时时间,默认1000ms
timeoutInMilliseconds: 4500
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
- com/winsun/modular/dao/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
<?xml version="1.0" encoding="UTF-8"?>
<!-- RollingRandomAccessFile的属性:
fileName 指定当前日志文件的位置和文件名称
filePattern 指定当发生Rolling时,文件的转移和重命名规则
SizeBasedTriggeringPolicy 指定当文件体积大于size指定的值时,触发Rolling
DefaultRolloverStrategy 指定最多保存的文件个数
TimeBasedTriggeringPolicy 这个配置需要和filePattern结合使用,
注意filePattern中配置的文件重命名规则是${FILE_NAME}-%d{yyyy-MM-dd HH-mm}-%i,最小的时间粒度是mm,即分钟,
TimeBasedTriggeringPolicy指定的size是1,结合起来就是每1分钟生成一个新文件。
如果改成%d{yyyy-MM-dd HH},最小粒度为小时,则每一个小时生成一个文件。 -->
<Configuration status="off" monitorInterval="30">
<properties>
<property name="log_path">logs</property>
</properties>
<Appenders>
<!-- <NoSql name="databaseAppender">
<MongoDb databaseName="db_cloud_device" collectionName="extract-invoice_log"
server="127.0.0.1" port="27017" userName="gzds" password="Gzds1130" />
</NoSql> -->
<!-- 打印台 -->
<Console name="Console" target="SYSTEM_OUT">
<!--控制台只输出level及以上级别的信息-->
<PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss} %level [%file:%line] - %msg%n"/>
</Console>
<RollingRandomAccessFile name="InfoFile"
fileName="${log_path}/info/info.log"
filePattern="${log_path}/info/info-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="WarnFile" fileName="${log_path}/warn/warn.log"
filePattern="${log_path}/error/error-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd_HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="ErrorFile"
fileName="${log_path}/error/error.log"
filePattern="${log_path}/error/error-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd_HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<appender-ref ref="Console"/>
<appender-ref ref="InfoFile"/>
<appender-ref ref="WarnFile"/>
<appender-ref ref="ErrorFile"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
appender=com.p6spy.engine.spy.appender.Slf4JLogger
\ No newline at end of file
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>school-center</artifactId> <artifactId>school-center</artifactId>
...@@ -10,61 +10,161 @@ ...@@ -10,61 +10,161 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>old-user</artifactId> <artifactId>old-user</artifactId>
<packaging>war</packaging> <description>外呼集约系统主要服务模块</description>
<version>0.0.1</version>
<name>old-user Maven Webapp</name> <dependencies>
<!-- FIXME change it to the project's website --> <!-- 为了节省内存,改用jetty -->
<url>http://www.example.com</url> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- 去除默认tomcat配置 -->
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
<!-- 去除默认日志配置 -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<!-- 为了节省内存,改用jetty -->
<properties> <!--spring boot依赖 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <dependency>
<maven.compiler.source>1.7</maven.compiler.source> <groupId>org.springframework.boot</groupId>
<maven.compiler.target>1.7</maven.compiler.target> <artifactId>spring-boot-starter-log4j2</artifactId>
</properties> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>junit</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
<artifactId>winsun-utils-redis</artifactId>
<version>${winsun-framework.version}</version>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
<artifactId>winsun-core-api</artifactId>
</dependency>
<!-- 数据库连接部分 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<artifactId>p6spy</artifactId>
<groupId>p6spy</groupId>
</dependency>
<dependency>
<artifactId>druid-spring-boot-starter</artifactId>
<groupId>com.alibaba</groupId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.gdtel.gztel</groupId>
<artifactId>common</artifactId>
<version>${service.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>old-user</finalName> <finalName>old-user</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <groupId>org.springframework.boot</groupId>
<version>3.1.0</version> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> <configuration>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --> <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
<plugin> </configuration>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> <resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build> </build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profileActive>local</profileActive>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<profileActive>dev</profileActive>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
</project> </project>
\ No newline at end of file
package com.winsun;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 系统启动入口
* @author Liph
*/
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableEurekaClient
@SpringBootApplication(exclude= {DruidDataSourceAutoConfigure.class})
@RefreshScope
@EnableFeignClients({"com.winsun","com.winsun.auth.core"})
@MapperScan(basePackages = {"com.winsun.*.mapper","com.winsun.mapper"})
@EnableScheduling // 开启定时任务
public class SchoolServiceApplication {
private final static Logger logger = LoggerFactory.getLogger(SchoolServiceApplication.class);
public static void main(String[] args) {
SpringApplication.run(SchoolServiceApplication.class, args);
logger.info("集约平台核心服务系统模块启动成功!!!");
}
}
package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.mapper.PackageMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author: chancy
* @Date: 2020/2/12 17:25
*/
@Slf4j
@RestController
@RequestMapping("/school/package")
public class PackageController {
private static PackageMapper packageMapper;
@Autowired
public PackageController(PackageMapper packageMapper){
PackageController.packageMapper=packageMapper;
}
@Permission(menuname = "添加套餐信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertPackage(){
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除套餐信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deletePackage(){
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改套餐信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updatePackage(){
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询套餐信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<Package>> selectPackage(){
return null;
}
}
package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.bean.Salesperson;
import com.winsun.mapper.SalespersonMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
* @Author: chancy
* @Date: 2020/2/12 17:26
*/
@Slf4j
@RestController
@RequestMapping("/school/salesperson")
public class SalespersonController {
private static SalespersonMapper salespersonMapper;
@Autowired
public SalespersonController(SalespersonMapper salespersonMapper){
SalespersonController.salespersonMapper=salespersonMapper;
}
@Permission(menuname = "添加合伙人信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertSalesperson(){
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除合伙人信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deleteSalesperson(){
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改合伙人信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateSalesperson(){
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询合伙人信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<Salesperson>> selectSalesperson(){
return null;
}
}
package com.winsun.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.bean.School;
import com.winsun.mapper.SchoolMapper;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.winsun.auth.core.common.model.ResponseData;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: chancy
* @Date: 2020/2/12 17:25
*/
@Slf4j
@RestController
@RequestMapping("/school/school")
public class SchoolController {
private static SchoolMapper schoolMapper;
@Autowired
public SchoolController(SchoolMapper schoolMapper){
SchoolController.schoolMapper=schoolMapper;
}
@Permission(menuname = "添加學校信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertSchool(@RequestParam("school")String school){
School school1 = JSON.parseObject(school, School.class);
schoolMapper.insert(school1);
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除學校信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deleteSchool(@RequestParam("id")String id){
schoolMapper.deleteById(id);
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改學校信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateSchool(@RequestParam("school")String school){
School school1 = JSON.parseObject(school, School.class);
Wrapper wrapper = new EntityWrapper<>();
wrapper.eq("id",school1.getId());
/**
* 待定............................
*/
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("school_name","");
schoolMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询學校信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<School>> selectSchool(@RequestParam("subName")String subName,@RequestParam("status")String status,
@RequestParam("schoolName")String schoolName){
return null;
}
}
eureka:
instance:
hostname: eureka
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://eureka:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
spring:
profiles:
active: dev
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
password: ${spring.rabbitmq.username}
username: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: jyyy-rabbitmq
port: 5672
username: guest
password: guest
redis:
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- jyyy-redis:6379
database: 0
host: jyyy-redis
port: 6379
password:
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
ip:
exprie: 600
prohibition: 600
datasource:
#url: jdbc:mysql://jyyy-mysql:3306/jyyy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
#username: root
#password: 123456
#filters: wall,mergeStat
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
timeoutInMilliseconds: 4500 #断路器超时时间,默认1000ms
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
\ No newline at end of file
eureka:
instance:
hostname: eureka
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://eureka:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
spring:
profiles:
active: prod
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
username: ${spring.rabbitmq.username}
password: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: rabbitmq
port: 5672
username: guest
password: guest
redis:
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- redis:6379
database: 0
host: redis
port: 6379
password: QpUd11WzsuBV3RZd
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
ip:
exprie: 600
prohibition: 600
datasource:
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
timeoutInMilliseconds: 4500 #断路器超时时间,默认1000ms
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
\ No newline at end of file
eureka:
instance:
hostname: localhost
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://localhost:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
fileUploadPath: tmpUpload/
spring:
profiles:
active: local
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
username: ${spring.rabbitmq.username}
password: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
redis:
# 是否使用集群模式
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- localhost:6379
database: 0
host: localhost
port: 6379
password:
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 50000
ip:
exprie: 600
prohibition: 600
datasource:
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
#断路器超时时间,默认1000ms
timeoutInMilliseconds: 4500
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
- com/winsun/modular/dao/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
<?xml version="1.0" encoding="UTF-8"?>
<!-- RollingRandomAccessFile的属性:
fileName 指定当前日志文件的位置和文件名称
filePattern 指定当发生Rolling时,文件的转移和重命名规则
SizeBasedTriggeringPolicy 指定当文件体积大于size指定的值时,触发Rolling
DefaultRolloverStrategy 指定最多保存的文件个数
TimeBasedTriggeringPolicy 这个配置需要和filePattern结合使用,
注意filePattern中配置的文件重命名规则是${FILE_NAME}-%d{yyyy-MM-dd HH-mm}-%i,最小的时间粒度是mm,即分钟,
TimeBasedTriggeringPolicy指定的size是1,结合起来就是每1分钟生成一个新文件。
如果改成%d{yyyy-MM-dd HH},最小粒度为小时,则每一个小时生成一个文件。 -->
<Configuration status="off" monitorInterval="30">
<properties>
<property name="log_path">logs</property>
</properties>
<Appenders>
<!-- <NoSql name="databaseAppender">
<MongoDb databaseName="db_cloud_device" collectionName="extract-invoice_log"
server="127.0.0.1" port="27017" userName="gzds" password="Gzds1130" />
</NoSql> -->
<!-- 打印台 -->
<Console name="Console" target="SYSTEM_OUT">
<!--控制台只输出level及以上级别的信息-->
<PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss} %level [%file:%line] - %msg%n"/>
</Console>
<RollingRandomAccessFile name="InfoFile"
fileName="${log_path}/info/info.log"
filePattern="${log_path}/info/info-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="WarnFile" fileName="${log_path}/warn/warn.log"
filePattern="${log_path}/error/error-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd_HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="ErrorFile"
fileName="${log_path}/error/error.log"
filePattern="${log_path}/error/error-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd_HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<appender-ref ref="Console"/>
<appender-ref ref="InfoFile"/>
<appender-ref ref="WarnFile"/>
<appender-ref ref="ErrorFile"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
appender=com.p6spy.engine.spy.appender.Slf4JLogger
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>school-center</artifactId>
<groupId>com.winsun.gdtel.gztel</groupId>
<version>0.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.winsun.gdtel.gztel</groupId>
<artifactId>renewal-use</artifactId> <artifactId>renewal-use</artifactId>
<version>0.0.2</version> <description>外呼集约系统主要服务模块</description>
<packaging>war</packaging> <version>0.0.1</version>
<name>renewal-use Maven Webapp</name> <dependencies>
<!-- FIXME change it to the project's website --> <!-- 为了节省内存,改用jetty -->
<url>http://www.example.com</url> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- 去除默认tomcat配置 -->
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
<!-- 去除默认日志配置 -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<!-- 为了节省内存,改用jetty -->
<properties> <!--spring boot依赖 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <dependency>
<maven.compiler.source>1.7</maven.compiler.source> <groupId>org.springframework.boot</groupId>
<maven.compiler.target>1.7</maven.compiler.target> <artifactId>spring-boot-starter-log4j2</artifactId>
</properties> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>junit</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
<artifactId>winsun-utils-redis</artifactId>
<version>${winsun-framework.version}</version>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
<artifactId>winsun-core-api</artifactId>
</dependency>
<!-- 数据库连接部分 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<artifactId>p6spy</artifactId>
<groupId>p6spy</groupId>
</dependency>
<dependency>
<artifactId>druid-spring-boot-starter</artifactId>
<groupId>com.alibaba</groupId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.gdtel.gztel</groupId>
<artifactId>common</artifactId>
<version>${service.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>renewal-use</finalName> <finalName>renewal-use</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <groupId>org.springframework.boot</groupId>
<version>3.1.0</version> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> <configuration>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --> <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
<plugin> </configuration>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> <resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build> </build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profileActive>local</profileActive>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<profileActive>dev</profileActive>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
</project> </project>
\ No newline at end of file
package com.winsun;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 系统启动入口
* @author Liph
*/
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableEurekaClient
@SpringBootApplication(exclude= {DruidDataSourceAutoConfigure.class})
@RefreshScope
@EnableFeignClients({"com.winsun","com.winsun.auth.core"})
@MapperScan(basePackages = {"com.winsun.*.mapper","com.winsun.mapper"})
@EnableScheduling // 开启定时任务
public class SchoolServiceApplication {
private final static Logger logger = LoggerFactory.getLogger(SchoolServiceApplication.class);
public static void main(String[] args) {
SpringApplication.run(SchoolServiceApplication.class, args);
logger.info("集约平台核心服务系统模块启动成功!!!");
}
}
package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.mapper.PackageMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author: chancy
* @Date: 2020/2/12 17:25
*/
@Slf4j
@RestController
@RequestMapping("/school/package")
public class PackageController {
private static PackageMapper packageMapper;
@Autowired
public PackageController(PackageMapper packageMapper){
PackageController.packageMapper=packageMapper;
}
@Permission(menuname = "添加套餐信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertPackage(){
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除套餐信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deletePackage(){
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改套餐信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updatePackage(){
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询套餐信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<Package>> selectPackage(){
return null;
}
}
package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.bean.Salesperson;
import com.winsun.mapper.SalespersonMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
* @Author: chancy
* @Date: 2020/2/12 17:26
*/
@Slf4j
@RestController
@RequestMapping("/school/salesperson")
public class SalespersonController {
private static SalespersonMapper salespersonMapper;
@Autowired
public SalespersonController(SalespersonMapper salespersonMapper){
SalespersonController.salespersonMapper=salespersonMapper;
}
@Permission(menuname = "添加合伙人信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertSalesperson(){
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除合伙人信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deleteSalesperson(){
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改合伙人信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateSalesperson(){
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询合伙人信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<Salesperson>> selectSalesperson(){
return null;
}
}
package com.winsun.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.bean.School;
import com.winsun.mapper.SchoolMapper;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.winsun.auth.core.common.model.ResponseData;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: chancy
* @Date: 2020/2/12 17:25
*/
@Slf4j
@RestController
@RequestMapping("/school/school")
public class SchoolController {
private static SchoolMapper schoolMapper;
@Autowired
public SchoolController(SchoolMapper schoolMapper){
SchoolController.schoolMapper=schoolMapper;
}
@Permission(menuname = "添加學校信息", value = "insert", method = RequestMethod.POST)
public ResponseData<String> insertSchool(@RequestParam("school")String school){
School school1 = JSON.parseObject(school, School.class);
schoolMapper.insert(school1);
return ResponseData.success("添加完毕!");
}
@Permission(menuname = "删除學校信息", value = "delete", method = RequestMethod.POST)
public ResponseData<String> deleteSchool(@RequestParam("id")String id){
schoolMapper.deleteById(id);
return ResponseData.success("删除完毕!");
}
@Permission(menuname = "修改學校信息", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateSchool(@RequestParam("school")String school){
School school1 = JSON.parseObject(school, School.class);
Wrapper wrapper = new EntityWrapper<>();
wrapper.eq("id",school1.getId());
/**
* 待定............................
*/
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("school_name","");
schoolMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
return ResponseData.success("修改完毕!");
}
@Permission(menuname = "查询學校信息", value = "select", method = RequestMethod.POST)
public ResponseData<List<School>> selectSchool(@RequestParam("subName")String subName,@RequestParam("status")String status,
@RequestParam("schoolName")String schoolName){
return null;
}
}
eureka:
instance:
hostname: eureka
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://eureka:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
spring:
profiles:
active: dev
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
password: ${spring.rabbitmq.username}
username: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: jyyy-rabbitmq
port: 5672
username: guest
password: guest
redis:
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- jyyy-redis:6379
database: 0
host: jyyy-redis
port: 6379
password:
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
ip:
exprie: 600
prohibition: 600
datasource:
#url: jdbc:mysql://jyyy-mysql:3306/jyyy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
#username: root
#password: 123456
#filters: wall,mergeStat
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
timeoutInMilliseconds: 4500 #断路器超时时间,默认1000ms
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
\ No newline at end of file
eureka:
instance:
hostname: eureka
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://eureka:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
spring:
profiles:
active: prod
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
username: ${spring.rabbitmq.username}
password: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: rabbitmq
port: 5672
username: guest
password: guest
redis:
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- redis:6379
database: 0
host: redis
port: 6379
password: QpUd11WzsuBV3RZd
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 5000
ip:
exprie: 600
prohibition: 600
datasource:
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
timeoutInMilliseconds: 4500 #断路器超时时间,默认1000ms
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
\ No newline at end of file
eureka:
instance:
hostname: localhost
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://localhost:20000/eureka/
server:
port: 11091
servlet:
context-path: /ciop
tomcat:
uri-encoding: UTF-8
max-threads: 200
max-connections: 2000
winsun:
app:
version: @project.version@
name: ${spring.application.name}
scanner: false
auth:
#鉴权地址
serviceId: core
#是否开启swagger (true/false)
swagger-open: true
#是否开启登录时验证码 (true/false)
kaptcha-open: false
#是否开启spring session,如果是多机环境需要开启(true/false)
spring-session-open: false
redis-session-expire: 86400
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
session-invalidate-time: 1800
#多久检测一次失效的session(只在单机环境下生效) 单位:秒
session-validation-interval: 900
fileUploadPath: tmpUpload/
spring:
profiles:
active: local
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: DefaultQuartzScheduler
instanceId: AUTO
jobStore:
dataSource: default
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: true
misfireThreshold: 5000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
cloud:
stream:
bindings:
menuOutput:
destination: queue.menu.messages
binder: local_rabbit
content-type: application/json
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: ${spring.rabbitmq.host}
port: ${spring.rabbitmq.port}
username: ${spring.rabbitmq.username}
password: ${spring.rabbitmq.password}
rabbit:
bindings:
input:
consumer:
# maxumum concurrency of this consumer (threads)
max-concurrency: 50
# number of prefetched messages pre consumer thread
prefetch: 100
# true to requeue rejected messages, false to discard (or route to DLQ)
requeue-rejected: false
# republish failures to the DLQ with diagnostic headers
republish-to-dlq: true
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
redis:
# 是否使用集群模式
clusterWhether: false
cluster:
max-redirects: 3
nodes:
- localhost:6379
database: 0
host: localhost
port: 6379
password:
lettuce:
pool:
max-active: -1
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 50000
ip:
exprie: 600
prohibition: 600
datasource:
dynamic:
primary: master
p6spy: true
druid:
filters: stat
max-active: 30
datasource:
master:
url: jdbc:mysql://172.18.101.171:3306/dzqd?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
enabled: false
additional-paths: src/main/java
exclude: static/**,WEB-INF/view/**
servlet:
multipart:
enabled: true
max-request-size: 100MB
max-file-size: 100MB
application:
name: manager
feign:
hystrix:
enabled: true
httpclient:
enabled: true
okhttp:
enabled: false
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 0
ReadTimeout: 4400
ConnectTimeout: 2000
hystrix:
threadpool:
default:
coreSize: 100
maximumSize: 100
allowMaximumSizeToDivergeFromCoreSize: true
maxQueueSize: 20000
queueSizeRejectionThreshold: 19999
command:
#default全局有效,service id指定应用有效
default:
circuitBreaker:
enabled: false
execution:
timeout:
#如果enabled设置为false,则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
#断路器超时时间,默认1000ms
timeoutInMilliseconds: 4500
mybatis-plus:
typeAliasesPackage: com.winsun.bean,com.winsun.framework.core.node
mapper-locations:
- com/winsun/mapper/mapping/*.xml
- com/winsun/modular/dao/mapping/*.xml
management:
endpoints:
web:
exposure:
include: bus-refresh
<?xml version="1.0" encoding="UTF-8"?>
<!-- RollingRandomAccessFile的属性:
fileName 指定当前日志文件的位置和文件名称
filePattern 指定当发生Rolling时,文件的转移和重命名规则
SizeBasedTriggeringPolicy 指定当文件体积大于size指定的值时,触发Rolling
DefaultRolloverStrategy 指定最多保存的文件个数
TimeBasedTriggeringPolicy 这个配置需要和filePattern结合使用,
注意filePattern中配置的文件重命名规则是${FILE_NAME}-%d{yyyy-MM-dd HH-mm}-%i,最小的时间粒度是mm,即分钟,
TimeBasedTriggeringPolicy指定的size是1,结合起来就是每1分钟生成一个新文件。
如果改成%d{yyyy-MM-dd HH},最小粒度为小时,则每一个小时生成一个文件。 -->
<Configuration status="off" monitorInterval="30">
<properties>
<property name="log_path">logs</property>
</properties>
<Appenders>
<!-- <NoSql name="databaseAppender">
<MongoDb databaseName="db_cloud_device" collectionName="extract-invoice_log"
server="127.0.0.1" port="27017" userName="gzds" password="Gzds1130" />
</NoSql> -->
<!-- 打印台 -->
<Console name="Console" target="SYSTEM_OUT">
<!--控制台只输出level及以上级别的信息-->
<PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss} %level [%file:%line] - %msg%n"/>
</Console>
<RollingRandomAccessFile name="InfoFile"
fileName="${log_path}/info/info.log"
filePattern="${log_path}/info/info-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="WarnFile" fileName="${log_path}/warn/warn.log"
filePattern="${log_path}/error/error-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd_HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="ErrorFile"
fileName="${log_path}/error/error.log"
filePattern="${log_path}/error/error-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout pattern="%date{yyyy-MM-dd_HH:mm:ss} %level [%file:%line] - %msg%n"/>
<Policies>
<!-- 归档每天的文件 -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<!-- 限制单个文件大小 -->
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<appender-ref ref="Console"/>
<appender-ref ref="InfoFile"/>
<appender-ref ref="WarnFile"/>
<appender-ref ref="ErrorFile"/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
appender=com.p6spy.engine.spy.appender.Slf4JLogger
\ No newline at end of file
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