| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"}) |
| | | @Tag(name ="数据字典信息控制器", description = "数据字典信息管理") |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | |
| | | |
| | | private final ISysDictTypeService dictTypeService; |
| | | |
| | | @ApiOperation("查询字典类型列表") |
| | | @Operation(summary = "查询字典类型列表") |
| | | @SaCheckPermission("system:dict:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) { |
| | | return dictTypeService.selectPageDictTypeList(dictType, pageQuery); |
| | | } |
| | | |
| | | @ApiOperation("导出字典类型列表") |
| | | @Operation(summary = "导出字典类型列表") |
| | | @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:dict:export") |
| | | @PostMapping("/export") |
| | |
| | | /** |
| | | * 查询字典类型详细 |
| | | */ |
| | | @ApiOperation("查询字典类型详细") |
| | | @Operation(summary = "查询字典类型详细") |
| | | @SaCheckPermission("system:dict:query") |
| | | @GetMapping(value = "/{dictId}") |
| | | public R<SysDictType> getInfo(@ApiParam("字典ID") @PathVariable Long dictId) { |
| | | public R<SysDictType> getInfo(@Parameter(name = "字典ID") @PathVariable Long dictId) { |
| | | return R.ok(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @ApiOperation("新增字典类型") |
| | | @Operation(summary = "新增字典类型") |
| | | @SaCheckPermission("system:dict:add") |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | |
| | | /** |
| | | * 修改字典类型 |
| | | */ |
| | | @ApiOperation("修改字典类型") |
| | | @Operation(summary = "修改字典类型") |
| | | @SaCheckPermission("system:dict:edit") |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @ApiOperation("删除字典类型") |
| | | @Operation(summary = "删除字典类型") |
| | | @SaCheckPermission("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public R<Void> remove(@ApiParam("字典ID串") @PathVariable Long[] dictIds) { |
| | | public R<Void> remove(@Parameter(name = "字典ID串") @PathVariable Long[] dictIds) { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return R.ok(); |
| | | } |
| | |
| | | /** |
| | | * 刷新字典缓存 |
| | | */ |
| | | @ApiOperation("刷新字典缓存") |
| | | @Operation(summary = "刷新字典缓存") |
| | | @SaCheckPermission("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | |
| | | /** |
| | | * 获取字典选择框列表 |
| | | */ |
| | | @ApiOperation("获取字典选择框列表") |
| | | @Operation(summary = "获取字典选择框列表") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysDictType>> optionselect() { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |