perf(encrypt):加解密调整

This commit is contained in:
曾文豪
2023-07-05 14:11:01 +08:00
parent 90e504e7fd
commit ea24bf3479
6 changed files with 23 additions and 24 deletions

View File

@@ -1,21 +0,0 @@
package com.tiesheng.encrypt;
import com.tiesheng.encrypt.config.DecryptRequestBodyAdvice;
import com.tiesheng.encrypt.config.EncryptResponseBodyAdvice;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
/**
* @author hao
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Documented
@Import({
DecryptRequestBodyAdvice.class,
EncryptResponseBodyAdvice.class,
})
public @interface EnableEncryptConfig {
}

View File

@@ -0,0 +1,10 @@
package com.tiesheng.encrypt;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan({
"com.tiesheng.encrypt.**.*",
})
public class EncryptAutoConfigurer {
}

View File

@@ -37,7 +37,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice<ApiResp> {
try {
Object data = body.getData();
if (data == null || !body.successful()) {
if (data == null || !body.successful() || !encryptConfig.isBody()) {
return body;
}