lyhzzz 1 年間 前
コミット
f400304666

+ 0 - 87
src/main/java/com/fdkankan/manage/controller/external/ExternalAPIController.java

@@ -1,87 +0,0 @@
-package com.fdkankan.manage.controller.external;
-
-import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.manage.aop.EncryptFilter;
-import com.fdkankan.manage.common.ResultCode;
-import com.fdkankan.manage.common.ResultData;
-import com.fdkankan.manage.entity.JySceneUserAuth;
-import com.fdkankan.manage.entity.JyUser;
-import com.fdkankan.manage.exception.BusinessException;
-import com.fdkankan.manage.service.IJySceneUserAuthService;
-import com.fdkankan.manage.service.IJyUserService;
-import com.fdkankan.manage.service.IUserService;
-import com.fdkankan.manage.util.RsaUtils;
-import com.fdkankan.manage.vo.request.UserParam;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-@RestController
-@RequestMapping("/service/manage/external")
-public class ExternalAPIController {
-
-    @Autowired
-    IJyUserService jyUserService;
-    @Autowired
-    IUserService userService;
-    @Autowired
-    IJySceneUserAuthService jySceneUserAuthService;
-
-    @PostMapping("/getByRyId")
-    public ResultData getByRyId(@RequestBody String str){
-        String bodyDec = RsaUtils.decipher(str);
-        UserParam param = JSONObject.parseObject(bodyDec, UserParam.class);
-        return ResultData.ok(jyUserService.getByRyId(param.getRyId()));
-    }
-
-    @PostMapping("/addUcenterUser")
-    public ResultData addUcenterUser(@RequestBody String str){
-        String bodyDec = RsaUtils.decipher(str);
-        UserParam param = JSONObject.parseObject(bodyDec, UserParam.class);
-        userService.addUcenterUser(param);
-        return ResultData.ok();
-    }
-
-
-    @PostMapping("/delUcenterUser")
-    public ResultData delUcenterUser(@RequestBody String str){
-        String bodyDec = RsaUtils.decipher(str);
-        UserParam param = JSONObject.parseObject(bodyDec, UserParam.class);
-        userService.delUcenterUser(param);
-        return ResultData.ok();
-    }
-
-
-    @PostMapping("/addAuth")
-    public ResultData addAuth(@RequestBody String str){
-        String bodyDec = RsaUtils.decipher(str);
-        JySceneUserAuth param = JSONObject.parseObject(bodyDec, JySceneUserAuth.class);
-        jySceneUserAuthService.addAuth(param);
-        return ResultData.ok();
-    }
-
-
-    @PostMapping("/delAuth")
-    public ResultData delAuth(@RequestBody String str){
-        String bodyDec = RsaUtils.decipher(str);
-        JySceneUserAuth param = JSONObject.parseObject(bodyDec, JySceneUserAuth.class);
-        if(StringUtils.isBlank(param.getNum()) || StringUtils.isBlank(param.getRyId())){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        JySceneUserAuth db = jySceneUserAuthService.getByNumAndRyId(param.getNum(),param.getRyId());
-        if(db == null){
-            throw new BusinessException(ResultCode.DEL_AUTH_ERROR);
-        }
-        jySceneUserAuthService.delAuth(db);
-        return ResultData.ok();
-    }
-
-
-    @PostMapping("/checkAuthOther")
-    public ResultData checkAuthOther(@RequestBody String str){
-        String bodyDec = RsaUtils.decipher(str);
-        JySceneUserAuth param = JSONObject.parseObject(bodyDec, JySceneUserAuth.class);
-        jySceneUserAuthService.addAuth(param);
-        return ResultData.ok();
-    }
-}

+ 5 - 0
src/main/java/com/fdkankan/manage/controller/inner/InnerAPIController.java

@@ -67,4 +67,9 @@ public class InnerAPIController {
         return ResultData.ok();
     }
 
+    @PostMapping("/checkAuthOther")
+    public ResultData checkAuthOther(@RequestBody JySceneUserAuth param){
+        return ResultData.ok(jySceneUserAuthService.checkAuthOther(param));
+    }
+
 }

+ 1 - 1
src/main/java/com/fdkankan/manage/test/TestController.java

@@ -40,7 +40,7 @@ public class TestController {
 
         HttpPost httpPost = new HttpPost(url);
         CloseableHttpClient client = HttpClients.createDefault();
-        StringEntity entity = new StringEntity(encipher,"utf-8");//解决中文乱码问题
+        StringEntity entity = new StringEntity(encipher,"utf-8");
         entity.setContentEncoding("utf-8");
         entity.setContentType("application/json");
         httpPost.setEntity(entity);