rev:修改返回状态码为字符串

This commit is contained in:
2023-06-14 09:46:18 +08:00
parent 76a83cd062
commit 93aa78505a
6 changed files with 51 additions and 7 deletions

View File

@@ -51,6 +51,16 @@ public class VehicleInfoController {
public ResponseEntity<Object> Shut_down(@RequestBody Map<String, String> whereJson) {
return new ResponseEntity<>(vehicleInfoService.Shut_down(whereJson), HttpStatus.OK);
}
@PostMapping("/queryControlStatus")
@Log("查询车辆控制按钮状态")
@ApiOperation("查询车辆控制按钮状态")
//@PreAuthorize("@el.check('sect:list')")
public ResponseEntity<Object> queryControlStatus(@RequestBody Map<String, String> whereJson) {
return new ResponseEntity<>(vehicleInfoService.queryControlStatus(whereJson), HttpStatus.OK);
}
@PostMapping("/skipStartPoint")
@Log("跳过起点")
@ApiOperation("跳过起点")
@@ -80,6 +90,9 @@ public class VehicleInfoController {
public ResponseEntity<Object> queryVehicleStatus(@RequestBody Map<String, String> whereJson) {
return new ResponseEntity<>(vehicleInfoService.queryVehicleStatus(whereJson), HttpStatus.OK);
}
@PostMapping("/querrySensor")
@Log("查询传感器状态")
@ApiOperation("查询传感器状态")

View File

@@ -58,6 +58,20 @@ public interface VehicleInfoService {
* @return Map<String, Object>
*/
Map<String, Object> queryVehicleStatus(Map<String, String> jsonObject);
/**
* 查询车辆控制按钮状态
*
* @param
* @return Map<String, Object>
*/
Map<String, Object> queryControlStatus(Map<String, String> jsonObject);
/**
* 查询传感器状态
*

View File

@@ -203,6 +203,17 @@ public class VehicleInfoServiceImpl implements VehicleInfoService{
return returnjo;
}
@Override
public Map<String,Object> queryControlStatus(Map<String,String> jsonObject) {
return null;
}
@Override
public Map<String,Object> querrySensor(Map<String,String> jsonObject) {
JSONObject returnjo = new JSONObject();

View File

@@ -7,7 +7,7 @@ package org.nl.common.utils.api;
* @date 2023-03-02
*/
public class CommonResult<T> {
private long code;
private String code;
private String desc;
private T result;
@@ -21,7 +21,7 @@ public class CommonResult<T> {
}
protected CommonResult(long status, String message, T data) {
protected CommonResult(String status, String message, T data) {
this.code = status;
this.desc = message;
this.result = data;
@@ -115,11 +115,11 @@ public class CommonResult<T> {
return new CommonResult<>(ResultCode.FORBIDDEN.getCode(), ResultCode.FORBIDDEN.getDesc(), data);
}
public long getCode() {
public String getCode() {
return code;
}
public void setCode(long status) {
public void setCode(String status) {
this.code = status;
}

View File

@@ -10,7 +10,7 @@ public interface IErrorCode{
/**
* 返回状态码
*/
long getCode();
String getCode();
/**
* 返回提示

View File

@@ -65,11 +65,17 @@ public enum ResultCode implements IErrorCode{
this.desc = desc;
}
// @Override
// public long getCode() {
// return code;
// }
@Override
public long getCode() {
return code;
public String getCode() {
return String.valueOf(code);
}
@Override
public String getDesc() {
return desc;