From 7fec75a658d071bcd3af08e769d235080c63e6a3 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 08 十月 2021 13:56:51 +0800
Subject: [PATCH] bug修复
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/SysConfApi.java | 51 ++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/SysConfApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/SysConfApi.java
index a3e5b47..6cbe36b 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/SysConfApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/SysConfApi.java
@@ -1,14 +1,19 @@
package com.panzhihua.service_community.api;
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panzhihua.common.constants.Constants;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.model.dos.SysConfDO;
import com.panzhihua.service_community.service.SysConfService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
@@ -20,11 +25,47 @@
@GetMapping("get")
public R get(@RequestParam("code") String code) {
- SysConfDO sysConfDO = sysConfService.getOne(new QueryWrapper<SysConfDO>().lambda().eq(SysConfDO::getCode,code));
+ SysConfDO sysConfDO =
+ sysConfService.getOne(new QueryWrapper<SysConfDO>().lambda().eq(SysConfDO::getCode, code));
String value = Constants.ZZ_APP_TAG_LIST;
- if(sysConfDO != null){
+ if (sysConfDO != null) {
value = sysConfDO.getValue();
}
return R.ok(value);
}
+
+ /**
+ * 根据系统code以及社区id查询配置表value值
+ *
+ * @param key 系统code
+ * @param communityId 社区id
+ * @return 系统配置value值
+ */
+ @GetMapping("getSysConfValue")
+ public R getSysConfValue(@RequestParam("key") String key,@RequestParam("communityId") Long communityId) {
+ return sysConfService.getSysConfValue(key,communityId);
+ }
+
+ /**
+ * 新增系统code配置数据
+ *
+ * @param key 系统code
+ * @param communityId 社区id
+ * @return 新增结果
+ */
+ @GetMapping("addSysConfValue")
+ public R addSysConfValue(@RequestParam("key") String key,@RequestParam("communityId") Long communityId,@RequestParam("name") String name,@RequestParam("value") String value) {
+ return sysConfService.addSysConfValue(key,communityId,name,value);
+ }
+
+ /**
+ * 编辑系统配置
+ * @param communityId 社区id
+ * @param status 配置值
+ * @return 编辑结果
+ */
+ @GetMapping("editSysConfValue")
+ public R editSysConfValue(@RequestParam("communityId") Long communityId,@RequestParam("status") Integer status) {
+ return sysConfService.editSysConfValue(communityId,status);
+ }
}
--
Gitblit v1.7.1