Преглед на файлове

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

matianxiang преди 1 месец
родител
ревизия
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 3
 import com.alibaba.fastjson2.JSONObject;
4 4
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5
+import com.eitc.common.annotation.IgnoreReturnResultEncryption;
5 6
 import com.eitc.common.config.EitcConfig;
6 7
 import com.eitc.common.core.domain.AjaxResult;
7 8
 import com.eitc.common.utils.InterfaceVerificationUtil;
@@ -47,21 +48,22 @@ public class SaoMiaoYiController {
47 48
 
48 49
     /**
49 50
      * 慧视口腔-诊所列表
50
-     *
51 51
      */
52 52
     @GetMapping(value = "/clinicList")
53 53
     @ApiOperation("慧视健康-诊所列表")
54
-    public JSONObject clinicList() {
54
+    @IgnoreReturnResultEncryption
55
+    public AjaxResult clinicList() {
55 56
         // 这个是为了防止恶意请求来做的参数增加
56 57
         String saSignStr = InterfaceVerificationUtil.getSaSignStr(new HashMap<>());
57 58
         String url = fileUrl + "api/sys/clinict/appGetClinictList?" + saSignStr;
58 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 64
     @PostMapping("/uploads")
64 65
     @ApiOperation("上传影像")
66
+    @IgnoreReturnResultEncryption
65 67
     public AjaxResult uploadFiles(String identificationCard, List<MultipartFile> files) {
66 68
         if (StringUtils.isBlank(identificationCard)) {
67 69
             return AjaxResult.warn("请输入身份证号");
@@ -89,6 +91,7 @@ public class SaoMiaoYiController {
89 91
 
90 92
     @GetMapping("/list")
91 93
     @ApiOperation("查询影像")
94
+    @IgnoreReturnResultEncryption
92 95
     public AjaxResult list(ImageRecord imageRecord) {
93 96
         List<ImageRecord> list = imageRecordService.list(Wrappers.<ImageRecord>lambdaQuery()
94 97
                 .eq(StringUtils.isNotBlank(imageRecord.getIdentificationCard()), ImageRecord::getIdentificationCard, imageRecord.getIdentificationCard()));
@@ -97,6 +100,7 @@ public class SaoMiaoYiController {
97 100
 
98 101
     @DeleteMapping("/remove")
99 102
     @ApiOperation("删除影像")
103
+    @IgnoreReturnResultEncryption
100 104
     public AjaxResult remove(String ids) {
101 105
         List<String> idList = Arrays.asList(ids.split(","));
102 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 77
     @GetMapping(value = "/clinicList")
78 78
     @ApiOperation("诊所列表")
79
-    public JSONObject clinicList() {
79
+    public AjaxResult clinicList() {
80 80
         // 这个是为了防止恶意请求来做的参数增加
81 81
         String saSignStr = InterfaceVerificationUtil.getSaSignStr(new HashMap<>());
82 82
         String url = fileUrl + "api/sys/clinict/appGetClinictList?" + saSignStr;
83 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
     /**