xuhy
2026-04-17 4edaaf570a2cd8af8a9c35694a46289cdf9278b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.xiaopeng.operation.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiaopeng.api.model.operation.XpSystemSetting;
import com.xiaopeng.common.core.constant.CacheConstants;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.controller.BaseController;
import com.xiaopeng.common.core.web.domain.AjaxResult;
import com.xiaopeng.common.redis.service.RedisService;
import com.xiaopeng.operation.service.XpSystemSettingService;
import com.xiaopeng.operation.vo.CustomerServicePhoneVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@Slf4j
@RestController
@RequestMapping("/api/v1/systemSetting")
@Api(tags = "管理后台-系统设置模块")
public class XpSystemSettingManagementController extends BaseController {
 
    // 系统设置实现类
    private final XpSystemSettingService xpSystemSettingService;
    private final RedisService redisService;
 
    public XpSystemSettingManagementController(XpSystemSettingService xpSystemSettingService, RedisService redisService) {
        this.xpSystemSettingService = xpSystemSettingService;
        this.redisService = redisService;
    }
 
 
    @GetMapping("/getSetting")
    @ApiOperation(value = "获取系统设置")
    public R<XpSystemSetting> getCustomerServicePhone() {
        XpSystemSetting systemSetting = xpSystemSettingService.getOne(new LambdaQueryWrapper<XpSystemSetting>()
                .isNotNull(XpSystemSetting::getId));
        return R.ok(systemSetting);
    }
    @GetMapping("/saveOrUpdateSetting")
    @ApiOperation(value = "保存或修改系统设置")
    public R saveOrUpdateSetting(@RequestBody XpSystemSetting xpSystemSetting) {
        xpSystemSettingService.saveOrUpdate(xpSystemSetting);
        return R.ok();
    }
 
 
 
}