Commit d38373cb by levphon

接口加上, consumes = MediaType.APPLICATION_JSON_VALUE,防止上传文件type传递

1 parent 118b7b98
...@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.DeviceStatusModel; ...@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.DeviceStatusModel;
import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory; import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -31,7 +32,7 @@ public interface DeviceFeignService { ...@@ -31,7 +32,7 @@ public interface DeviceFeignService {
* @param deviceBOList * @param deviceBOList
* @return * @return
*/ */
@PostMapping(value = "/batchAdd") @PostMapping(value = "/batchAdd", consumes = MediaType.APPLICATION_JSON_VALUE)
public R batchAdd(@RequestBody List<DeviceBO> deviceBOList); public R batchAdd(@RequestBody List<DeviceBO> deviceBOList);
/** /**
...@@ -40,7 +41,7 @@ public interface DeviceFeignService { ...@@ -40,7 +41,7 @@ public interface DeviceFeignService {
* @param sn * @param sn
* @return * @return
*/ */
@GetMapping(value = "/getDeviceBySn") @GetMapping(value = "/getDeviceBySn", consumes = MediaType.APPLICATION_JSON_VALUE)
R<DeviceDTO> getDeviceBySn(@RequestParam(value = "sn") String sn); R<DeviceDTO> getDeviceBySn(@RequestParam(value = "sn") String sn);
/** /**
...@@ -50,7 +51,7 @@ public interface DeviceFeignService { ...@@ -50,7 +51,7 @@ public interface DeviceFeignService {
* @param storeIfNotExists * @param storeIfNotExists
* @return * @return
*/ */
@GetMapping(value = "/getOrStoreDeviceBySn") @GetMapping(value = "/getOrStoreDeviceBySn", consumes = MediaType.APPLICATION_JSON_VALUE)
R<DeviceDTO> getOrStoreDeviceBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "storeIfNotExists") Boolean storeIfNotExists); R<DeviceDTO> getOrStoreDeviceBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "storeIfNotExists") Boolean storeIfNotExists);
/** /**
...@@ -60,7 +61,7 @@ public interface DeviceFeignService { ...@@ -60,7 +61,7 @@ public interface DeviceFeignService {
* @param offlineTime 单位毫秒 * @param offlineTime 单位毫秒
* @return * @return
*/ */
@GetMapping(value = "/getDeviceStatusBySn") @GetMapping(value = "/getDeviceStatusBySn", consumes = MediaType.APPLICATION_JSON_VALUE)
R<DeviceStatusModel> getDeviceStatusBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "offlineTime", required = false) Long offlineTime); R<DeviceStatusModel> getDeviceStatusBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "offlineTime", required = false) Long offlineTime);
/** /**
...@@ -69,7 +70,7 @@ public interface DeviceFeignService { ...@@ -69,7 +70,7 @@ public interface DeviceFeignService {
* @param deviceSearchDTO 查询实体 * @param deviceSearchDTO 查询实体
* @return * @return
*/ */
@PostMapping(value = "listDeviceStatusBySns") @PostMapping(value = "listDeviceStatusBySns", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<DeviceStatusModel>> listDeviceStatusBySns(@RequestBody DeviceSearchDTO deviceSearchDTO); R<List<DeviceStatusModel>> listDeviceStatusBySns(@RequestBody DeviceSearchDTO deviceSearchDTO);
/** /**
...@@ -78,7 +79,7 @@ public interface DeviceFeignService { ...@@ -78,7 +79,7 @@ public interface DeviceFeignService {
* @param sn 设备号 * @param sn 设备号
* @return * @return
*/ */
@GetMapping(value = "/getDevicesTotalCount") @GetMapping(value = "/getDevicesTotalCount", consumes = MediaType.APPLICATION_JSON_VALUE)
R getDevicesTotalCount(@RequestParam(value = "sn") String sn); R getDevicesTotalCount(@RequestParam(value = "sn") String sn);
} }
...@@ -37,7 +37,7 @@ import java.util.Map; ...@@ -37,7 +37,7 @@ import java.util.Map;
fallbackFactory = GpsBsServiceFallbackFactory.class, decode404 = true) fallbackFactory = GpsBsServiceFallbackFactory.class, decode404 = true)
public interface GpsBsFeignService { public interface GpsBsFeignService {
@GetMapping(value = "/devicemonitorinfo") @GetMapping(value = "/devicemonitorinfo", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<DeviceLocationDTO>> listDeviceMonitorInfo(@RequestParam(value = "sns") String sns, @RequestParam(value = "deviceCode") String deviceCode); R<List<DeviceLocationDTO>> listDeviceMonitorInfo(@RequestParam(value = "sns") String sns, @RequestParam(value = "deviceCode") String deviceCode);
/** /**
...@@ -55,7 +55,7 @@ public interface GpsBsFeignService { ...@@ -55,7 +55,7 @@ public interface GpsBsFeignService {
* @param gpsBsFirstBatchRequestList * @param gpsBsFirstBatchRequestList
* @return * @return
*/ */
@PostMapping(value = "/firstgpsbs/batch") @PostMapping(value = "/firstgpsbs/batch", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsBsData>> getFirstGpsBsBatch(@RequestBody List<GpsBsFirstBatchRequest> gpsBsFirstBatchRequestList); R<List<GpsBsData>> getFirstGpsBsBatch(@RequestBody List<GpsBsFirstBatchRequest> gpsBsFirstBatchRequestList);
/** /**
...@@ -74,7 +74,7 @@ public interface GpsBsFeignService { ...@@ -74,7 +74,7 @@ public interface GpsBsFeignService {
* @param deviceCode * @param deviceCode
* @return * @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); R<GpsBsData> getLastGpsBsBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode);
...@@ -84,7 +84,7 @@ public interface GpsBsFeignService { ...@@ -84,7 +84,7 @@ public interface GpsBsFeignService {
* @param snsMap * @param snsMap
* @return * @return
*/ */
@GetMapping(value = "/batch") @GetMapping(value = "/batch", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsBsData>> getLastGpsBsBySns(@RequestBody Map<String, Integer> snsMap); R<List<GpsBsData>> getLastGpsBsBySns(@RequestBody Map<String, Integer> snsMap);
/** /**
...@@ -93,7 +93,7 @@ public interface GpsBsFeignService { ...@@ -93,7 +93,7 @@ public interface GpsBsFeignService {
* @param request * @param request
* @return * @return
*/ */
@GetMapping(value = "/single/history") @GetMapping(value = "/single/history", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsLocation>> getLastGpsBsHistoryBySn(LocationHistoryRequest request); R<List<GpsLocation>> getLastGpsBsHistoryBySn(LocationHistoryRequest request);
/** /**
...@@ -103,7 +103,7 @@ public interface GpsBsFeignService { ...@@ -103,7 +103,7 @@ public interface GpsBsFeignService {
* @param lat 纬度 * @param lat 纬度
* @return 地址 * @return 地址
*/ */
@GetMapping(value = "/getAddressByLngAndLat") @GetMapping(value = "/getAddressByLngAndLat", consumes = MediaType.APPLICATION_JSON_VALUE)
R<String> getAddressByLngAndLat(@RequestParam String lng, @RequestParam String lat); R<String> getAddressByLngAndLat(@RequestParam String lng, @RequestParam String lat);
/** /**
...@@ -115,6 +115,7 @@ public interface GpsBsFeignService { ...@@ -115,6 +115,7 @@ public interface GpsBsFeignService {
* @param alarmEndTime 报警结束时间 * @param alarmEndTime 报警结束时间
* @return 定位数据 * @return 定位数据
*/ */
@GetMapping(value = "/getLocationOfAlarmTime") @GetMapping(value = "/getLocationOfAlarmTime", consumes = MediaType.APPLICATION_JSON_VALUE)
R<GpsBsData> getLocationOfAlarmTime(@RequestParam String sn, @RequestParam String deviceCode, @RequestParam String alarmStartTime, @RequestParam String alarmEndTime); R<GpsBsData> getLocationOfAlarmTime(@RequestParam String sn, @RequestParam String deviceCode, @RequestParam String alarmStartTime, @RequestParam String alarmEndTime);
} }
...@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.JourneyDetailDTO; ...@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.JourneyDetailDTO;
import cn.com.glsx.devicemonitor.api.feign.factory.MileFeignServiceFallbackFactory; import cn.com.glsx.devicemonitor.api.feign.factory.MileFeignServiceFallbackFactory;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -26,7 +27,7 @@ public interface MileFeignService { ...@@ -26,7 +27,7 @@ public interface MileFeignService {
* @param journeyDetailRequest * @param journeyDetailRequest
* @return * @return
*/ */
@PostMapping(value = "/getdevicedetailmileagelist") @PostMapping(value = "/getdevicedetailmileagelist", consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody
R<List<JourneyDetailDTO>> getDeviceDetailMileageList(@RequestBody JourneyDetailRequest journeyDetailRequest); R<List<JourneyDetailDTO>> getDeviceDetailMileageList(@RequestBody JourneyDetailRequest journeyDetailRequest);
...@@ -36,7 +37,7 @@ public interface MileFeignService { ...@@ -36,7 +37,7 @@ public interface MileFeignService {
* @param journeyDailyRequest * @param journeyDailyRequest
* @return * @return
*/ */
@PostMapping(value = "/getdailyjourneyrecords") @PostMapping(value = "/getdailyjourneyrecords", consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody
R<List<JourneyDailyDTO>> getDailyJourneyRecords(@RequestBody JourneyDailyRequest journeyDailyRequest); R<List<JourneyDailyDTO>> getDailyJourneyRecords(@RequestBody JourneyDailyRequest journeyDailyRequest);
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!