puzhibing
2023-05-22 c588d0fb5d7b61611b13911e4f0b65e760a7e862
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
package com.agentdriving.driver.modular.system.api;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.agentdriving.driver.modular.system.model.SystemConfig;
import com.agentdriving.driver.modular.system.service.ISystemConfigService;
import com.agentdriving.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());
        }
    }
}