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
feaa75f8
Commit
feaa75f8
authored
Jun 25, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加日志
parent
98f89d4a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
143 additions
and
15 deletions
+143
-15
application-qa.properties
...t-jcs-system/src/main/resources/application-qa.properties
+34
-0
logback-dev.xml
amos-boot-jcs-system/src/main/resources/logback-dev.xml
+47
-0
logback-qa.xml
amos-boot-jcs-system/src/main/resources/logback-qa.xml
+48
-0
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+14
-15
No files found.
amos-boot-jcs-system/src/main/resources/application-qa.properties
0 → 100644
View file @
feaa75f8
#DB properties:
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.16.6.60:3306/amos-jcs-biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.password
=
root_123
#eureka properties:
eureka.instance.hostname
=
172.16.10.72
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
=
http://${eureka.instance.hostname}:10001/eureka/
spring.redis.database
=
0
spring.redis.host
=
172.16.10.85
spring.redis.port
=
6379
spring.redis.password
=
amos2019Redis
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
#ES
spring.data.elasticsearch.cluster-name
=
elasticsearch
spring.data.elasticsearch.cluster-nodes
=
172.16.3.3:9300
spring.elasticsearch.rest.uris
=
http://172.16.3.3:9200
security.systemctl.name
=
AMOS-API-SYSTEMCTL
# 区域选择存放redis失效时间一个月
redis_region_time_second
=
2592000
amos-boot-jcs-system/src/main/resources/logback-dev.xml
0 → 100644
View file @
feaa75f8
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
>
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<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>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"DEBUG"
/>
<logger
name=
"org.apache.activemq"
level=
"INFO"
/>
<logger
name=
"org.springframework"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
<appender-ref
ref=
"STDOUT"
/>
</root>
<!--日志异步到数据库 -->
<!--<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">-->
<!--<!–日志异步到数据库 –>-->
<!--<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">-->
<!--<!–连接池 –>-->
<!--<dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">-->
<!--<driverClass>com.mysql.jdbc.Driver</driverClass>-->
<!--<url>jdbc:mysql://127.0.0.1:3306/databaseName</url>-->
<!--<user>root</user>-->
<!--<password>root</password>-->
<!--</dataSource>-->
<!--</connectionSource>-->
<!--</appender>-->
</configuration>
amos-boot-jcs-system/src/main/resources/logback-qa.xml
0 → 100644
View file @
feaa75f8
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
>
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property
name=
"LOG_HOME"
value=
"/jcs/log/qa"
/>
<!-- 按照每天生成日志文件 -->
<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>
30
</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>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"INFO"
/>
<logger
name=
"org.mybatis"
level=
"INFO"
/>
<logger
name=
"java.sql.Connection"
level=
"INFO"
/>
<logger
name=
"java.sql.Statement"
level=
"INFO"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"INFO"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"INFO"
/>
<logger
name=
"org.typroject"
level=
"INFO"
/>
<logger
name=
"com.yeejoin"
level=
"INFO"
/>
<logger
name=
"org.springframework"
level=
"INFO"
/>
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
</root>
</configuration>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
feaa75f8
...
@@ -7,17 +7,17 @@ import java.util.List;
...
@@ -7,17 +7,17 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
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.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
@@ -79,8 +79,7 @@ public class AlertCalledController extends BaseController {
...
@@ -79,8 +79,7 @@ public class AlertCalledController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情接警记录"
,
notes
=
"新增警情接警记录"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情接警记录"
,
notes
=
"新增警情接警记录"
)
@Transactional
@Transactional
public
ResponseModel
<
AlertCalledVo
>
saveAlertCalled
(
HttpServletRequest
request
,
public
ResponseModel
<
AlertCalledVo
>
saveAlertCalled
(
@RequestBody
AlertCalledVo
alertCalledVo
)
throws
Exception
{
@RequestBody
AlertCalledVo
alertCalledVo
)
throws
Exception
{
if
(
ValidationUtil
.
isEmpty
(
alertCalledVo
)
if
(
ValidationUtil
.
isEmpty
(
alertCalledVo
)
||
ValidationUtil
.
isEmpty
(
alertCalledVo
.
getAlertCalled
()))
||
ValidationUtil
.
isEmpty
(
alertCalledVo
.
getAlertCalled
()))
...
@@ -96,9 +95,9 @@ public class AlertCalledController extends BaseController {
...
@@ -96,9 +95,9 @@ public class AlertCalledController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@
RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@
DeleteMapping
(
value
=
"/{id}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
boolean
deleteById
(
@PathVariable
Long
id
)
{
return
iAlertCalledService
.
removeById
(
id
);
return
iAlertCalledService
.
removeById
(
id
);
}
}
...
@@ -108,9 +107,9 @@ public class AlertCalledController extends BaseController {
...
@@ -108,9 +107,9 @@ public class AlertCalledController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@
RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@
PutMapping
(
value
=
"/updateById"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改警情接警记录"
,
notes
=
"修改警情接警记录"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改警情接警记录"
,
notes
=
"修改警情接警记录"
)
public
boolean
updateByIdAlertCalled
(
HttpServletRequest
request
,
@RequestBody
AlertCalled
alertCalled
)
{
public
boolean
updateByIdAlertCalled
(
@RequestBody
AlertCalled
alertCalled
)
{
return
iAlertCalledService
.
updateById
(
alertCalled
);
return
iAlertCalledService
.
updateById
(
alertCalled
);
}
}
...
@@ -121,9 +120,9 @@ public class AlertCalledController extends BaseController {
...
@@ -121,9 +120,9 @@ public class AlertCalledController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@
RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@
GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
Object
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
<
Object
>
selectById
(
@PathVariable
Long
id
)
{
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
)){
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
)){
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
...
@@ -155,7 +154,7 @@ public class AlertCalledController extends BaseController {
...
@@ -155,7 +154,7 @@ public class AlertCalledController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@
RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@
GetMapping
(
value
=
"/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
IPage
<
AlertCalled
>>
listPage
(
String
pageNum
,
String
pageSize
,
String
sort
,
AlertCalled
alertCalled
)
{
public
ResponseModel
<
IPage
<
AlertCalled
>>
listPage
(
String
pageNum
,
String
pageSize
,
String
sort
,
AlertCalled
alertCalled
)
{
Page
<
AlertCalled
>
pageBean
;
Page
<
AlertCalled
>
pageBean
;
...
@@ -187,7 +186,7 @@ public class AlertCalledController extends BaseController {
...
@@ -187,7 +186,7 @@ public class AlertCalledController extends BaseController {
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"相似警情分页查询"
)
@ApiOperation
(
value
=
"相似警情分页查询"
)
@
RequestMapping
(
value
=
"/page/similar"
,
method
=
RequestMethod
.
POST
)
@
PostMapping
(
value
=
"/page/similar"
)
public
ResponseModel
<
Page
<
ESAlertCalledDto
>>
pageBySimilar
(
public
ResponseModel
<
Page
<
ESAlertCalledDto
>>
pageBySimilar
(
@RequestBody
ESAlertCalledRequestDto
alertCalledVo
,
@RequestBody
ESAlertCalledRequestDto
alertCalledVo
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"current"
)
int
current
,
...
@@ -205,7 +204,7 @@ public class AlertCalledController extends BaseController {
...
@@ -205,7 +204,7 @@ public class AlertCalledController extends BaseController {
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"初始化ES"
)
@ApiOperation
(
value
=
"初始化ES"
)
@
RequestMapping
(
value
=
"/es/init"
,
method
=
RequestMethod
.
PUT
)
@
PutMapping
(
value
=
"/es/init"
)
public
ResponseModel
<
Boolean
>
initEs
()
throws
Exception
{
public
ResponseModel
<
Boolean
>
initEs
()
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSAlertCalledService
.
initEs
());
return
ResponseHelper
.
buildResponse
(
eSAlertCalledService
.
initEs
());
}
}
...
@@ -216,7 +215,7 @@ public class AlertCalledController extends BaseController {
...
@@ -216,7 +215,7 @@ public class AlertCalledController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@
RequestMapping
(
value
=
"/getList"
,
method
=
RequestMethod
.
GET
)
@
GetMapping
(
value
=
"/getList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表无分页查询"
,
notes
=
"列表无分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表无分页查询"
,
notes
=
"列表无分页查询"
)
public
ResponseModel
<
List
<
AlertCalled
>>
list
(
AlertCalled
alertCalled
)
{
public
ResponseModel
<
List
<
AlertCalled
>>
list
(
AlertCalled
alertCalled
)
{
QueryWrapper
<
AlertCalled
>
alertCalledQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AlertCalled
>
alertCalledQueryWrapper
=
new
QueryWrapper
<>();
...
...
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