Initial commit of secondary development sample code
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(path = "")
|
||||
public class AlertController {
|
||||
|
||||
|
||||
/**
|
||||
* 目标平台接收告警及告警图片
|
||||
*
|
||||
* @param alertMsg
|
||||
*/
|
||||
|
||||
@PostMapping(path = "/alert")
|
||||
public void getAlertMsg(@RequestBody AlertMsg alertMsg) {
|
||||
log.info("示例接收告警及告警图片:{}", alertMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 目标平台接收告警及告警视频
|
||||
*
|
||||
* @param alertVideo
|
||||
*/
|
||||
|
||||
@PostMapping(path = "/video")
|
||||
public void getAlertVideo(@RequestBody AlertVideo alertVideo) {
|
||||
log.info("示例接收告警及告警视频:{}", alertVideo);
|
||||
}
|
||||
|
||||
}
|
||||
21
快速接收设备告警/http-server-demo/http-server/java/AlertMsg.java
Normal file
21
快速接收设备告警/http-server-demo/http-server/java/AlertMsg.java
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class AlertMsg {
|
||||
private String id;
|
||||
@JsonProperty("alert_time")
|
||||
private Double alertTime;
|
||||
private Object device;
|
||||
private Object source;
|
||||
private Object alg;
|
||||
private String image;
|
||||
@JsonProperty("reserved_data")
|
||||
private Object reservedData;
|
||||
@JsonProperty("hazard_leve")
|
||||
private String hazardLeve;
|
||||
}
|
||||
19
快速接收设备告警/http-server-demo/http-server/java/AlertVideo.java
Normal file
19
快速接收设备告警/http-server-demo/http-server/java/AlertVideo.java
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class AlertVideo {
|
||||
private String id;
|
||||
@JsonProperty("alert_time")
|
||||
private Double alertTime;
|
||||
private Object device;
|
||||
private Object source;
|
||||
private Object alg;
|
||||
private String video;
|
||||
@JsonProperty("hazard_leve")
|
||||
private String hazardLeve;
|
||||
}
|
||||
Reference in New Issue
Block a user