driver-server/src/main/java/com/jwl/driver/server/controller/TdSysConfigController.java

64 lines
2.3 KiB
Java
Raw Normal View History

2023-08-11 11:51:09 +08:00
package com.jwl.driver.server.controller;
2023-08-13 00:46:18 +08:00
import cn.hutool.core.util.StrUtil;
2023-08-13 11:11:28 +08:00
import com.jwl.driver.server.entity.TdSysConfig;
2023-08-13 00:46:18 +08:00
import com.jwl.driver.server.response.BaseResponse;
import com.jwl.driver.server.service.ITdSysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
2023-08-11 11:51:09 +08:00
2023-08-13 00:46:18 +08:00
import java.util.Arrays;
import java.util.Map;
2023-08-11 11:51:09 +08:00
/**
* <p>
* ;
* </p>
*
* @author Automated procedures
* @since 2023-08-10
*/
2023-08-13 00:46:18 +08:00
@Api(tags = "字典值配置")
@RestController
@RequestMapping("/tdSysConfig")
@Slf4j
2023-08-11 11:51:09 +08:00
public class TdSysConfigController {
2023-08-13 00:46:18 +08:00
@Autowired
private ITdSysConfigService configService;
/**
* keycarTypeId,carTypeId-1
*/
@ApiOperation("根据配置key和carTypeId获取配置信息,配置与车型无关则carTypeId为-1")
@GetMapping(value = "/queryConfigByKey")
2023-08-13 11:11:28 +08:00
public BaseResponse queryConfigByKey(@RequestParam("configKey") String configKey, @RequestParam("carTypeId") Integer carTypeId) {
return BaseResponse.success(configService.queryConfigByKey(configKey, carTypeId));
2023-08-13 00:46:18 +08:00
}
/**
* keycarTypeId,carTypeId-1
*/
@ApiOperation("根据配置key获取配置值")
@GetMapping(value = "/queryConfigValueByKey")
2023-08-13 11:11:28 +08:00
public BaseResponse<String> queryConfigValueByKey(@RequestParam("configKey") String configKey, @RequestParam("carTypeId") Integer carTypeId) {
2023-08-13 00:46:18 +08:00
2023-08-13 11:11:28 +08:00
return BaseResponse.success(configService.queryConfigValueByKey(configKey, carTypeId));
2023-08-13 00:46:18 +08:00
}
2023-08-13 11:11:28 +08:00
/**
* keyscarTypeId,carTypeId-1
*/
@ApiOperation("根据配置keys和carTypeId获取配置信息,配置与车型无关则carTypeId为-1")
2023-08-13 16:42:33 +08:00
@GetMapping(value = "/queryConfigByKeys")
2023-08-13 11:11:28 +08:00
public BaseResponse<Map<String, TdSysConfig>> queryConfigByKeys(@RequestParam("configKeys") String configKeys, @RequestParam("carTypeId") Integer carTypeId) {
return BaseResponse.success(configService.queryConfigByKeys(Arrays.asList(configKeys.split(",")),carTypeId));
}
2023-08-11 11:51:09 +08:00
}