Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
59c85911
Commit
59c85911
authored
Aug 09, 2019
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审批
parent
3f18c965
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
OrderController.java
...ashloanflowboss/api/order/controller/OrderController.java
+3
-5
RoleLoadAspect.java
...antgroup/cashloanflowboss/core/aspect/RoleLoadAspect.java
+20
-4
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/order/controller/OrderController.java
View file @
59c85911
...
@@ -6,9 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit;
...
@@ -6,9 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit;
import
cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole
;
import
cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
...
@@ -28,14 +26,14 @@ public class OrderController {
...
@@ -28,14 +26,14 @@ public class OrderController {
@ChannelIdInit
@ChannelIdInit
@CheckChannelRole
@CheckChannelRole
@
Reques
tMapping
(
"/info"
)
@
Ge
tMapping
(
"/info"
)
public
Result
getOrders
(
Long
channelId
,
String
channelOrderNumber
,
Integer
pageNumber
,
Integer
pageSize
)
{
public
Result
getOrders
(
Long
channelId
,
String
channelOrderNumber
,
Integer
pageNumber
,
Integer
pageSize
)
{
return
Result
.
buildSuccess
(
orderService
.
getOrders
(
channelId
,
channelOrderNumber
,
pageNumber
,
pageSize
));
return
Result
.
buildSuccess
(
orderService
.
getOrders
(
channelId
,
channelOrderNumber
,
pageNumber
,
pageSize
));
}
}
@ChannelIdInit
@ChannelIdInit
@CheckChannelRole
@CheckChannelRole
@
Reque
stMapping
(
"/approve"
)
@
Po
stMapping
(
"/approve"
)
public
Result
approveOpt
(
@RequestBody
@Valid
ApproveVo
approveVo
)
{
public
Result
approveOpt
(
@RequestBody
@Valid
ApproveVo
approveVo
)
{
return
Result
.
buildSuccess
(
orderService
.
approveOpt
(
approveVo
));
return
Result
.
buildSuccess
(
orderService
.
approveOpt
(
approveVo
));
}
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/aspect/RoleLoadAspect.java
View file @
59c85911
...
@@ -34,21 +34,37 @@ import java.lang.reflect.Method;
...
@@ -34,21 +34,37 @@ import java.lang.reflect.Method;
@Slf4j
@Slf4j
@Component
@Component
@Aspect
@Aspect
@Order
(
1
)
@Order
(
Ordered
.
LOWEST_PRECEDENCE
)
public
class
RoleLoadAspect
{
public
class
RoleLoadAspect
{
@Autowired
@Autowired
private
UserSessionService
userSessionService
;
private
UserSessionService
userSessionService
;
@Pointcut
(
"execution(* cn.quantgroup.cashloanflowboss.api.*.controller.*.*(..))"
)
@Pointcut
(
"execution(* cn.quantgroup.cashloanflowboss.api.channel.controller.*.*(..))"
)
private
void
channelRoleInit
()
{}
private
void
channelController
()
{}
@Pointcut
(
"execution(* cn.quantgroup.cashloanflowboss.api.order.controller.*.*(..))"
)
private
void
orderController
()
{}
@Around
(
value
=
"channelRoleInit()"
)
@Pointcut
(
"channelController() || orderController() "
)
private
void
doSomeRole
()
{}
@Around
(
value
=
"doSomeRole()"
)
public
Object
around
(
ProceedingJoinPoint
pjp
)
{
public
Object
around
(
ProceedingJoinPoint
pjp
)
{
Object
[]
args
=
pjp
.
getArgs
();
Object
[]
args
=
pjp
.
getArgs
();
MethodSignature
methodSignature
=
(
MethodSignature
)
pjp
.
getSignature
();
MethodSignature
methodSignature
=
(
MethodSignature
)
pjp
.
getSignature
();
Method
method
=
methodSignature
.
getMethod
();
Method
method
=
methodSignature
.
getMethod
();
// if ("login".equals(method.getName())) {
// try {
// return pjp.proceed(args);
// } catch (Throwable throwable) {
// log.error("请求失败,e={}", ExceptionUtils.getStackTrace(throwable));
// return Result.buildFial();
// }
// }
// 如果是渠道用户登陆 默认加载channelId
// 如果是渠道用户登陆 默认加载channelId
ChannelIdInit
annotation
=
method
.
getAnnotation
(
ChannelIdInit
.
class
);
ChannelIdInit
annotation
=
method
.
getAnnotation
(
ChannelIdInit
.
class
);
UserSessionInfo
userSessionInfo
=
userSessionService
.
findUserSessionInfo
();
UserSessionInfo
userSessionInfo
=
userSessionService
.
findUserSessionInfo
();
...
...
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