mitao
2024-06-18 675b45becc2aa467b09921a482a8945d3ba0dd6c
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomConfigController.java
@@ -10,6 +10,8 @@
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;
@@ -112,4 +114,43 @@
    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();
    }
}