From fef8e1050da603344ed8bda819d390c2c16551ea Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 09 十一月 2024 17:32:05 +0800
Subject: [PATCH] 代码提交

---
 xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java b/xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java
index b99ee70..de3f63e 100644
--- a/xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java
+++ b/xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java
@@ -4,17 +4,16 @@
 import com.xinquan.common.core.domain.R;
 import com.xinquan.common.core.utils.page.PageDTO;
 import com.xinquan.system.domain.ContentSetting;
+import com.xinquan.system.domain.VipSetting;
+import com.xinquan.system.domain.dto.AggrementOtherDto;
 import com.xinquan.system.service.ContentSettingService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.time.LocalDateTime;
 
 /**
  * <p>
@@ -34,9 +33,9 @@
      *
      */
     @PostMapping("/getCoursePageList")
-    @ApiOperation(value = "获取内容、协议1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明",tags = "富文本规则说明")
+    @ApiOperation(value = "获取内容、协议1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明 7等级经验值说明",tags = "富文本规则说明")
     @ApiImplicitParams({
-            @ApiImplicitParam(value = "内容类型 1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明", name = "contentType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "内容类型 1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明 7等级经验值说明", name = "contentType", required = true, dataType = "int"),
     })
     public R<String> getCourseList(@RequestParam(value = "contentType", required = true) int contentType) {
         ContentSetting one = contentSettingService.lambdaQuery().eq(ContentSetting::getContentType, contentType).one();
@@ -47,5 +46,26 @@
 
         }
     }
+    @PostMapping("/saveOrupdateContent")
+    @ApiOperation(value = "保存修改富文本内容",tags = "管理后台-富文本规则说明")
+
+    public R saveOrupdateContent(@RequestBody AggrementOtherDto dto) {
+        ContentSetting one = contentSettingService.lambdaQuery().eq(ContentSetting::getContentType, dto.getType()).one();
+        if (dto.getType() == 7){
+            dto.setContent("<img src="+"\""+dto.getContent()+"\">"+"</img>");
+        }
+        if (one!=null){
+            one.setContent(dto.getContent());
+            contentSettingService.updateById(one);
+        }else{
+            ContentSetting contentSetting = new ContentSetting();
+            contentSetting.setContentType(dto.getType());
+            contentSetting.setContent(dto.getContent());
+            contentSetting.setCreateTime(LocalDateTime.now());
+            contentSettingService.save(contentSetting);
+        }
+
+        return R.ok();
+    }
 }
 

--
Gitblit v1.7.1