Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
23f50011
Commit
23f50011
authored
Jul 08, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加全局异常处理,修改配置参数
parent
316390ea
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
16 deletions
+34
-16
AmosJcsApplication.java
...em/src/main/java/com/yeejoin/amos/AmosJcsApplication.java
+2
-1
application-dev.properties
...-jcs-system/src/main/resources/application-dev.properties
+6
-8
application-qa.properties
...t-jcs-system/src/main/resources/application-qa.properties
+1
-3
application.properties
...boot-jcs-system/src/main/resources/application.properties
+3
-3
logback-dev.xml
amos-boot-jcs-system/src/main/resources/logback-dev.xml
+21
-0
ControllerAop.java
...m/yeejoin/amos/boot/module/jcs/biz/aop/ControllerAop.java
+1
-1
No files found.
amos-boot-jcs-system/src/main/java/com/yeejoin/amos/AmosJcsApplication.java
View file @
23f50011
...
@@ -16,6 +16,7 @@ import org.springframework.context.annotation.ComponentScan;
...
@@ -16,6 +16,7 @@ import org.springframework.context.annotation.ComponentScan;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
import
java.net.InetAddress
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
java.net.UnknownHostException
;
...
@@ -51,7 +52,7 @@ public class AmosJcsApplication
...
@@ -51,7 +52,7 @@ public class AmosJcsApplication
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
port
=
env
.
getProperty
(
"server.port"
);
String
port
=
env
.
getProperty
(
"server.port"
);
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
String
path
=
oConvertUtils
.
getString
(
env
.
getProperty
(
"server.servlet.context-path"
));
GlobalExceptionHandler
.
setAlwaysOk
(
true
);
logger
.
info
(
"\n----------------------------------------------------------\n\t"
+
logger
.
info
(
"\n----------------------------------------------------------\n\t"
+
"Application Amos-Biz-Boot is running! Access URLs:\n\t"
+
"Application Amos-Biz-Boot is running! Access URLs:\n\t"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
path
+
"/doc.html\n"
+
"Swagger文档: \thttp://"
+
ip
+
":"
+
port
+
path
+
"/doc.html\n"
+
...
...
amos-boot-jcs-system/src/main/resources/application-dev.properties
View file @
23f50011
...
@@ -5,15 +5,14 @@ spring.datasource.username=root
...
@@ -5,15 +5,14 @@ spring.datasource.username=root
spring.datasource.password
=
root_123
spring.datasource.password
=
root_123
#eureka properties:
#eureka properties:
eureka.instance.hostname
=
172.16.10.72
eureka.client.serviceUrl.defaultZone
=
http://172.16.10.72:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://${eureka.instance.hostname}:10001/eureka/
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
management.endpoint.health.show-details
=
always
management.endpoint.health.show-details
=
always
management.endpoints.web.exposure.include
=
*
management.endpoints.web.exposure.include
=
*
eureka.instance.health-check-url
=
http://localhost:${server.port}${server.servlet.context-path}/actuator
/health
eureka.instance.health-check-url
-path
=
/health
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.status-page-url
=
http://localhost:${server.port}${server.servlet.context-path}/actuator
/info
eureka.instance.status-page-url
-path
=
/info
eureka.instance.metadata-map.management.api-docs
=
http://localhost:${server.port}${server.servlet.context-path}/
swagger-ui
.html
eureka.instance.metadata-map.management.api-docs
=
http://localhost:${server.port}${server.servlet.context-path}/
doc
.html
spring.redis.database
=
0
spring.redis.database
=
0
...
@@ -27,6 +26,7 @@ spring.redis.lettuce.pool.min-idle=0
...
@@ -27,6 +26,7 @@ spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time
=
300
spring.redis.expire.time
=
300
#ES
#ES
spring.data.elasticsearch.cluster-name
=
elasticsearch
spring.data.elasticsearch.cluster-name
=
elasticsearch
spring.data.elasticsearch.cluster-nodes
=
172.16.3.3:9300
spring.data.elasticsearch.cluster-nodes
=
172.16.3.3:9300
spring.elasticsearch.rest.uris
=
http://172.16.3.3:9200
spring.elasticsearch.rest.uris
=
http://172.16.3.3:9200
...
@@ -37,10 +37,8 @@ emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
...
@@ -37,10 +37,8 @@ emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.user-name
=
super
emqx.password
=
a123456
emqx.password
=
a123456
#Amos平台服务名
security.systemctl.name
=
AMOS-API-SYSTEMCTL
security.systemctl.name
=
AMOS-API-SYSTEMCTL
# 区域选择存放redis失效时间一个月
redis_region_time_second
=
2592000
amos-boot-jcs-system/src/main/resources/application-qa.properties
View file @
23f50011
...
@@ -31,8 +31,6 @@ emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
...
@@ -31,8 +31,6 @@ emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.user-name
=
super
emqx.password
=
a123456
emqx.password
=
a123456
#Amos平台服务名
security.systemctl.name
=
AMOS-API-SYSTEMCTL
security.systemctl.name
=
AMOS-API-SYSTEMCTL
# 区域选择存放redis失效时间一个月
redis_region_time_second
=
2592000
amos-boot-jcs-system/src/main/resources/application.properties
View file @
23f50011
spring.application.name
=
JCS
spring.application.name
=
JCS
-ll5
server.servlet.context-path
=
/jcs
server.servlet.context-path
=
/jcs
server.port
=
11100
server.port
=
11100
spring.profiles.active
=
dev
spring.profiles.active
=
dev
...
@@ -6,9 +6,9 @@ spring.profiles.active=dev
...
@@ -6,9 +6,9 @@ spring.profiles.active=dev
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
logging.config
=
classpath:logback-${spring.profiles.active}.xml
logging.config
=
classpath:logback-${spring.profiles.active}.xml
#mybatis-plus
����־�������ã�����ʹ��mybatis�ģ����Ҳ���
#mybatis-plus
配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.stdout.StdOutImpl
#redis
����ʧЧʱ�䵥λ��
#redis
失效时间
redis.cache.failure.time
=
10800
redis.cache.failure.time
=
10800
#unit(h)
#unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
...
...
amos-boot-jcs-system/src/main/resources/logback-dev.xml
View file @
23f50011
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
>
<configuration
debug=
"false"
>
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property
name=
"LOG_HOME"
value=
"log"
/>
<!-- 按照每天生成日志文件 -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名-->
<FileNamePattern>
${LOG_HOME}/jcs.log.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>
7
</MaxHistory>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"
>
<MaxFileSize>
30mb
</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 控制台输出 -->
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
...
@@ -20,6 +39,8 @@
...
@@ -20,6 +39,8 @@
<logger
name=
"com.yeejoin"
level=
"DEBUG"
/>
<logger
name=
"com.yeejoin"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<!--<appender-ref ref="FILE" />-->
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
</root>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/aop/ControllerAop.java
View file @
23f50011
...
@@ -42,7 +42,7 @@ public class ControllerAop {
...
@@ -42,7 +42,7 @@ public class ControllerAop {
/**
/**
* saveUserRedis设置过期时间
* saveUserRedis设置过期时间
*/
*/
@Value
(
"${redis
_region_time_second
}"
)
@Value
(
"${redis
.cache.failure.time
}"
)
private
Long
redisRegionTimeSecond
;
private
Long
redisRegionTimeSecond
;
@Autowired
@Autowired
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment