无关风月
2024-10-14 039a33d1bfa6ef041161666bbd120c34086fe7c1
xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java
@@ -4,6 +4,7 @@
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.service.ContentSettingService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -15,6 +16,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.time.LocalDateTime;
/**
 * <p>
@@ -34,9 +36,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 +49,26 @@
        }
    }
    @PostMapping("/saveOrupdateContent")
    @ApiOperation(value = "保存修改富文本内容",tags = "管理后台-富文本规则说明")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "内容类型 1=用户协议 2=隐私协议 3=关于心泉 4= 新手冥想指南 5=课程/冥想音频购买协议 6=能量规则说明 7等级经验值规则说明", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "富文本内容", name = "content", required = true, dataType = "String"),
    })
    public R saveOrupdateContent(Integer type,String content) {
        ContentSetting one = contentSettingService.lambdaQuery().eq(ContentSetting::getContentType, type).one();
        if (one!=null){
            one.setContent(content);
            contentSettingService.updateById(one);
        }else{
            ContentSetting contentSetting = new ContentSetting();
            contentSetting.setContentType(type);
            contentSetting.setContent(content);
            contentSetting.setCreateTime(LocalDateTime.now());
            contentSettingService.save(contentSetting);
        }
        return R.ok();
    }
}