|  |  | 
 |  |  | import com.doumee.core.model.PageData; | 
 |  |  | import com.doumee.core.model.PageWrap; | 
 |  |  | import com.doumee.core.utils.Constants; | 
 |  |  | import com.doumee.dao.system.dto.PlatformConfigDTO; | 
 |  |  | import com.doumee.dao.system.dto.QuerySystemDictDataDTO; | 
 |  |  | import com.doumee.dao.system.dto.VisitConfigDTO; | 
 |  |  | import com.doumee.dao.system.model.SystemDictData; | 
 |  |  | import com.doumee.dao.system.vo.SystemDictDataListVO; | 
 |  |  | import com.doumee.service.system.SystemDictDataService; | 
 |  |  | 
 |  |  |     @ApiOperation("新建") | 
 |  |  |     @PostMapping("/create") | 
 |  |  |     @CloudRequiredPermission("system:dict:update") | 
 |  |  |     public ApiResponse create(@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated(OperaType.Create.class) @RequestBody SystemDictData systemDictData) { | 
 |  |  |         systemDictData.setCreateUser(this.getLoginUser(token).getId()); | 
 |  |  |     public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemDictData systemDictData,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         systemDictData.setLoginUserInfo(this.getLoginUser(token)); | 
 |  |  |         systemDictData.setCreateUser(systemDictData.getLoginUserInfo().getId()); | 
 |  |  |         return ApiResponse.success(systemDictDataBiz.create(systemDictData)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("删除") | 
 |  |  |     @GetMapping("/delete/{id}") | 
 |  |  |     @CloudRequiredPermission("system:dict:update") | 
 |  |  |     public ApiResponse deleteById(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@PathVariable Integer id) { | 
 |  |  |     public ApiResponse deleteById(@PathVariable Integer id) { | 
 |  |  |         systemDictDataService.deleteById(id); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     @ApiOperation("批量删除") | 
 |  |  |     @GetMapping("/delete/batch") | 
 |  |  |     @CloudRequiredPermission("system:dict:delete") | 
 |  |  |     public ApiResponse deleteByIdInBatch(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@RequestParam String ids) { | 
 |  |  |     public ApiResponse deleteByIdInBatch(@RequestParam String ids) { | 
 |  |  |         String [] idArray = ids.split(","); | 
 |  |  |         List<Integer> idList = new ArrayList<>(); | 
 |  |  |         for (String id : idArray) { | 
 |  |  | 
 |  |  |     @ApiOperation("修改") | 
 |  |  |     @PostMapping("/updateById") | 
 |  |  |     @CloudRequiredPermission("system:dict:update") | 
 |  |  |     public ApiResponse updateById(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated(OperaType.Update.class) @RequestBody SystemDictData systemDictData) { | 
 |  |  |         systemDictData.setUpdateUser(this.getLoginUser(token).getId()); | 
 |  |  |     public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemDictData systemDictData,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         systemDictData.setLoginUserInfo(this.getLoginUser(token)); | 
 |  |  |         systemDictData.setUpdateUser(systemDictData.getLoginUserInfo().getId()); | 
 |  |  |         systemDictDataBiz.updateById(systemDictData); | 
 |  |  |         systemDictDataBiz.refreshCache(); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("分页查询") | 
 |  |  |     @PostMapping("/page") | 
 |  |  |     @CloudRequiredPermission("system:dict:update") | 
 |  |  |     public ApiResponse<PageData<SystemDictDataListVO>> findPage (@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@RequestBody PageWrap<QuerySystemDictDataDTO> pageWrap) { | 
 |  |  |     public ApiResponse<PageData<SystemDictDataListVO>> findPage (@RequestBody PageWrap<QuerySystemDictDataDTO> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         return ApiResponse.success(systemDictDataService.findPage(pageWrap)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "查询字典值数据" ) | 
 |  |  | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "label", value = "数据字典值H5_LINK_ADDR", required = true), | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "dictCode", value = "系统字典值SYSTEM", required = true) | 
 |  |  |     }) | 
 |  |  |     public ApiResponse<SystemDictData> getSystemDictData(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@RequestParam String dictCode, @RequestParam String label) { | 
 |  |  |     public ApiResponse<SystemDictData> getSystemDictData(@RequestParam String dictCode, @RequestParam String label,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         return ApiResponse.success(systemDictDataBiz.queryByCode(dictCode,label)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 访客来访配置 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "访客来访配置" ) | 
 |  |  |     @GetMapping("/getVisitConfigDTO") | 
 |  |  |     public ApiResponse<VisitConfigDTO> getVisitConfigDTO(){ | 
 |  |  |         return ApiResponse.success(systemDictDataService.getVisitConfigDTO()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 修改访客来访配置 | 
 |  |  |      * @param visitConfigDTO | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "修改访客来访配置" ) | 
 |  |  |     @PostMapping("/updateVisitConfig") | 
 |  |  |     public ApiResponse updateVisitConfig(@RequestBody VisitConfigDTO visitConfigDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
 |  |  |         visitConfigDTO.setLoginUserInfo(this.getLoginUser(token)); | 
 |  |  |         systemDictDataService.updateVisitConfig(visitConfigDTO); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     }; | 
 |  |  |     /** | 
 |  |  |      * 访客来访配置 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "访客来访配置" ) | 
 |  |  |     @GetMapping("/getPlatformConfigDTO") | 
 |  |  |     public ApiResponse<PlatformConfigDTO> getPlatformConfigDTO(){ | 
 |  |  |         return ApiResponse.success(systemDictDataService.getPlatformConfigDTO()); | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 修改访客来访配置 | 
 |  |  |      * @param visitConfigDTO | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "修改访客来访配置" ) | 
 |  |  |     @PostMapping("/updatePlatformConfig") | 
 |  |  |     public ApiResponse updatePlatformConfig(@RequestBody PlatformConfigDTO visitConfigDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
 |  |  |         visitConfigDTO.setLoginUserInfo(this.getLoginUser(token)); | 
 |  |  |         systemDictDataService.updatePlatformConfig(visitConfigDTO); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     }; | 
 |  |  | } |