From 01d6fa48a0de7a21988e89f71721b6b85e53b517 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期四, 06 三月 2025 16:33:53 +0800
Subject: [PATCH] 去掉资讯图片必填限制

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java |   96 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 94 insertions(+), 2 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 544f024..71872ff 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
@@ -5,12 +5,17 @@
 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.domain.vo.WishSettingVO;
 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 java.util.List;
 import javax.annotation.Resource;
+import javax.validation.Valid;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -28,8 +33,10 @@
  * @author mitao
  * @since 2024-05-21
  */
+@Validated
 @RestController
 @RequestMapping("/custom-config")
+@Api(value = "系统配置接口", tags = "系统配置接口")
 public class CustomConfigController {
     @Resource
     private ICustomConfigService iCustomConfigService;
@@ -49,7 +56,7 @@
      */
     @ApiOperation("获取积分设置")
     @GetMapping("/points")
-    public R<List<CustomConfigVO>> getPointsConfig() {
+    public R<PointsConfigDTO> getPointsConfig() {
         return R.ok(iCustomConfigService.getPointsConfig());
     }
     /**
@@ -87,4 +94,89 @@
         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();
+    }
+
+    /**
+     * 获取心愿求购说明
+     *
+     * @return
+     */
+    @ApiOperation("获取心愿求购说明、分享配置")
+    @GetMapping("/wish-setting")
+    public R<WishSettingVO> getWishSetting() {
+        return R.ok(iCustomConfigService.getWishSetting());
+    }
+
+    /**
+     * 保存心愿求购设置
+     *
+     * @param vo 保存心愿求购设置
+     */
+    @ApiOperation(value = "保存心愿设置")
+    @PostMapping("/save-wish-setting")
+    public R<?> saveWishDescription(@Valid @RequestBody WishSettingVO vo) {
+        iCustomConfigService.saveWishDescription(vo);
+        return R.ok();
+    }
 }

--
Gitblit v1.7.1