| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | 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.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | |
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysConfig;
|
| | | import com.ruoyi.project.system.service.ISysConfigService;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * 参数配置 信息操作处理
|
| | |
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/config")
|
| | | @AllArgsConstructor
|
| | | public class SysConfigController extends BaseController
|
| | | {
|
| | | @Autowired
|
| | | private ISysConfigService configService;
|
| | |
|
| | | /**
|
| | |
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysConfig config)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
| | | if (!configService.checkConfigKeyUnique(config))
|
| | | {
|
| | | return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
| | | }
|
| | |
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
| | | if (!configService.checkConfigKeyUnique(config))
|
| | | {
|
| | | return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
| | | }
|