| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | 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; |
| | | |
| | | /** |
| | |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Tag(name = "参数配置控制器", description = "参数配置管理") |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | |
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { |
| | | return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | return toAjax(configService.insertConfig(config)); |
| | | configService.insertConfig(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { |
| | | return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | return toAjax(configService.updateConfig(config)); |
| | | configService.updateConfig(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updateByKey") |
| | | public R<Void> updateByKey(@RequestBody SysConfig config) { |
| | | return toAjax(configService.updateConfig(config)); |
| | | configService.updateConfig(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |