package com.xiaopeng.operation.controller;
|
|
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.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@Slf4j
|
@RestController
|
@RequestMapping("")
|
@Api(tags = "系统设置模块")
|
public class XpSystemSettingController extends BaseController {
|
|
// 系统设置实现类
|
private final XpSystemSettingService xpSystemSettingService;
|
private final RedisService redisService;
|
|
public XpSystemSettingController(XpSystemSettingService xpSystemSettingService, RedisService redisService) {
|
this.xpSystemSettingService = xpSystemSettingService;
|
this.redisService = redisService;
|
}
|
|
|
@GetMapping("/base/v1/mini-program/support/phone")
|
@ApiOperation(value = "获取客服电话",tags = {"小程序首页"},response = String.class)
|
public AjaxResult<CustomerServicePhoneVo> getCustomerServicePhone() {
|
Object customerServicePhone = redisService.getCacheObject(CacheConstants.CUSTOMER_SERVICE_PHONE);
|
if(customerServicePhone!=null){
|
return success(new CustomerServicePhoneVo(customerServicePhone.toString()));
|
}else {
|
return success(new CustomerServicePhoneVo(xpSystemSettingService.getCustomerServicePhone()));
|
}
|
}
|
|
|
// @GetMapping("/support/getOrderDistance")
|
// @ApiOperation(value = "获取下单距离",tags = {"小程序首页-服务调用获取下单距离"},response = Integer.class)
|
// public AjaxResult<Integer> getOrderDistance() {
|
// return success(xpSystemSettingService.getOrderDistance());
|
// }
|
|
|
@GetMapping("/base/v1/mini-program/support/getOrderDistance")
|
@ApiOperation(value = "获取下单距离",tags = {"小程序首页-服务调用获取下单距离"},response = Integer.class)
|
public R getOrderDistance() {
|
return R.ok(xpSystemSettingService.getOrderDistance());
|
}
|
|
@ApiOperation(value = "获取自动结束行程时间",tags = {"小程序-业务流程"},response = Integer.class)
|
@GetMapping("/api/v1/mini-program/support/getOrderFinishTime")
|
public R<Integer> getOrderFinishTime() {
|
return R.ok(xpSystemSettingService.getOrderFinishTime());
|
}
|
|
@GetMapping("/base/v1/support/phone")
|
@ApiOperation(value = "获取客服电话", tags = {"运维APP-个人中心"}, response = String.class)
|
public R<CustomerServicePhoneVo> getCustomerPhone() {
|
Object customerServicePhone = redisService.getCacheObject(CacheConstants.CUSTOMER_SERVICE_PHONE);
|
if (customerServicePhone != null) {
|
return R.ok(new CustomerServicePhoneVo(customerServicePhone.toString()));
|
} else {
|
return R.ok(new CustomerServicePhoneVo(xpSystemSettingService.getCustomerServicePhone()));
|
}
|
}
|
}
|