| | |
| | | package com.vci.frameworkcore.controller; |
| | | |
| | | import com.vci.frameworkcore.compatibility.SmPwdStrategyQueryServiceI; |
| | | import com.vci.frameworkcore.model.dto.SmPasswordStrategyDTO; |
| | | import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; |
| | | import com.vci.frameworkcore.pagemodel.SmUserVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.util.Func; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/passwordStrategyQueryController") |
| | | @Slf4j |
| | | public class SmPwdStrategyQueryController { |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Resource |
| | | private SmPwdStrategyQueryServiceI pwdStrategyQueryService; |
| | | |
| | | /** |
| | | * 日志 |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * 密码安全策略的列表参照查询 |
| | |
| | | return BaseResult.dataGrid(pwdStrategyVODataGrid); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | log.error("密码安全策略列表查询时出现错误,原因:" + exceptionMessage); |
| | | return BaseResult.fail("密码安全策略列表查询时出现错误,原因:" + e.getMessage()); |
| | | String exceptionMessage = "密码安全策略列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | return BaseResult.dataList(pwdStrategyVODataGrid); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | log.error("密码安全策略下拉列表查询时出现错误,原因:" + exceptionMessage); |
| | | return BaseResult.fail("密码安全策略下拉列表查询时出现错误,原因:" + e.getMessage()); |
| | | String exceptionMessage = "密码安全策略下拉列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | ? BaseResult.success("为用户设置密码安全策略成功!"):BaseResult.fail("为用户设置密码安全策略失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | log.error("为用户设置密码安全策略时出现错误,原因:" + exceptionMessage); |
| | | return BaseResult.fail("为用户设置密码安全策略时出现错误,原因:" + exceptionMessage); |
| | | String exceptionMessage = "为用户设置密码安全策略时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增密码策略 |
| | | * @param smPasswordStrategyDTO |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addPasswordStrateg",method = RequestMethod.POST) |
| | | public BaseResult addPasswordStrateg(@RequestBody SmPasswordStrategyDTO smPasswordStrategyDTO){ |
| | | try { |
| | | return pwdStrategyQueryService.addPasswordStrateg(smPasswordStrategyDTO) |
| | | ? BaseResult.success("新增密码安全策略成功!"):BaseResult.fail("新增密码安全策略失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "新增密码安全策略时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改密码策略 |
| | | * @param smPasswordStrategyDTO |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/updatePasswordStrateg",method = RequestMethod.PUT) |
| | | public BaseResult updatePasswordStrateg(@RequestBody SmPasswordStrategyDTO smPasswordStrategyDTO){ |
| | | try { |
| | | return pwdStrategyQueryService.updatePasswordStrateg(smPasswordStrategyDTO) |
| | | ? BaseResult.success("修改密码安全策略成功!"):BaseResult.fail("修改密码安全策略失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改密码安全策略时出现错误,原因:" +VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除密码策略 |
| | | * @param pwdIds |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/delPasswordStrateg",method = RequestMethod.DELETE) |
| | | @VciUnCheckRight |
| | | public BaseResult delPasswordStrateg(String[] pwdIds){ |
| | | try { |
| | | return pwdStrategyQueryService.delPasswordStrateg(pwdIds) |
| | | ? BaseResult.success("删除密码安全策略成功!"):BaseResult.fail("删除密码安全策略失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "删除密码安全策略时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |