From 7a0f7e715ffacab8851de10abcf6b857ca84a263 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期二, 09 七月 2024 17:54:13 +0800
Subject: [PATCH] 修改bug
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java | 138 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 137 insertions(+), 1 deletions(-)
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java
index bb5de76..ba8ec76 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java
@@ -1,8 +1,26 @@
package com.ruoyi.system.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.system.api.domain.CustomConfig;
+import com.ruoyi.system.api.domain.dto.MgtAfterSaleSettingDTO;
+import com.ruoyi.system.domain.dto.PointsConfigDTO;
+import com.ruoyi.system.domain.vo.CustomConfigVO;
+import com.ruoyi.system.service.ICustomConfigService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -15,6 +33,124 @@
*/
@RestController
@RequestMapping("/custom-config")
+@Api(value = "系统配置接口", tags = "系统配置接口")
public class CustomConfigController {
+ @Resource
+ private ICustomConfigService iCustomConfigService;
+ @GetMapping(value = "/{configId}")
+ public R<CustomConfig> getconfig(@PathVariable String configId)
+ {
+ LambdaQueryWrapper<CustomConfig> wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(CustomConfig::getConfigKey, configId);
+ CustomConfig one = iCustomConfigService.getOne(wrapper);
+ return R.ok(one);
+ }
+ /**
+ * 获取积分设置
+ *
+ * @return List<CustomConfig>
+ */
+ @ApiOperation("获取积分设置")
+ @GetMapping("/points")
+ public R<PointsConfigDTO> getPointsConfig() {
+ return R.ok(iCustomConfigService.getPointsConfig());
+ }
+ /**
+ * 保存积分设置
+ *
+ * @param dto 积分配置数据传输对象
+ */
+ @ApiOperation(value = "保存积分设置")
+ @PostMapping("/save-points")
+ public R<?> savePointsSettings(@Validated @RequestBody PointsConfigDTO dto) {
+ iCustomConfigService.savePointsSettings(dto);
+ return R.ok();
+ }
+
+ /**
+ * 获取订单说明设置
+ *
+ * @return CustomConfigVO
+ */
+ @ApiOperation("获取订单说明设置")
+ @GetMapping("/order-desc")
+ public R<CustomConfigVO> getOrderDesc() {
+ return R.ok(iCustomConfigService.getOrderDesc());
+ }
+
+ /**
+ * 订单说明设置
+ *
+ * @param description 订单说明
+ */
+ @ApiOperation(value = "订单说明设置")
+ @PostMapping("/save-order-desc")
+ public R<?> saveOrderDescription(
+ @RequestParam(value = "description", required = true) String description) {
+ iCustomConfigService.saveOrderDescription(description);
+ return R.ok();
+ }
+
+ /**
+ * 售后设置
+ *
+ * @param dto 售后设置对象
+ */
+ @ApiOperation(value = "售后设置")
+ @PostMapping("/save-after-sale-setting")
+ public R<?> saveAfterSaleSetting(@Validated @RequestBody MgtAfterSaleSettingDTO dto) {
+ iCustomConfigService.saveAfterSaleSetting(dto);
+ return R.ok();
+ }
+
+ /**
+ * 获取售后设置
+ *
+ * @return List<CustomConfigVO>
+ */
+ @ApiOperation("获取售后设置")
+ @GetMapping("/get-after-sale-setting")
+ public R<MgtAfterSaleSettingDTO> getAfterSaleSetting() {
+ return R.ok(iCustomConfigService.getAfterSaleSetting());
+ }
+
+ /**
+ * 获取客服电话
+ *
+ * @return 客服电话
+ */
+ @ApiOperation("获取客服电话")
+ @GetMapping("/service-phone")
+ public R<String> servicePhone() {
+ return R.ok(iCustomConfigService.getServicePhone());
+ }
+
+ /**
+ * 保存客服电话
+ *
+ * @param phone 客服电话
+ */
+ @ApiOperation("保存客服电话")
+ @PostMapping("/save-service-phone")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "phone", value = "客服电话", example = "18888888888", required = true)})
+ public R<?> servicePhone(@RequestParam(value = "phone", required = true) String phone) {
+ iCustomConfigService.updateServicePhone(phone);
+ return R.ok();
+ }
+
+ /**
+ * 删除客户电话
+ *
+ * @param phone 客服电话
+ */
+ @ApiOperation("删除客服电话")
+ @PostMapping("/delete-service-phone")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "phone", value = "客服电话", example = "18888888888", required = true)})
+ public R<?> deleteServicePhone(@RequestParam(value = "phone", required = true) String phone) {
+ iCustomConfigService.deleteServicePhone(phone);
+ return R.ok();
+ }
}
--
Gitblit v1.7.1