|
@@ -0,0 +1,70 @@
|
|
|
+package com.fdkankan.manage.controller.inner;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.manage.common.ResultCode;
|
|
|
+import com.fdkankan.manage.common.ResultData;
|
|
|
+import com.fdkankan.manage.entity.JySceneUserAuth;
|
|
|
+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;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/service/manage/inner")
|
|
|
+public class InnerAPIController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IJyUserService jyUserService;
|
|
|
+ @Autowired
|
|
|
+ IUserService userService;
|
|
|
+ @Autowired
|
|
|
+ IJySceneUserAuthService jySceneUserAuthService;
|
|
|
+
|
|
|
+ @PostMapping("/getByRyId")
|
|
|
+ public ResultData getByRyId(@RequestBody UserParam param){
|
|
|
+ return ResultData.ok(jyUserService.getByRyId(param.getRyId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/addUcenterUser")
|
|
|
+ public ResultData addUcenterUser(@RequestBody UserParam param){
|
|
|
+ userService.addUcenterUser(param);
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/delUcenterUser")
|
|
|
+ public ResultData delUcenterUser(@RequestBody UserParam param){
|
|
|
+ userService.delUcenterUser(param);
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/addAuth")
|
|
|
+ public ResultData addAuth(@RequestBody JySceneUserAuth param){
|
|
|
+ jySceneUserAuthService.addAuth(param);
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/delAuth")
|
|
|
+ public ResultData delAuth(@RequestBody JySceneUserAuth param){
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|