Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bec11612
authored
Jul 15, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]日志处理添加
1 parent
e8887734
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
425 additions
and
140 deletions
pom.xml
src/main/java/cn/com/glsx/merchants/Main.java
src/main/java/cn/com/glsx/merchants/config/DubboConfig.java
src/main/java/cn/com/glsx/merchants/config/SysLogAspect.java
src/main/java/cn/com/glsx/merchants/config/SystemProperty.java
src/main/java/cn/com/glsx/merchants/contants/Contants.java
src/main/java/cn/com/glsx/merchants/controller/ExampleController.java
src/main/java/cn/com/glsx/merchants/controller/LoginController.java
src/main/java/cn/com/glsx/merchants/controller/MerchantDictTypeController.java
src/main/java/cn/com/glsx/merchants/request/log/LogRequest.java
src/main/java/cn/com/glsx/merchants/service/LoginService.java
src/main/java/cn/com/glsx/merchants/service/MerchantDictTypeService.java
src/main/java/cn/com/glsx/merchants/service/MerchantLogService.java
src/main/java/cn/com/glsx/merchants/service/MerchantUserService.java
src/main/resources/config/application.properties
pom.xml
View file @
bec1161
...
...
@@ -17,5 +17,20 @@
<artifactId>
platform-merchants-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<!--引用GSON,用于打印-->
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.7
</version>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjweaver
</artifactId>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-common
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/Main.java
View file @
bec1161
...
...
@@ -4,6 +4,7 @@ import org.oreframework.boot.main.AbsOreBootStarter;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
/**
* @Title: Main.java
...
...
@@ -13,8 +14,9 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootApplication
@SpringBootApplication
(
scanBasePackages
=
{
"cn.com.glsx.*"
})
@ServletComponentScan
@EnableAspectJAutoProxy
public
class
Main
extends
AbsOreBootStarter
{
@Override
...
...
src/main/java/cn/com/glsx/merchants/config/DubboConfig.java
View file @
bec1161
...
...
@@ -39,4 +39,9 @@ public class DubboConfig {
public
MerchantProductFunctionRemote
getMerchantProductFunctionRemote
()
{
return
factory
.
builder
(
MerchantProductFunctionRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"2.0.0"
).
build
();
}
@Bean
public
MerchantLogRemote
getMerchantLogRemote
()
{
return
factory
.
builder
(
MerchantLogRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"2.0.0"
).
build
();
}
}
src/main/java/cn/com/glsx/merchants/config/SysLogAspect.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
config
;
import
cn.com.glsx.merchants.request.log.LogRequest
;
import
cn.com.glsx.merchants.service.MerchantLogService
;
import
cn.com.glsx.merchants.service.MerchantUserService
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.rop.AbstractRopRequest
;
import
com.rop.session.SimpleSession
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.time.DurationFormatUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.*
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.slf4j.MDC
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Method
;
/**
* @author zhouhaibao
* @version 1.0
* @description: 操作日志统一处理
* @date 2021/7/13 10:00
*/
@Slf4j
@Aspect
@Component
public
class
SysLogAspect
{
final
static
GsonBuilder
builder
=
new
GsonBuilder
();
final
static
Gson
gson
=
builder
.
create
();
@Autowired
private
MerchantLogService
merchantLogService
;
@Autowired
private
MerchantUserService
merchantUserService
;
@Pointcut
(
"@annotation(com.glsx.plat.common.annotation.SysLog)"
)
public
void
logPointCut
()
{
}
@Before
(
"logPointCut()"
)
public
void
webpre
(
JoinPoint
joinPoint
)
{
// 处理日志
try
{
saveSysLog
(
joinPoint
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 打印方法执行时间
*/
@Around
(
"logPointCut()"
)
public
Object
timeAround
(
ProceedingJoinPoint
jp
)
throws
Throwable
{
long
beginTime
=
System
.
currentTimeMillis
();
//执行方法,执行失败后会抛出异常,也就不会打印执行时间
Object
result
=
jp
.
proceed
();
//执行时长(毫秒)
long
time
=
System
.
currentTimeMillis
()
-
beginTime
;
MethodSignature
methodSignature
=
(
MethodSignature
)
jp
.
getSignature
();
Object
target
=
jp
.
getTarget
();
Method
method
=
methodSignature
.
getMethod
();
//获取注解上的文字
SysLog
sysLog
=
method
.
getAnnotation
(
SysLog
.
class
);
String
methodName
=
methodSignature
.
getName
();
if
(
sysLog
.
printSpendTime
())
{
log
.
info
(
target
.
getClass
().
getName
()
+
"."
+
methodName
+
" 执行耗时:"
+
DurationFormatUtils
.
formatDuration
(
time
,
"HH:mm:ss.S"
)
+
"; 精确时间为 :"
+
time
+
" ms"
);
}
return
result
;
}
/**
* 方法之后调用
*
* @param jp
* @param returnValue 方法返回值
*/
@AfterReturning
(
pointcut
=
"logPointCut()"
,
returning
=
"returnValue"
)
public
void
doAfterReturning
(
JoinPoint
jp
,
Object
returnValue
)
{
log
.
info
(
"Returning Args : {}"
,
new
Gson
().
toJson
(
returnValue
));
// 处理完请求,返回内容
MDC
.
clear
();
}
/**
* 供后台和基础服务调用系统日志保存
*
* @param joinPoint
*/
public
void
saveSysLog
(
JoinPoint
joinPoint
)
throws
Exception
{
//获取方法信息
MethodSignature
methodSignature
=
(
MethodSignature
)
joinPoint
.
getSignature
();
// 获取accessToken的下表
Method
method
=
methodSignature
.
getMethod
();
// 日志标识
SysLog
sysLogMark
=
method
.
getAnnotation
(
SysLog
.
class
);
// 开始打印请求日志
// 获取 @WebLog 注解的描述信息
String
methodDescription
=
sysLogMark
.
value
();
// 打印请求入参
Object
[]
args
=
joinPoint
.
getArgs
();
AbstractRopRequest
accessToken
=
(
AbstractRopRequest
)
args
[
0
];
String
ip
=
accessToken
.
getRopRequestContext
().
getIp
();
System
.
out
.
println
(
args
);
// 插入日志
LogRequest
logRequest
=
new
LogRequest
();
logRequest
.
setModule
(
methodDescription
);
SimpleSession
session
=
(
SimpleSession
)
accessToken
.
getRopRequestContext
().
getSession
();
logRequest
.
setOperator
((
String
)
session
.
getAttribute
(
"userName"
));
logRequest
.
setIp
(
ip
);
merchantLogService
.
saveMerchantLog
(
logRequest
);
}
}
src/main/java/cn/com/glsx/merchants/config/SystemProperty.java
View file @
bec1161
...
...
@@ -3,14 +3,6 @@ package cn.com.glsx.merchants.config;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
/**
* @Title: SystemProperty.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties
(
"system"
)
public
class
SystemProperty
{
...
...
src/main/java/cn/com/glsx/merchants/contants/Contants.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
contants
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/14 17:54
*/
public
class
Contants
{
public
static
final
int
GL_CHANNEL
=
1
;
public
static
final
String
USER_ACCOUNT
=
"userAccount"
;
public
static
final
String
USER_NAME
=
"userName"
;
}
src/main/java/cn/com/glsx/merchants/controller/ExampleController.java
deleted
100644 → 0
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
controller
;
import
cn.com.glsx.merchants.request.example.*
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.UUID
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.util.FileCopyUtils
;
import
cn.com.glsx.merchants.response.LoginResponse
;
import
cn.com.glsx.merchants.response.ExampleResponse
;
import
cn.com.glsx.merchants.response.UploadFileResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
com.rop.AbstractRopRequest
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethodBean
;
import
com.rop.session.SimpleSession
;
/**
* @Title: ExampleController.java
* @Description:
* @author Alvin
* @date 2019年9月2日 下午3:27:41
* @version V2.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
NO
)
@Api
(
"示例接口"
)
public
class
ExampleController
{
/**
* logger
*/
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
/**
* 接口例子
*
* @param req ExampleRequest
* @return Object
* @throws Exception 异常
*/
@ServiceMethod
(
method
=
"org.ore.api.example"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"get接口示例"
)
public
RopResponse
<
ProductResponse
>
getExample
(
ProductRequest
productRequest
)
throws
Exception
{
ProductResponse
response
=
new
ProductResponse
();
response
.
setProductName
(
"aaaa"
);
return
RopResponse
.
success
(
response
);
}
/**
* 复杂参数示例
* @param request
* @return
* @author Alvin
*/
@ServiceMethod
(
method
=
"org.ore.api.example.complex"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"复杂参数示例"
)
public
RopResponse
<
ExampleResponse
>
complexExample
(
ExampleComplexRequest
request
){
ExampleResponse
response
=
new
ExampleResponse
();
response
.
setField1
(
request
.
getName
());
response
.
setField2
(
request
.
toString
());
return
RopResponse
.
success
(
response
);
}
/**
* 文件上传示例
* @param request
* @return
* @author Alvin
* @throws IOException
*/
@ServiceMethod
(
method
=
"org.ore.api.example.upload"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"文件上传示例"
)
public
RopResponse
<
UploadFileResponse
>
upload
(
UploadFileRequest
request
)
throws
IOException
{
ClassPathResource
outFile
=
new
ClassPathResource
(
"/"
);
File
file
=
new
File
(
outFile
.
getFile
().
getParent
()
+
"/test."
+
request
.
getFile
().
getFileType
());
FileCopyUtils
.
copy
(
request
.
getFile
().
getContent
(),
file
);
UploadFileResponse
response
=
new
UploadFileResponse
();
response
.
setFilePath
(
file
.
getPath
());
return
RopResponse
.
success
(
response
);
}
/**
* 登录示例
* @param request
* @return
* @author Alvin
*/
@ServiceMethod
(
method
=
"org.ore.api.example.login"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"登录示例"
)
public
RopResponse
<
LoginResponse
>
login
(
LoginRequest
request
){
// 创建会话
SimpleSession
session
=
new
SimpleSession
();
session
.
setAttribute
(
"userName"
,
request
.
getUserName
());
String
sessionId
=
UUID
.
randomUUID
().
toString
();
request
.
getRopRequestContext
().
addSession
(
sessionId
,
session
);
LoginResponse
response
=
new
LoginResponse
();
response
.
setSessionId
(
sessionId
);
return
RopResponse
.
success
(
response
);
}
/**
* 登出示例
* @param request
* @return
* @author Alvin
*/
@ServiceMethod
(
method
=
"org.ore.api.example.logout"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"登出示例"
)
public
RopResponse
<
Boolean
>
logout
(
AbstractRopRequest
request
){
// 删除会话
request
.
getRopRequestContext
().
removeSession
();
return
RopResponse
.
success
(
true
);
}
}
src/main/java/cn/com/glsx/merchants/controller/LoginController.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
controller
;
import
cn.com.glsx.merchants.request.example.*
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.service.LoginService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.UUID
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.util.FileCopyUtils
;
import
cn.com.glsx.merchants.response.LoginResponse
;
import
cn.com.glsx.merchants.response.ExampleResponse
;
import
cn.com.glsx.merchants.response.UploadFileResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
com.rop.AbstractRopRequest
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethodBean
;
import
com.rop.session.SimpleSession
;
/**
* @author zhouhaibao
* @version 1.0
* @description: 用户登录接口
* @date 2021/7/13 10:00
*/
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
NO
)
@Api
(
"用户登录"
)
public
class
LoginController
{
@Autowired
private
LoginService
loginService
;
/**
* 登录示例
*
* @param request
* @return
*/
@ServiceMethod
(
method
=
"org.ore.api.example.login"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"登录"
)
public
RopResponse
<
LoginResponse
>
login
(
LoginRequest
request
)
{
LoginResponse
response
=
loginService
.
login
(
request
);
// 创建会话
return
RopResponse
.
success
(
response
);
}
/**
* 登出示例
*
* @param request
* @return
*/
@ServiceMethod
(
method
=
"org.ore.api.example.logout"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"登出"
)
public
RopResponse
<
Boolean
>
logout
(
AbstractRopRequest
request
)
{
loginService
.
logout
(
request
);
// 删除会话
return
RopResponse
.
success
(
true
);
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantDictTypeController.java
View file @
bec1161
...
...
@@ -38,7 +38,7 @@ public class MerchantDictTypeController {
* @param dictTypeSaveRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveDictType"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveDictType"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"保存字典类型"
)
public
RopResponse
<
Boolean
>
saveDictType
(
DictTypeSaveRequest
dictTypeSaveRequest
)
{
try
{
...
...
src/main/java/cn/com/glsx/merchants/request/log/LogRequest.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
request
.
log
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/14 16:20
*/
@Data
public
class
LogRequest
{
/**
* 模块名称
*/
private
String
module
;
/**
* 执行方法
*/
private
String
processed
;
/**
* 操作类型
*/
private
String
action
;
/**
* 操作人
*/
private
String
operator
;
/**
* 操作人
*/
private
String
username
;
/**
* ip
*/
private
String
ip
;
/**
* 操作结果
*/
private
String
result
;
/**
* 创建时间
*/
private
Date
createdTime
;
}
src/main/java/cn/com/glsx/merchants/service/LoginService.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
service
;
import
cn.com.glsx.merchants.contants.Contants
;
import
cn.com.glsx.merchants.request.example.LoginRequest
;
import
cn.com.glsx.merchants.response.LoginResponse
;
import
com.rop.AbstractRopRequest
;
import
com.rop.session.SimpleSession
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.util.UUID
;
/**
* @author zhouhaibao
* @version 1.0
* @description: 用户登录
* @date 2021/7/14 17:32
*/
@Service
@Slf4j
public
class
LoginService
{
/**
* 用户登录
*
* @param request 用户信息
*/
public
LoginResponse
login
(
LoginRequest
request
)
{
//TODO 校验用户名和密码
SimpleSession
session
=
new
SimpleSession
();
session
.
setAttribute
(
Contants
.
USER_ACCOUNT
,
request
.
getUserName
());
session
.
setAttribute
(
Contants
.
USER_NAME
,
request
.
getUserName
());
String
sessionId
=
UUID
.
randomUUID
().
toString
();
request
.
getRopRequestContext
().
addSession
(
sessionId
,
session
);
LoginResponse
response
=
new
LoginResponse
();
response
.
setSessionId
(
sessionId
);
return
response
;
}
/**
* 用户退出登录
*/
public
void
logout
(
AbstractRopRequest
request
)
{
request
.
getRopRequestContext
().
removeSession
();
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantDictTypeService.java
View file @
bec1161
...
...
@@ -15,6 +15,8 @@ import cn.com.glsx.merchants.request.dicttype.DictTypeSaveRequest;
import
cn.com.glsx.merchants.request.dicttype.DictTypeUpdateRequest
;
import
cn.com.glsx.merchants.response.DictTypeResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.enums.OperateType
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -32,6 +34,7 @@ public class MerchantDictTypeService {
@Autowired
private
MerchantDictTypeRemote
merchantDictTypeRemote
;
@SysLog
(
value
=
"新增字典类型"
,
action
=
OperateType
.
ADD
)
public
void
saveDictType
(
DictTypeSaveRequest
dictTypeSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
saveMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeSaveRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantLogService.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
service
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.model.request.MerchantLogRequest
;
import
cn.com.glsx.merchants.remote.MerchantLogRemote
;
import
cn.com.glsx.merchants.request.log.LogRequest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/14 16:27
*/
@Service
@Slf4j
public
class
MerchantLogService
{
@Autowired
private
MerchantLogRemote
merchantLogRemote
;
public
void
saveMerchantLog
(
LogRequest
logRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantLogRemote
.
saveMerchantLogRemote
(
ConverRequest
.
converRequest
(
logRequest
,
new
MerchantLogRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantUserService.java
0 → 100644
View file @
bec1161
package
cn
.
com
.
glsx
.
merchants
.
service
;
import
com.rop.AbstractRopRequest
;
import
com.rop.session.SimpleSession
;
import
lombok.extern.slf4j.Slf4j
;
import
org.oreframework.boot.autoconfigure.rop.session.RopSessionManager
;
import
org.oreframework.boot.autoconfigure.rop.util.RopThreadLocal
;
import
org.oreframework.boot.security.cas.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/14 14:45
*/
@Service
@Slf4j
public
class
MerchantUserService
{
@Autowired
private
RopSessionManager
ropSessionManager
;
/**
* 获取用户信息
*
* @return
*/
public
User
getUser
(
AbstractRopRequest
abstractRopRequest
)
{
User
user
=
RopThreadLocal
.
getUser
();
if
(
user
==
null
){
SimpleSession
session
=
(
SimpleSession
)
abstractRopRequest
.
getRopRequestContext
().
getSession
();
if
(
session
!=
null
){
user
.
setUsername
((
String
)
session
.
getAttribute
(
"username"
));
}
}
return
user
;
}
}
src/main/resources/config/application.properties
View file @
bec1161
...
...
@@ -60,4 +60,18 @@ swagger.rop.appKey=48e5e13229b82c1b4e6e8c96151f0637
swagger.rop.secret
=
c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
# rop 秘钥对(appKey=secret)
48e5e13229b82c1b4e6e8c96151f0637
=
c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
\ No newline at end of file
48e5e13229b82c1b4e6e8c96151f0637
=
c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
ore.redis.hostName
=
192.168.3.207
ore.redis.port
=
6379
ore.redis.password
=
ore.redis.pool.maxActive=600
ore.redis.pool.maxWait
=
10000
ore.redis.pool.maxTotal
=
300
ore.redis.pool.maxIdle
=
300
ore.redis.pool.minIdle
=
0
ore.redis.timeout
=
30000
# 逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
ore.redis.betweenEvictionRunsMillis
=
30000
Write
Preview
Markdown
is supported
Attach a file
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 post a comment