| | |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @ApiOperation("导出字典数据列表") |
| | | @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:dict:export") |
| | | @GetMapping("/export") |
| | | @PostMapping("/export") |
| | | public void export(SysDictData dictData, HttpServletResponse response) { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil.exportExcel(list, "字典数据", SysDictData.class, response); |
| | |
| | | @ApiOperation("查询字典数据详细") |
| | | @SaCheckPermission("system:dict:query") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult<SysDictData> getInfo(@PathVariable Long dictCode) { |
| | | public AjaxResult<SysDictData> getInfo(@ApiParam("字典code") @PathVariable Long dictCode) { |
| | | return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("根据字典类型查询字典数据信息") |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult<List<SysDictData>> dictType(@PathVariable String dictType) { |
| | | public AjaxResult<List<SysDictData>> dictType(@ApiParam("字典类型") @PathVariable String dictType) { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) { |
| | | data = new ArrayList<>(); |
| | |
| | | @SaCheckPermission("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult<Void> remove(@PathVariable Long[] dictCodes) { |
| | | public AjaxResult<Void> remove(@ApiParam("字典code串") @PathVariable Long[] dictCodes) { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |