|
@@ -2,17 +2,19 @@ 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.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/service/manage/external")
|
|
@@ -22,6 +24,8 @@ public class ExternalAPIController {
|
|
|
IJyUserService jyUserService;
|
|
|
@Autowired
|
|
|
IUserService userService;
|
|
|
+ @Autowired
|
|
|
+ IJySceneUserAuthService jySceneUserAuthService;
|
|
|
|
|
|
@PostMapping("/getByRyId")
|
|
|
public ResultData getByRyId(@RequestBody String str){
|
|
@@ -47,4 +51,26 @@ public class ExternalAPIController {
|
|
|
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());
|
|
|
+ jySceneUserAuthService.delAuth(db);
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
}
|