phpcjl
2024-12-11 289dd88443b08fbdada0724d032f75c7fec0a6cf
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/BaseSettingController.java
@@ -1,9 +1,11 @@
package com.ruoyi.other.controller;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.BaseSetting;
import com.ruoyi.other.service.BaseSettingService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -18,6 +20,7 @@
 */
@RestController
@RequestMapping("/base-setting")
@Api("基础配置")
public class BaseSettingController {
   @Resource
@@ -35,6 +38,19 @@
      BaseSetting baseSetting = baseSettingService.getById(id);
      return R.ok(baseSetting);
   }
   /**
    * 保存设置
    */
   @PostMapping("/save")
   public R saveActivityConfig(@RequestBody String json){
      JSONObject jsonObject = JSONObject.parseObject(json);
      Integer id = jsonObject.getInteger("id");
      BaseSetting baseSetting = baseSettingService.getById(id);
      baseSetting.setContent(jsonObject.getString("content"));
      baseSettingService.saveOrUpdate(baseSetting);
      return R.ok();
   }