1
luofl
2025-03-10 c0af9ff203bac44bcb7bcbebb83fe124ada2d942
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java
@@ -8,10 +8,13 @@
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.RefundOfDepositVO;
import com.ruoyi.system.domain.vo.WishSettingVO;
import com.ruoyi.system.service.ICustomConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
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;
@@ -29,6 +32,7 @@
 * @author mitao
 * @since 2024-05-21
 */
@Validated
@RestController
@RequestMapping("/custom-config")
@Api(value = "系统配置接口", tags = "系统配置接口")
@@ -36,6 +40,9 @@
    @Resource
    private ICustomConfigService iCustomConfigService;
    @GetMapping(value = "/{configId}")
    @ApiOperation("获取配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "configId", value = "配置键", required = true)})
    public R<CustomConfig> getconfig(@PathVariable String configId)
    {
        LambdaQueryWrapper<CustomConfig> wrapper = Wrappers.lambdaQuery();
@@ -112,4 +119,87 @@
    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();
    }
    /**
     * 获取保证金退还文案
     */
    @ApiOperation("获取保证金退还文案")
    @GetMapping("/refund-of-deposit")
    public R<String> getRefundOfDeposit() {
        return R.ok(iCustomConfigService.getRefundOfDeposit());
    }
    /**
     * 保存保证金退还设置
     */
    @ApiOperation(value = "保存保证金退还设置")
    @PostMapping("/save-refund-of-deposit")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "refundOfDeposit", value = "保证金退还文案", required = true)})
    public R<?> saveRefundOfDeposit(@RequestBody RefundOfDepositVO refundOfDepositVO) {
        iCustomConfigService.saveRefundOfDeposit(refundOfDepositVO.getRefundOfDeposit());
        return R.ok();
    }
}