疯狂的狮子Li
2023-01-13 0fc796b90d3f44b81ef30285edb897223df439f7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
@@ -11,13 +11,11 @@
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictTypeService;
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.*;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -26,7 +24,6 @@
 * @author Lion Li
 */
@Validated
@Tag(name ="数据字典信息控制器", description = "数据字典信息管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/dict/type")
@@ -34,12 +31,18 @@
    private final ISysDictTypeService dictTypeService;
    /**
     * 查询字典类型列表
     */
    @SaCheckPermission("system:dict:list")
    @GetMapping("/list")
    public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) {
        return dictTypeService.selectPageDictTypeList(dictType, pageQuery);
    }
    /**
     * 导出字典类型列表
     */
    @Log(title = "字典类型", businessType = BusinessType.EXPORT)
    @SaCheckPermission("system:dict:export")
    @PostMapping("/export")
@@ -50,10 +53,12 @@
    /**
     * 查询字典类型详细
     *
     * @param dictId 字典ID
     */
    @SaCheckPermission("system:dict:query")
    @GetMapping(value = "/{dictId}")
    public R<SysDictType> getInfo(@Parameter(name = "字典ID") @PathVariable Long dictId) {
    public R<SysDictType> getInfo(@PathVariable Long dictId) {
        return R.ok(dictTypeService.selectDictTypeById(dictId));
    }
@@ -67,7 +72,8 @@
        if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
            return R.fail("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
        }
        return toAjax(dictTypeService.insertDictType(dict));
        dictTypeService.insertDictType(dict);
        return R.ok();
    }
    /**
@@ -80,16 +86,19 @@
        if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
            return R.fail("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
        }
        return toAjax(dictTypeService.updateDictType(dict));
        dictTypeService.updateDictType(dict);
        return R.ok();
    }
    /**
     * 删除字典类型
     *
     * @param dictIds 字典ID串
     */
    @SaCheckPermission("system:dict:remove")
    @Log(title = "字典类型", businessType = BusinessType.DELETE)
    @DeleteMapping("/{dictIds}")
    public R<Void> remove(@Parameter(name = "字典ID串") @PathVariable Long[] dictIds) {
    public R<Void> remove(@PathVariable Long[] dictIds) {
        dictTypeService.deleteDictTypeByIds(dictIds);
        return R.ok();
    }