|
@@ -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();
|
|
|
- }
|
|
|
-}
|