From 11acaaf1e2e5e71dff57a788fb26b263bcd117b7 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 01 十一月 2024 20:16:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java | 37 +++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 2 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 1739f4d..0e93b75 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,9 +1,17 @@
package com.ruoyi.other.controller;
-import org.springframework.web.bind.annotation.RequestMapping;
+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.other.api.domain.THtml;
+import com.ruoyi.other.api.domain.TNotice;
+import com.ruoyi.other.service.THtmlService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
/**
* <p>
@@ -16,6 +24,31 @@
@RestController
@RequestMapping("/t-html")
public class THtmlController {
+ @Resource
+ private THtmlService htmlService;
+
+
+
+ @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改")
+ @PostMapping(value = "/saveOrUpdate")
+ @Log(title = "【协议服务】新增修改协议", businessType = BusinessType.INSERT)
+ public AjaxResult saveOrUpdate(@RequestBody THtml 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();
+ }
+
+ @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "查询")
+ @GetMapping(value = "/selectByType/{type}")
+ public AjaxResult selectByType(@PathVariable Integer type) {
+ THtml one = htmlService.lambdaQuery().eq(THtml::getType, type).last("limit 1").one();
+ return AjaxResult.success(one);
+ }
}
--
Gitblit v1.7.1