Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
85a26349
Commit
85a26349
authored
Apr 07, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
6e951e60
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
WebAspect.java
...ud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
+17
-4
WebAssecptInit.java
...c/main/java/com/yanzuoguang/cloud/aop/WebAssecptInit.java
+11
-0
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
View file @
85a26349
...
@@ -3,9 +3,6 @@ package com.yanzuoguang.cloud.aop;
...
@@ -3,9 +3,6 @@ package com.yanzuoguang.cloud.aop;
import
com.yanzuoguang.cloud.service.TokenServiceCall
;
import
com.yanzuoguang.cloud.service.TokenServiceCall
;
import
com.yanzuoguang.token.TokenHelper
;
import
com.yanzuoguang.token.TokenHelper
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.Ref
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.Signature
;
...
@@ -15,11 +12,11 @@ import org.aspectj.lang.annotation.Pointcut;
...
@@ -15,11 +12,11 @@ import org.aspectj.lang.annotation.Pointcut;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.aspectj.lang.reflect.MethodSignature
;
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.context.ApplicationContext
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Type
;
import
java.lang.reflect.Type
;
import
java.util.List
;
/**
/**
* LogsAspect(接口请求日志切面)
* LogsAspect(接口请求日志切面)
...
@@ -42,6 +39,14 @@ public class WebAspect extends BaseRequestAspect {
...
@@ -42,6 +39,14 @@ public class WebAspect extends BaseRequestAspect {
@Value
(
"${yzg.gateway:^.*gateway.*$}"
)
@Value
(
"${yzg.gateway:^.*gateway.*$}"
)
private
String
gateWay
;
private
String
gateWay
;
@Autowired
private
ApplicationContext
context
;
/**
* 是否存在初始化方法
*/
private
WebAssecptInit
webAssecptInit
;
/**
/**
* exec aop point aspect
* exec aop point aspect
*/
*/
...
@@ -71,6 +76,14 @@ public class WebAspect extends BaseRequestAspect {
...
@@ -71,6 +76,14 @@ public class WebAspect extends BaseRequestAspect {
boolean
isInit
=
false
;
boolean
isInit
=
false
;
try
{
try
{
isInit
=
tokenServiceCall
.
tokenInit
();
isInit
=
tokenServiceCall
.
tokenInit
();
if
(
webAssecptInit
==
null
&&
context
.
containsBean
(
"webAssecptInit"
))
{
webAssecptInit
=
context
.
getBean
(
WebAssecptInit
.
class
);
}
if
(
webAssecptInit
!=
null
)
{
for
(
Object
arg
:
joinPoint
.
getArgs
())
{
webAssecptInit
.
init
(
arg
);
}
}
result
=
executeMethod
(
joinPoint
);
result
=
executeMethod
(
joinPoint
);
return
result
;
return
result
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/WebAssecptInit.java
0 → 100644
View file @
85a26349
package
com
.
yanzuoguang
.
cloud
.
aop
;
public
interface
WebAssecptInit
{
/**
* 对请求的数据初始化
*
* @param req 需要初始化的数据
*/
void
init
(
Object
req
);
}
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