Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hphy
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向怀芳
hphy
Commits
a346a044
Commit
a346a044
authored
Jun 16, 2023
by
gaozhaochen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 敏感数据加密解密处理-2
parent
894db9ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
DecodeRequestAdvice.java
...java/cn/sh/stc/sict/theme/config/DecodeRequestAdvice.java
+1
-2
EncodeResponseAdvice.java
...ava/cn/sh/stc/sict/theme/config/EncodeResponseAdvice.java
+1
-1
HpGpIntelligentQAController.java
...e/hpgp/controller/mobile/HpGpIntelligentQAController.java
+1
-0
No files found.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/config/DecodeRequestAdvice.java
View file @
a346a044
package
cn
.
sh
.
stc
.
sict
.
theme
.
config
;
import
cn.sh.stc.sict.theme.annotation.SecurityParameter
;
import
cn.sh.stc.sict.theme.common.crypto.EncryptionRequest
;
import
cn.sh.stc.sict.theme.common.crypto.EncryptionUtil
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
...
@@ -30,7 +29,7 @@ public class DecodeRequestAdvice implements RequestBodyAdvice {
@Override
public
boolean
supports
(
MethodParameter
methodParameter
,
Type
type
,
Class
<?
extends
HttpMessageConverter
<?>>
aClass
)
{
// 判断方法是否需要进行解密
return
methodParameter
.
hasMethodAnnotation
(
SecurityParameter
.
class
)
&&
methodParameter
.
getMethodAnnotation
(
SecurityParameter
.
class
).
inDecode
()
;
return
true
;
}
@Override
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/config/EncodeResponseAdvice.java
View file @
a346a044
...
...
@@ -27,7 +27,7 @@ public class EncodeResponseAdvice implements ResponseBodyAdvice {
@Override
public
boolean
supports
(
MethodParameter
methodParameter
,
Class
aClass
)
{
// 方法上有SecurityParameter注解的进行加密 根据需求可以在判断SecurityParameter注解中的outEncode是否为true
return
methodParameter
.
hasMethodAnnotation
(
SecurityParameter
.
class
)
&&
methodParameter
.
getMethodAnnotation
(
SecurityParameter
.
class
).
outEncode
()
;
return
true
;
}
@Override
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpGpIntelligentQAController.java
View file @
a346a044
...
...
@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
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