|  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.biz.zbom.ZbomIAMService; | 
|---|
|  |  |  | import com.doumee.biz.zbom.model.IamUpateShopModel; | 
|---|
|  |  |  | import com.doumee.biz.zbom.model.IamUpateUserModel; | 
|---|
|  |  |  | import com.doumee.biz.zbom.model.IamUpdateRoleModel; | 
|---|
|  |  |  | import com.doumee.biz.zbom.model.IamUpdateShopModel; | 
|---|
|  |  |  | import com.doumee.biz.zbom.model.IamUpdateUserModel; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse<String> updateShopInfo(@RequestHeader(name = "token") String token, | 
|---|
|  |  |  | @RequestHeader(name = "uuid") String uuid , | 
|---|
|  |  |  | @RequestHeader(name = "timestamp") String timestamp, | 
|---|
|  |  |  | @RequestBody List<IamUpateShopModel> shopList, | 
|---|
|  |  |  | @RequestBody List<IamUpdateShopModel> shopList, | 
|---|
|  |  |  | HttpServletRequest request ) { | 
|---|
|  |  |  | int success = Constants.ZERO; | 
|---|
|  |  |  | ApiResponse<String> r = null; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | zbomIAMService.updateShopInfo(token,uuid,timestamp,shopList); | 
|---|
|  |  |  | r  = ApiResponse.success("操作成功"); | 
|---|
|  |  |  | r  = ApiResponse.successIam("操作成功"); | 
|---|
|  |  |  | }catch (BusinessException e){ | 
|---|
|  |  |  | success = Constants.ONE; | 
|---|
|  |  |  | r = ApiResponse.failed(StringUtils.defaultString(e.getMessage(),"操作失败")); | 
|---|
|  |  |  | 
|---|
|  |  |  | success = Constants.ONE; | 
|---|
|  |  |  | r = ApiResponse.failed("操作失败"); | 
|---|
|  |  |  | }finally { | 
|---|
|  |  |  | zbomIAMService.saveInterfaceLog("/push/iam/updateUserInfo","IAM推送人员账号信息", token, uuid, timestamp, shopList,success, JSONObject.toJSONString(r)); | 
|---|
|  |  |  | zbomIAMService.saveInterfaceLog("/push/iam/updateUserInfo",Constants.ONE,"IAM推送组织信息", token, uuid, timestamp, shopList,success, JSONObject.toJSONString(r)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return r; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse<String> updateUserInfo(@RequestHeader(name = "token") String token, | 
|---|
|  |  |  | @RequestHeader(name = "uuid") String uuid , | 
|---|
|  |  |  | @RequestHeader(name = "timestamp") String timestamp, | 
|---|
|  |  |  | @RequestBody IamUpateUserModel upateUserModel, | 
|---|
|  |  |  | @RequestBody IamUpdateUserModel upateUserModel, | 
|---|
|  |  |  | HttpServletRequest request) { | 
|---|
|  |  |  | int success = Constants.ZERO; | 
|---|
|  |  |  | ApiResponse<String> r = null; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | zbomIAMService.updateUserInfo(token,uuid,timestamp,upateUserModel); | 
|---|
|  |  |  | r  = ApiResponse.success("操作成功"); | 
|---|
|  |  |  | r  = ApiResponse.successIam("操作成功"); | 
|---|
|  |  |  | }catch (BusinessException e){ | 
|---|
|  |  |  | success = Constants.ONE; | 
|---|
|  |  |  | r = ApiResponse.failed(StringUtils.defaultString(e.getMessage(),"操作失败")); | 
|---|
|  |  |  | 
|---|
|  |  |  | e.getMessage(); | 
|---|
|  |  |  | r = ApiResponse.failed("操作失败"); | 
|---|
|  |  |  | }finally { | 
|---|
|  |  |  | zbomIAMService.saveInterfaceLog("/push/iam/updateUserInfo","IAM推送人员账号信息", token, uuid, timestamp, upateUserModel,success, JSONObject.toJSONString(r)); | 
|---|
|  |  |  | zbomIAMService.saveInterfaceLog("/push/iam/updateUserInfo",Constants.ONE,"IAM推送人员账号信息", token, uuid, timestamp, upateUserModel,success, JSONObject.toJSONString(r)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return r; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("角色信息更新推送") | 
|---|
|  |  |  | @PostMapping("/iam/updateRoleInfo") | 
|---|
|  |  |  | public ApiResponse<String> updateRoleInfo(@RequestHeader(name = "token") String token, | 
|---|
|  |  |  | @RequestHeader(name = "uuid") String uuid , | 
|---|
|  |  |  | @RequestHeader(name = "timestamp") String timestamp, | 
|---|
|  |  |  | @RequestBody IamUpdateRoleModel upateModel, | 
|---|
|  |  |  | HttpServletRequest request) { | 
|---|
|  |  |  | int success = Constants.ZERO; | 
|---|
|  |  |  | ApiResponse<String> r = null; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | zbomIAMService.updateRoleInfo(token,uuid,timestamp,upateModel); | 
|---|
|  |  |  | r  = ApiResponse.successIam("操作成功"); | 
|---|
|  |  |  | }catch (BusinessException e){ | 
|---|
|  |  |  | success = Constants.ONE; | 
|---|
|  |  |  | r = ApiResponse.failed(StringUtils.defaultString(e.getMessage(),"操作失败")); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | success = Constants.ONE; | 
|---|
|  |  |  | e.getMessage(); | 
|---|
|  |  |  | r = ApiResponse.failed("操作失败"); | 
|---|
|  |  |  | }finally { | 
|---|
|  |  |  | zbomIAMService.saveInterfaceLog("/push/iam/updateRoleInfo",Constants.ONE,"IAM推送角色账号信息", token, uuid, timestamp, upateModel,success, JSONObject.toJSONString(r)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return r; | 
|---|
|  |  |  | } | 
|---|