From abd914abdee5831b04b6d76d04bd1a50534fa68c Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 06 五月 2025 16:51:18 +0800
Subject: [PATCH] Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile into dev
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
index 35e15af..e301848 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
@@ -1,7 +1,12 @@
package com.ruoyi.other.controller;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.Logical;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.other.api.domain.THtml;
import com.ruoyi.other.api.domain.TNotice;
import com.ruoyi.other.service.THtmlService;
@@ -23,16 +28,26 @@
public class THtmlController {
@Resource
private THtmlService htmlService;
-
-
-
+
+
+ @RequiresPermissions(value = {"/protocolServerDescription"}, logical = Logical.OR)
@ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改")
@PostMapping(value = "/saveOrUpdate")
+ @Log(title = "【协议服务】新增修改协议", businessType = BusinessType.INSERT)
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();
}
-
+
+
+
+ @RequiresPermissions(value = {"/protocolServerDescription"}, logical = Logical.OR)
@ApiOperation(tags = {"后台-内容设置-协议服务"},value = "查询")
@GetMapping(value = "/selectByType/{type}")
public AjaxResult selectByType(@PathVariable Integer type) {
--
Gitblit v1.7.1