feat(trajectory): 新增轨迹检测与 Beacon 注册表
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.viewsh.module.iot.api.trajectory;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 设备实时位置 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "RPC - 设备实时位置")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceLocationDTO {
|
||||
|
||||
@Schema(description = "设备ID", example = "31")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "当前所在区域ID", example = "1301")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "进入时间(毫秒时间戳)", example = "1711872600000")
|
||||
private Long enterTime;
|
||||
|
||||
@Schema(description = "匹配的Beacon MAC", example = "F0:C8:60:1D:10:BB")
|
||||
private String beaconMac;
|
||||
|
||||
@Schema(description = "是否在某区域内")
|
||||
private Boolean inArea;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.viewsh.module.iot.api.trajectory;
|
||||
|
||||
import com.viewsh.framework.common.pojo.CommonResult;
|
||||
import com.viewsh.module.iot.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 轨迹实时状态 API
|
||||
* <p>
|
||||
* 提供 RPC 接口供 Ops 模块查询设备当前位置
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 轨迹实时状态")
|
||||
public interface TrajectoryStateApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/trajectory";
|
||||
|
||||
@GetMapping(PREFIX + "/current-location")
|
||||
@Operation(summary = "查询设备当前位置")
|
||||
CommonResult<DeviceLocationDTO> getCurrentLocation(
|
||||
@Parameter(description = "设备ID", required = true, example = "31")
|
||||
@RequestParam("deviceId") Long deviceId);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user