¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.system; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.OperaType; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.system.dto.QuerySystemDictDataDTO; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.system.vo.SystemDictDataListVO; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | | * @date 2023/03/21 14:49 |
| | | */ |
| | | @Api(tags = "åå
¸æ°æ®") |
| | | @RestController |
| | | @RequestMapping("/system/dictData") |
| | | public class SystemDictDataController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SystemDictDataService systemDictDataService; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("system:dict:update") |
| | | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemDictData systemDictData) { |
| | | return ApiResponse.success(systemDictDataBiz.create(systemDictData)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("system:dict:update") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | systemDictDataService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("system:dict:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | systemDictDataService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("system:dict:update") |
| | | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemDictData systemDictData) { |
| | | systemDictDataBiz.updateById(systemDictData); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("system:dict:update") |
| | | public ApiResponse<PageData<SystemDictDataListVO>> findPage (@RequestBody PageWrap<QuerySystemDictDataDTO> pageWrap) { |
| | | return ApiResponse.success(systemDictDataService.findPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢åå
¸å¼æ°æ®" ) |
| | | @GetMapping("/getSystemDictData") |
| | | @ApiImplicitParams({ |
| | | @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(@RequestParam String dictCode, @RequestParam String label) { |
| | | return ApiResponse.success(systemDictDataBiz.queryByCode(dictCode,label)); |
| | | } |
| | | |
| | | |
| | | } |