Commit b1cd38ac by 黄小葱

打印错误提示,增加类型

1 parent 649a4130
......@@ -5,6 +5,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.DeviceStatusModel;
import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -26,7 +27,7 @@ public interface DeviceFeignService {
* @param sn
* @return
*/
@GetMapping(value = "/getDeviceBySn")
@GetMapping(value = "/getDeviceBySn", consumes = MediaType.APPLICATION_JSON_VALUE)
R<DeviceDTO> getDeviceBySn(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sn") String sn);
/**
......@@ -36,7 +37,7 @@ public interface DeviceFeignService {
* @param offlineTime
* @return
*/
@GetMapping(value = "/getDeviceStatusBySn")
@GetMapping(value = "/getDeviceStatusBySn", consumes = MediaType.APPLICATION_JSON_VALUE)
R<DeviceStatusModel> getDeviceStatusBySn(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sn") String sn, Long offlineTime);
/**
......@@ -45,6 +46,6 @@ public interface DeviceFeignService {
* @param sn 设备号
* @return
*/
@GetMapping(value = "/getDevicesTotalCount")
@GetMapping(value = "/getDevicesTotalCount", consumes = MediaType.APPLICATION_JSON_VALUE)
R getDevicesTotalCount(@RequestParam(value = "sn") String sn);
}
......@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.GpsLocation;
import cn.com.glsx.devicemonitor.api.feign.factory.GpsBsServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -34,7 +35,7 @@ import java.util.List;
public interface GpsBsService {
@GetMapping(value = "/devicemonitorinfo")
@GetMapping(value = "/devicemonitorinfo", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<DeviceLocationBo>> listDeviceMonitorInfo(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sns") String sns,
@NotBlank(message = "设备编码不能为空") @RequestParam(value = "deviceCode") String deviceCode);
......@@ -44,7 +45,7 @@ public interface GpsBsService {
* @param gpsBsLastBatchRequest
* @return
*/
@PostMapping(value = "/lastgpsbs/batch")
@PostMapping(value = "/lastgpsbs/batch", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsBsData>> getLastGpsBsBatch(@RequestBody GpsBsLastBatchRequest gpsBsLastBatchRequest);
/**
......@@ -54,7 +55,7 @@ public interface GpsBsService {
* @param deviceCode
* @return
*/
@GetMapping(value = "/single")
@GetMapping(value = "/single", consumes = MediaType.APPLICATION_JSON_VALUE)
R<GpsBsData> getLastGpsBsBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode);
/**
......@@ -64,7 +65,7 @@ public interface GpsBsService {
* @param deviceCode
* @return
*/
@GetMapping(value = "/single/history")
@GetMapping(value = "/single/history", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsLocation>> getLastGpsBsHistoryBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode,
@RequestParam(value = "startTime") String startTime, @RequestParam(value = "endTime") String endTime);
}
......@@ -17,19 +17,19 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
@Override
public R<DeviceDTO> getDeviceBySn(String sn) {
log.info("getDeviceBySn 熔断啦===", cause.getMessage());
log.info("getDeviceBySn 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
@Override
public R<DeviceStatusModel> getDeviceStatusBySn(String sn, Long offlineTime) {
log.info("getDeviceStatusBySn 熔断啦===", cause.getMessage());
log.info("getDeviceStatusBySn 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
@Override
public R getDevicesTotalCount(String sn) {
log.info("getDevicesTotalCount 熔断啦===", cause.getMessage());
log.info("getDevicesTotalCount 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
}
......@@ -44,25 +44,25 @@ public class GpsBsServiceFallbackImpl implements GpsBsService {
@Override
public R<List<DeviceLocationBo>> listDeviceMonitorInfo(String sns, String deviceCode) {
log.info("listDeviceMonitorInfo 熔断啦===", cause.getMessage());
log.info("listDeviceMonitorInfo 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
@Override
public R getLastGpsBsBatch(GpsBsLastBatchRequest gpsBsLastBatchRequest) {
log.info("getLastGpsBsBatch 熔断啦===", cause.getMessage());
log.info("getLastGpsBsBatch 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
@Override
public R getLastGpsBsBySn(String sn, String deviceCode) {
log.info("getLastGpsBsBySn 熔断啦===", cause.getMessage());
log.info("getLastGpsBsBySn 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
@Override
public R getLastGpsBsHistoryBySn(String sn, String deviceCode, String startTime, String endTime) {
log.info("getLastGpsBsHistoryBySn 熔断啦===", cause.getMessage());
log.info("getLastGpsBsHistoryBySn 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!