| | |
| | | package com.ruoyi.system.controller.system; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.excel.utils.ExcelUtil; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysDictTypeBo dict) { |
| | | if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) { |
| | | return R.fail("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dictTypeService.insertDictType(dict); |
| | |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysDictTypeBo dict) { |
| | | if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) { |
| | | return R.fail("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dictTypeService.updateDictType(dict); |