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;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -31,7 +32,7 @@ public interface DeviceFeignService {
* @param deviceBOList
* @return
*/
@PostMapping(value = "/batchAdd")
@PostMapping(value = "/batchAdd", consumes = MediaType.APPLICATION_JSON_VALUE)
public R batchAdd(@RequestBody List<DeviceBO> deviceBOList);
/**
......@@ -40,7 +41,7 @@ public interface DeviceFeignService {
* @param sn
* @return
*/
@GetMapping(value = "/getDeviceBySn")
@GetMapping(value = "/getDeviceBySn", consumes = MediaType.APPLICATION_JSON_VALUE)
R<DeviceDTO> getDeviceBySn(@RequestParam(value = "sn") String sn);
/**
......@@ -50,7 +51,7 @@ public interface DeviceFeignService {
* @param storeIfNotExists
* @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);
/**
......@@ -60,7 +61,7 @@ public interface DeviceFeignService {
* @param offlineTime 单位毫秒
* @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);
/**
......@@ -69,7 +70,7 @@ public interface DeviceFeignService {
* @param deviceSearchDTO 查询实体
* @return
*/
@PostMapping(value = "listDeviceStatusBySns")
@PostMapping(value = "listDeviceStatusBySns", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<DeviceStatusModel>> listDeviceStatusBySns(@RequestBody DeviceSearchDTO deviceSearchDTO);
/**
......@@ -78,7 +79,7 @@ public interface DeviceFeignService {
* @param sn 设备号
* @return
*/
@GetMapping(value = "/getDevicesTotalCount")
@GetMapping(value = "/getDevicesTotalCount", consumes = MediaType.APPLICATION_JSON_VALUE)
R getDevicesTotalCount(@RequestParam(value = "sn") String sn);
}
......@@ -37,7 +37,7 @@ import java.util.Map;
fallbackFactory = GpsBsServiceFallbackFactory.class, decode404 = true)
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);
/**
......@@ -55,7 +55,7 @@ public interface GpsBsFeignService {
* @param gpsBsFirstBatchRequestList
* @return
*/
@PostMapping(value = "/firstgpsbs/batch")
@PostMapping(value = "/firstgpsbs/batch", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsBsData>> getFirstGpsBsBatch(@RequestBody List<GpsBsFirstBatchRequest> gpsBsFirstBatchRequestList);
/**
......@@ -74,7 +74,7 @@ public interface GpsBsFeignService {
* @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);
......@@ -84,7 +84,7 @@ public interface GpsBsFeignService {
* @param snsMap
* @return
*/
@GetMapping(value = "/batch")
@GetMapping(value = "/batch", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsBsData>> getLastGpsBsBySns(@RequestBody Map<String, Integer> snsMap);
/**
......@@ -93,7 +93,7 @@ public interface GpsBsFeignService {
* @param request
* @return
*/
@GetMapping(value = "/single/history")
@GetMapping(value = "/single/history", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<GpsLocation>> getLastGpsBsHistoryBySn(LocationHistoryRequest request);
/**
......@@ -103,7 +103,7 @@ public interface GpsBsFeignService {
* @param lat 纬度
* @return 地址
*/
@GetMapping(value = "/getAddressByLngAndLat")
@GetMapping(value = "/getAddressByLngAndLat", consumes = MediaType.APPLICATION_JSON_VALUE)
R<String> getAddressByLngAndLat(@RequestParam String lng, @RequestParam String lat);
/**
......@@ -115,6 +115,7 @@ public interface GpsBsFeignService {
* @param alarmEndTime 报警结束时间
* @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);
}
......@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.JourneyDetailDTO;
import cn.com.glsx.devicemonitor.api.feign.factory.MileFeignServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -26,7 +27,7 @@ public interface MileFeignService {
* @param journeyDetailRequest
* @return
*/
@PostMapping(value = "/getdevicedetailmileagelist")
@PostMapping(value = "/getdevicedetailmileagelist", consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
R<List<JourneyDetailDTO>> getDeviceDetailMileageList(@RequestBody JourneyDetailRequest journeyDetailRequest);
......@@ -36,7 +37,7 @@ public interface MileFeignService {
* @param journeyDailyRequest
* @return
*/
@PostMapping(value = "/getdailyjourneyrecords")
@PostMapping(value = "/getdailyjourneyrecords", consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
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!