feat: 根据租户获取景区二维码内容
This commit is contained in:
+18
@@ -7,6 +7,7 @@ import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.device.model.AgeDevice;
|
||||
import com.central.device.model.excel.AgeDeviceExcel;
|
||||
import com.central.device.model.vo.AgeDeviceLocationVO;
|
||||
import com.central.device.service.IAgeDeviceService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -90,6 +91,23 @@ public class AgeDeviceController {
|
||||
return Result.succeed("删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "根据设备SN获取设备经纬度")
|
||||
@GetMapping("/location/{deviceSn}")
|
||||
public Result<AgeDeviceLocationVO> getLocationByDeviceSn(@PathVariable String deviceSn) {
|
||||
if (deviceSn == null || deviceSn.trim().isEmpty()) {
|
||||
return Result.failed("deviceSn不能为空");
|
||||
}
|
||||
AgeDevice device = ageDeviceService.getByDeviceSn(deviceSn);
|
||||
if (device == null) {
|
||||
return Result.succeed(null, "暂无数据");
|
||||
}
|
||||
AgeDeviceLocationVO vo = new AgeDeviceLocationVO();
|
||||
vo.setDeviceSn(deviceSn);
|
||||
vo.setLongitude(device.getLongitude());
|
||||
vo.setLatitude(device.getLatitude());
|
||||
return Result.succeed(vo, "查询成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备信息
|
||||
*/
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.central.device.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备经纬度信息
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "设备经纬度信息")
|
||||
public class AgeDeviceLocationVO {
|
||||
|
||||
@Schema(description = "设备SN")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private Double longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private Double latitude;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user