luodangjia
2024-08-24 4fe0ca21f984b38e24df69be4443c30341ee8efb
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.other.api.domain.THtml;
import com.ruoyi.other.api.domain.TNotice;
@@ -29,7 +30,13 @@
    @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改")
    @PostMapping(value = "/saveOrUpdate")
    public AjaxResult saveOrUpdate(@RequestBody THtml tHtml) {
        htmlService.saveOrUpdate(tHtml);
        THtml one = htmlService.lambdaQuery().eq(THtml::getType, tHtml.getType()).one();
        if(one!=null){
            one.setContent(tHtml.getContent());
            htmlService.updateById(one);
        }else {
            htmlService.save(tHtml);
        }
    return AjaxResult.success();
    }