feat: 初始化
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>edu-card-server</artifactId>
|
||||
<groupId>com.yida.data.server</groupId>
|
||||
<version>2.2-RELEASE</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>edu-card-server-api</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DisturbDTO {
|
||||
|
||||
private String imei;
|
||||
|
||||
@ApiModelProperty("时间组数量 最多10组")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private List<LocalTime> startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private List<LocalTime> endTime;
|
||||
|
||||
@ApiModelProperty("每组日期,7位数字,0-不生效,1-生效 例:1110000 周一-周三生效")
|
||||
private List<String> weekFlag;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FenceDTO {
|
||||
|
||||
@ApiModelProperty("imei号")
|
||||
private String imei;
|
||||
|
||||
@ApiModelProperty("围栏id,1-3")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("围栏类型,0-圆形,1-多边形")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("多边形点数,3-20")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
private List<Double> lng;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
private List<Double> lat;
|
||||
|
||||
@ApiModelProperty("半径 0-9999 0为删除围栏")
|
||||
private Integer radius;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 白名单参数
|
||||
*/
|
||||
@Data
|
||||
public class WhiteListDTO {
|
||||
|
||||
private String imei;
|
||||
|
||||
private List<String> mobiles;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("810A接收参数父类")
|
||||
@Data
|
||||
public class _810ABaseMsg {
|
||||
|
||||
@JsonProperty("KEY")
|
||||
private String KEY;
|
||||
|
||||
@JsonProperty("SIGN")
|
||||
private String SIGN;
|
||||
|
||||
@JsonProperty("TIMESTAMP")
|
||||
private String TIMESTAMP;
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel("设备脱落")
|
||||
@Data
|
||||
public class _810ADeviceStaticDTO extends _810ABaseMsg {
|
||||
|
||||
@ApiModelProperty("当前电量")
|
||||
@JsonProperty("BAT")
|
||||
private Integer BAT;
|
||||
|
||||
@ApiModelProperty("设备号")
|
||||
@JsonProperty("DEVICENUM")
|
||||
private String DEVICENUM;
|
||||
|
||||
@ApiModelProperty("当前参与定位的卫星数量")
|
||||
@JsonProperty("GPS")
|
||||
private Integer GPS;
|
||||
|
||||
@ApiModelProperty("当前网络信号值")
|
||||
@JsonProperty("GSM")
|
||||
private Integer GSM;
|
||||
|
||||
|
||||
@ApiModelProperty("设备在离线状态;1:在线;0:离线")
|
||||
@JsonProperty("ISONLINE")
|
||||
private Integer ISONLINE;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
@JsonProperty("LA")
|
||||
private Double LA;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
@JsonProperty("LO")
|
||||
private Double LO;
|
||||
|
||||
@ApiModelProperty("定位时间")
|
||||
@JsonProperty("LOCTIME")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime LOCTIME;
|
||||
|
||||
@ApiModelProperty("位置描述")
|
||||
@JsonProperty("POSDESC")
|
||||
private String POSDESC;
|
||||
|
||||
@ApiModelProperty("定位类型;取值说明:0GPS 定位;1 基站定位;2 修正定位")
|
||||
@JsonProperty("TYPE")
|
||||
private Integer TYPE;
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel("810A学生证带定位信息")
|
||||
@Data
|
||||
public class _810ALocationDTO extends _810ABaseMsg {
|
||||
|
||||
@ApiModelProperty("当前电量")
|
||||
@JsonProperty("BAT")
|
||||
private Integer BAT;
|
||||
|
||||
@ApiModelProperty("设备号")
|
||||
@JsonProperty("DEVICENUM")
|
||||
private String DEVICENUM;
|
||||
|
||||
@ApiModelProperty("当前参与定位的卫星数量")
|
||||
@JsonProperty("GPS")
|
||||
private Integer GPS;
|
||||
|
||||
@ApiModelProperty("当前网络信号值")
|
||||
@JsonProperty("GSM")
|
||||
private Integer GSM;
|
||||
|
||||
|
||||
@ApiModelProperty("设备在离线状态;1:在线;0:离线")
|
||||
@JsonProperty("ISONLINE")
|
||||
private Integer ISONLINE;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
@JsonProperty("LA")
|
||||
private Double LA;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
@JsonProperty("LO")
|
||||
private Double LO;
|
||||
|
||||
@ApiModelProperty("定位时间")
|
||||
@JsonProperty("LOCTIME")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime LOCTIME;
|
||||
|
||||
@ApiModelProperty("位置描述")
|
||||
@JsonProperty("POSDESC")
|
||||
private String POSDESC;
|
||||
|
||||
@ApiModelProperty("速度")
|
||||
@JsonProperty("SPEED")
|
||||
private Integer SPEED;
|
||||
|
||||
@ApiModelProperty("定位类型;取值说明:0GPS 定位;1 基站定位;2 修正定位")
|
||||
@JsonProperty("TYPE")
|
||||
private Integer TYPE;
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel("低电量")
|
||||
@Data
|
||||
public class _810ALowBatDTO extends _810ABaseMsg {
|
||||
|
||||
@ApiModelProperty("当前电量")
|
||||
@JsonProperty("BAT")
|
||||
private Integer BAT;
|
||||
|
||||
@ApiModelProperty("设备号")
|
||||
@JsonProperty("DEVICENUM")
|
||||
private String DEVICENUM;
|
||||
|
||||
@ApiModelProperty("当前参与定位的卫星数量")
|
||||
@JsonProperty("GPS")
|
||||
private Integer GPS;
|
||||
|
||||
@ApiModelProperty("当前网络信号值")
|
||||
@JsonProperty("GSM")
|
||||
private Integer GSM;
|
||||
|
||||
|
||||
@ApiModelProperty("设备在离线状态;1:在线;0:离线")
|
||||
@JsonProperty("ISONLINE")
|
||||
private Integer ISONLINE;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
@JsonProperty("LA")
|
||||
private Double LA;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
@JsonProperty("LO")
|
||||
private Double LO;
|
||||
|
||||
@ApiModelProperty("定位时间")
|
||||
@JsonProperty("LOCTIME")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime LOCTIME;
|
||||
|
||||
@ApiModelProperty("位置描述")
|
||||
@JsonProperty("POSDESC")
|
||||
private String POSDESC;
|
||||
|
||||
@ApiModelProperty("速度")
|
||||
@JsonProperty("SPEED")
|
||||
private Integer SPEED;
|
||||
|
||||
@ApiModelProperty("定位类型;取值说明:0GPS 定位;1 基站定位;2 修正定位")
|
||||
@JsonProperty("TYPE")
|
||||
private Integer TYPE;
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel("危险区域")
|
||||
@Data
|
||||
public class _810ARiskAreaDTO extends _810ABaseMsg {
|
||||
|
||||
@ApiModelProperty("当前电量")
|
||||
@JsonProperty("BAT")
|
||||
private Integer BAT;
|
||||
|
||||
@ApiModelProperty("设备号")
|
||||
@JsonProperty("DEVICENUM")
|
||||
private String DEVICENUM;
|
||||
|
||||
@ApiModelProperty("当前参与定位的卫星数量")
|
||||
@JsonProperty("GPS")
|
||||
private Integer GPS;
|
||||
|
||||
@ApiModelProperty("当前网络信号值")
|
||||
@JsonProperty("GSM")
|
||||
private Integer GSM;
|
||||
|
||||
|
||||
@ApiModelProperty("设备在离线状态;1:在线;0:离线")
|
||||
@JsonProperty("ISONLINE")
|
||||
private Integer ISONLINE;
|
||||
|
||||
@ApiModelProperty("纬度")
|
||||
@JsonProperty("LA")
|
||||
private Double LA;
|
||||
|
||||
@ApiModelProperty("经度")
|
||||
@JsonProperty("LO")
|
||||
private Double LO;
|
||||
|
||||
@ApiModelProperty("定位时间")
|
||||
@JsonProperty("LOCTIME")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime LOCTIME;
|
||||
|
||||
@ApiModelProperty("位置描述")
|
||||
@JsonProperty("POSDESC")
|
||||
private String POSDESC;
|
||||
|
||||
@ApiModelProperty("速度")
|
||||
@JsonProperty("SPEED")
|
||||
private Integer SPEED;
|
||||
|
||||
@ApiModelProperty("定位类型;取值说明:0GPS 定位;1 基站定位;2 修正定位")
|
||||
@JsonProperty("TYPE")
|
||||
private Integer TYPE;
|
||||
|
||||
@ApiModelProperty("告警类型0-出,1-进,2-禁足,3-可疑,4-危险区域")
|
||||
@JsonProperty("FENCETYPE")
|
||||
private Integer FENCETYPE;
|
||||
|
||||
@ApiModelProperty("禁足区域")
|
||||
@JsonProperty("REMARK")
|
||||
private String REMARK;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.yida.data.server.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@ApiModel("810A学生证步数")
|
||||
@Data
|
||||
public class _810AStepDTO extends _810ABaseMsg {
|
||||
|
||||
@ApiModelProperty("imei")
|
||||
@JsonProperty("DEVICENUM")
|
||||
private String DEVICENUM;
|
||||
|
||||
@ApiModelProperty("步数")
|
||||
@JsonProperty("STEPS")
|
||||
private Integer STEPS;
|
||||
|
||||
@ApiModelProperty("定位时间")
|
||||
@JsonProperty("TIME")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime TIME;
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.yida.data.server.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.server.dto.DisturbDTO;
|
||||
import com.yida.data.server.dto.WhiteListDTO;
|
||||
import com.yida.data.server.feign.RemoteCardOperationService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteCardOperationService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/8/26
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteCardOperationServiceFallback implements FallbackFactory<RemoteCardOperationService> {
|
||||
|
||||
@Override
|
||||
public RemoteCardOperationService create(Throwable throwable) {
|
||||
log.error("RemoteCardOperationService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteCardOperationService() {
|
||||
/**
|
||||
* 更新白名单
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean whiteList(WhiteListDTO dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新免打扰设置
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean disturbTime(DisturbDTO dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 立即定位
|
||||
*
|
||||
* @param imei
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean nowLocation(String imei) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.yida.data.server.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.server.dto.DisturbDTO;
|
||||
import com.yida.data.server.dto.WhiteListDTO;
|
||||
import com.yida.data.server.fallback.RemoteCardOperationServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.EDU_CARD_SERVER, contextId = "operationServiceClient",
|
||||
fallbackFactory = RemoteCardOperationServiceFallback.class)
|
||||
public interface RemoteCardOperationService {
|
||||
|
||||
/**
|
||||
* 更新白名单
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/in/operation/whiteList")
|
||||
ResultBean whiteList(@RequestBody WhiteListDTO dto);
|
||||
|
||||
/**
|
||||
* 更新免打扰设置
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/in/operation/disturbTime")
|
||||
ResultBean disturbTime(@RequestBody DisturbDTO dto);
|
||||
|
||||
/**
|
||||
* 立即定位
|
||||
*
|
||||
* @param imei
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/in/operation/nowLocation")
|
||||
ResultBean nowLocation(@RequestParam("imei") String imei);
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.yida.data.server.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("810A接口返回对象")
|
||||
@Data
|
||||
public class _810AResVO {
|
||||
|
||||
@ApiModelProperty("0-成功,1-失败")
|
||||
private Integer RESULT;
|
||||
|
||||
@ApiModelProperty("错误编码")
|
||||
private String ERRORCODE;
|
||||
|
||||
@ApiModelProperty("错误编码补充描述")
|
||||
private String ERRORDESC;
|
||||
|
||||
public static _810AResVO success() {
|
||||
_810AResVO res = new _810AResVO();
|
||||
res.setRESULT(0);
|
||||
res.setERRORCODE("0");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.yida.data.server.fallback.RemoteCardOperationServiceFallback
|
||||
Reference in New Issue
Block a user