package com.supersavedriving.driver.modular.system.api;
|
|
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONObject;
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
import com.supersavedriving.driver.core.common.annotion.ServiceLog;
|
import com.supersavedriving.driver.modular.system.model.SystemConfig;
|
import com.supersavedriving.driver.modular.system.service.ISystemConfigService;
|
import com.supersavedriving.driver.modular.system.warpper.ResponseWarpper;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* 系统配置
|
* @author pzb
|
* @Date 2023/2/25 11:53
|
*/
|
@RestController
|
@RequestMapping("")
|
public class SystemConfigController {
|
|
@Autowired
|
private ISystemConfigService systemConfigService;
|
|
|
|
|
@ResponseBody
|
@PostMapping("/base/config/queryTransferOrderConfig")
|
// @ServiceLog(name = "获取转单提醒时间配置", url = "/base/config/queryTransferOrderConfig")
|
@ApiOperation(value = "获取转单提醒时间配置", tags = {"司机端-服务中"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
|
})
|
public ResponseWarpper<Integer> queryTransferOrderConfig(){
|
try {
|
SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 1));
|
JSONObject jsonObject = JSON.parseObject(systemConfig.getContent());
|
Integer num5 = jsonObject.getInteger("num5");
|
return ResponseWarpper.success(num5);
|
}catch (Exception e){
|
e.printStackTrace();
|
return new ResponseWarpper(500, e.getMessage());
|
}
|
}
|
}
|