Browse Source

feat(口腔医院): 修改返回值&添加注解

matianxiang 2 months ago
parent
commit
a5d142048b

+ 7 - 3
eitc-admin/src/main/java/com/eitc/web/controller/saomiaoyi/SaoMiaoYiController.java

@@ -2,6 +2,7 @@ package com.eitc.web.controller.saomiaoyi;
2
 
2
 
3
 import com.alibaba.fastjson2.JSONObject;
3
 import com.alibaba.fastjson2.JSONObject;
4
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
4
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5
+import com.eitc.common.annotation.IgnoreReturnResultEncryption;
5
 import com.eitc.common.config.EitcConfig;
6
 import com.eitc.common.config.EitcConfig;
6
 import com.eitc.common.core.domain.AjaxResult;
7
 import com.eitc.common.core.domain.AjaxResult;
7
 import com.eitc.common.utils.InterfaceVerificationUtil;
8
 import com.eitc.common.utils.InterfaceVerificationUtil;
@@ -47,21 +48,22 @@ public class SaoMiaoYiController {
47
 
48
 
48
     /**
49
     /**
49
      * 慧视口腔-诊所列表
50
      * 慧视口腔-诊所列表
50
-     *
51
      */
51
      */
52
     @GetMapping(value = "/clinicList")
52
     @GetMapping(value = "/clinicList")
53
     @ApiOperation("慧视健康-诊所列表")
53
     @ApiOperation("慧视健康-诊所列表")
54
-    public JSONObject clinicList() {
54
+    @IgnoreReturnResultEncryption
55
+    public AjaxResult clinicList() {
55
         // 这个是为了防止恶意请求来做的参数增加
56
         // 这个是为了防止恶意请求来做的参数增加
56
         String saSignStr = InterfaceVerificationUtil.getSaSignStr(new HashMap<>());
57
         String saSignStr = InterfaceVerificationUtil.getSaSignStr(new HashMap<>());
57
         String url = fileUrl + "api/sys/clinict/appGetClinictList?" + saSignStr;
58
         String url = fileUrl + "api/sys/clinict/appGetClinictList?" + saSignStr;
58
         String object = restTemplate.getForObject(url, String.class);
59
         String object = restTemplate.getForObject(url, String.class);
59
-        return JSONObject.parseObject(object);
60
+        return JSONObject.parseObject(object, AjaxResult.class);
60
     }
61
     }
61
 
62
 
62
 
63
 
63
     @PostMapping("/uploads")
64
     @PostMapping("/uploads")
64
     @ApiOperation("上传影像")
65
     @ApiOperation("上传影像")
66
+    @IgnoreReturnResultEncryption
65
     public AjaxResult uploadFiles(String identificationCard, List<MultipartFile> files) {
67
     public AjaxResult uploadFiles(String identificationCard, List<MultipartFile> files) {
66
         if (StringUtils.isBlank(identificationCard)) {
68
         if (StringUtils.isBlank(identificationCard)) {
67
             return AjaxResult.warn("请输入身份证号");
69
             return AjaxResult.warn("请输入身份证号");
@@ -89,6 +91,7 @@ public class SaoMiaoYiController {
89
 
91
 
90
     @GetMapping("/list")
92
     @GetMapping("/list")
91
     @ApiOperation("查询影像")
93
     @ApiOperation("查询影像")
94
+    @IgnoreReturnResultEncryption
92
     public AjaxResult list(ImageRecord imageRecord) {
95
     public AjaxResult list(ImageRecord imageRecord) {
93
         List<ImageRecord> list = imageRecordService.list(Wrappers.<ImageRecord>lambdaQuery()
96
         List<ImageRecord> list = imageRecordService.list(Wrappers.<ImageRecord>lambdaQuery()
94
                 .eq(StringUtils.isNotBlank(imageRecord.getIdentificationCard()), ImageRecord::getIdentificationCard, imageRecord.getIdentificationCard()));
97
                 .eq(StringUtils.isNotBlank(imageRecord.getIdentificationCard()), ImageRecord::getIdentificationCard, imageRecord.getIdentificationCard()));
@@ -97,6 +100,7 @@ public class SaoMiaoYiController {
97
 
100
 
98
     @DeleteMapping("/remove")
101
     @DeleteMapping("/remove")
99
     @ApiOperation("删除影像")
102
     @ApiOperation("删除影像")
103
+    @IgnoreReturnResultEncryption
100
     public AjaxResult remove(String ids) {
104
     public AjaxResult remove(String ids) {
101
         List<String> idList = Arrays.asList(ids.split(","));
105
         List<String> idList = Arrays.asList(ids.split(","));
102
         return toAjax(imageRecordService.removeBatchByIds(idList));
106
         return toAjax(imageRecordService.removeBatchByIds(idList));

+ 21 - 0
eitc-common/src/main/java/com/eitc/common/annotation/IgnoreReturnResultEncryption.java

@@ -0,0 +1,21 @@
1
+package com.eitc.common.annotation;
2
+
3
+import org.springframework.stereotype.Component;
4
+
5
+import java.lang.annotation.Documented;
6
+import java.lang.annotation.ElementType;
7
+import java.lang.annotation.Retention;
8
+import java.lang.annotation.RetentionPolicy;
9
+import java.lang.annotation.Target;
10
+
11
+/**
12
+ * 忽略返回结果加密
13
+ *
14
+ * @author eitc
15
+ */
16
+@Target({ ElementType.METHOD, ElementType.TYPE })
17
+@Retention(RetentionPolicy.RUNTIME)
18
+@Documented
19
+@Component
20
+public @interface IgnoreReturnResultEncryption {
21
+}

+ 2 - 2
eitc-patient-app/src/main/java/com/eitc/patient/controller/ApiAppController.java

@@ -76,12 +76,12 @@ public class ApiAppController extends BaseController {
76
      */
76
      */
77
     @GetMapping(value = "/clinicList")
77
     @GetMapping(value = "/clinicList")
78
     @ApiOperation("诊所列表")
78
     @ApiOperation("诊所列表")
79
-    public JSONObject clinicList() {
79
+    public AjaxResult clinicList() {
80
         // 这个是为了防止恶意请求来做的参数增加
80
         // 这个是为了防止恶意请求来做的参数增加
81
         String saSignStr = InterfaceVerificationUtil.getSaSignStr(new HashMap<>());
81
         String saSignStr = InterfaceVerificationUtil.getSaSignStr(new HashMap<>());
82
         String url = fileUrl + "api/sys/clinict/appGetClinictList?" + saSignStr;
82
         String url = fileUrl + "api/sys/clinict/appGetClinictList?" + saSignStr;
83
         String object = restTemplate.getForObject(url, String.class);
83
         String object = restTemplate.getForObject(url, String.class);
84
-        return JSONObject.parseObject(object);
84
+        return JSONObject.parseObject(object, AjaxResult.class);
85
     }
85
     }
86
 
86
 
87
     /**
87
     /**