| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | private final ISysDictTypeService dictTypeService; |
| | | |
| | | @ApiOperation("查询字典类型列表") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @SaCheckPermission("system:dict:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) { |
| | | return dictTypeService.selectPageDictTypeList(dictType, pageQuery); |
| | |
| | | |
| | | @ApiOperation("导出字典类型列表") |
| | | @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @SaCheckPermission("system:dict:export") |
| | | @PostMapping("/export") |
| | | public void export(SysDictType dictType, HttpServletResponse response) { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | |
| | | * 查询字典类型详细 |
| | | */ |
| | | @ApiOperation("查询字典类型详细") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @SaCheckPermission("system:dict:query") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult<SysDictType> getInfo(@ApiParam("字典ID") @PathVariable Long dictId) { |
| | | return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); |
| | |
| | | * 新增字典类型 |
| | | */ |
| | | @ApiOperation("新增字典类型") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @SaCheckPermission("system:dict:add") |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult<Void> add(@Validated @RequestBody SysDictType dict) { |
| | |
| | | * 修改字典类型 |
| | | */ |
| | | @ApiOperation("修改字典类型") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @SaCheckPermission("system:dict:edit") |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult<Void> edit(@Validated @RequestBody SysDictType dict) { |
| | |
| | | * 删除字典类型 |
| | | */ |
| | | @ApiOperation("删除字典类型") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @SaCheckPermission("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult<Void> remove(@ApiParam("字典ID串") @PathVariable Long[] dictIds) { |
| | |
| | | * 刷新字典缓存 |
| | | */ |
| | | @ApiOperation("刷新字典缓存") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @SaCheckPermission("system:dict:remove") |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult<Void> refreshCache() { |