Ver Fonte

Merge remote-tracking branch 'origin/V1' into V1

jz.kai há 5 anos atrás
pai
commit
495fbdc336

+ 13 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonDeviceLogDAO.java

@@ -0,0 +1,13 @@
+package com.jpsoft.smart.modules.base.dao;
+
+import org.springframework.stereotype.Repository;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 14:22
+ */
+@Repository
+public interface PersonDeviceLogDAO {
+
+
+}

+ 108 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/PersonDeviceLog.java

@@ -0,0 +1,108 @@
+package com.jpsoft.smart.modules.base.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 13:30
+ */
+@Data
+@ApiModel(value = "base_person_device_log的实体类")
+public class PersonDeviceLog {
+
+    /**
+     * 主体id
+     */
+    @ApiModelProperty(value = "ID")
+    private String id;
+
+    /**
+     * 设备序列号
+     */
+    @ApiModelProperty(value = "设备序列号")
+    private String deviceNo;
+
+
+    /**
+     * 人员id
+     */
+    @ApiModelProperty(value = "人员id")
+    private String personId;
+
+    /**
+     * 记录温度
+     */
+    @ApiModelProperty(value = "记录温度")
+    private BigDecimal temperature;
+
+
+    /**
+     * 匹配状态
+     */
+    @ApiModelProperty(value = "匹配状态")
+    private Integer matchStatus;
+
+    /**
+     * 匹配信息
+     */
+    @ApiModelProperty(value = "匹配信息")
+    private String  matchMsg;
+
+
+    /**
+     * 匹配人脸 ID
+     */
+    @ApiModelProperty(value = "匹配人脸 ID")
+    private Integer  matchFaceId;
+
+    /**
+     * 图片地址
+     */
+    @ApiModelProperty(value = "图片地址")
+    private String faceImage;
+
+    /**
+     * 记录时间
+     */
+    @ApiModelProperty(value = "记录时间")
+    private Date recordTime;
+
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String  updateBy;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+
+
+
+}

+ 22 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/PersonDeviceLogService.java

@@ -0,0 +1,22 @@
+package com.jpsoft.smart.modules.base.service;
+
+import cn.hutool.json.JSONObject;
+
+import java.math.BigDecimal;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 14:12
+ */
+public interface PersonDeviceLogService {
+
+    /**
+     * 设备自动上传的过人记录
+     * @param deviceNo
+     * @param temperature
+     * @param faceImageJson
+     * @param libMatInfoListJson
+     * @param matchPersonInfo
+     */
+    void deviceInsertLog(String deviceNo, BigDecimal temperature, JSONObject faceImageJson, JSONObject libMatInfoListJson, JSONObject matchPersonInfo);
+}

+ 43 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceLogServiceImpl.java

@@ -0,0 +1,43 @@
+package com.jpsoft.smart.modules.base.service.impl;
+
+import cn.hutool.json.JSONObject;
+import com.jpsoft.smart.modules.base.dao.AlarmInfoDAO;
+import com.jpsoft.smart.modules.base.dao.PersonDeviceLogDAO;
+import com.jpsoft.smart.modules.base.entity.PersonDeviceLog;
+import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
+import com.jpsoft.smart.modules.common.utils.IApiUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.UUID;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 14:12
+ */
+@Service
+@Transactional
+public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
+
+    @Resource(name="personDeviceLogDAO")
+    private PersonDeviceLogDAO personDeviceLogDAO;
+
+    @Override
+    public void deviceInsertLog(String deviceNo, BigDecimal temperature, JSONObject faceImageJson, JSONObject libMatInfoListJson, JSONObject matchPersonInfo) {
+        PersonDeviceLog personDeviceLog = new PersonDeviceLog();
+        personDeviceLog.setId(UUID.randomUUID().toString());
+        personDeviceLog.setDeviceNo(deviceNo);
+        personDeviceLog.setPersonId(matchPersonInfo.getStr("PersonCode"));
+        personDeviceLog.setTemperature(temperature);
+        personDeviceLog.setMatchStatus(libMatInfoListJson.getInt("MatchStatus"));
+        personDeviceLog.setMatchMsg(IApiUtil.getMatchMsg(libMatInfoListJson.getInt("MatchStatus")));
+        personDeviceLog.setMatchFaceId(libMatInfoListJson.getInt("MatchFaceID"));
+
+      //  long timestamp = jsonObject.getLong("Timestamp");
+      //  personDeviceLog.setRecordTime();
+
+
+    }
+}

+ 103 - 0
common/src/main/java/com/jpsoft/smart/modules/common/utils/IApiUtil.java

@@ -0,0 +1,103 @@
+package com.jpsoft.smart.modules.common.utils;
+
+import cn.hutool.http.HttpRequest;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-14 16:43
+ */
+@Component
+public class IApiUtil {
+
+
+   /* public JSONObject PostRequest(String url){
+
+        String body = HttpRequest.post(url).header("referer",referer).form(map).execute().body();
+        JSONObject jsonbody = JSONObject.parseObject(body);
+        return jsonbody;
+
+
+    }*/
+
+    public static JSONObject GetRequest(String url) throws Exception{
+
+        String body = HttpRequest.get(url).execute().body();
+        JSONObject jsonbody = JSONObject.parseObject(body);
+        return jsonbody;
+
+
+    }
+
+    public static JSONObject getResponse(JSONObject dataJson) throws Exception{
+
+        if (dataJson.getInteger("ResponseCode") == 1){
+            throw new Exception("通用错误");
+        }
+        if (dataJson.getInteger("ResponseCode") == 2){
+            throw new Exception("参数非法");
+        }
+        if (dataJson.getInteger("ResponseCode") == 3){
+            throw new Exception("用户无权限");
+        }
+        if (dataJson.getInteger("ResponseCode") == 4){
+            throw new Exception("设备不支持");
+        }
+        if (dataJson.getInteger("ResponseCode") == 5){
+            throw new Exception("用户状态异常");
+        }
+        if (dataJson.getInteger("StatusCode") == 1){
+            throw new Exception("执行失败");
+        }
+        if (dataJson.getInteger("StatusCode") == 2){
+            throw new Exception("输入参数非法");
+        }
+        if (dataJson.getInteger("StatusCode") == 3){
+            throw new Exception("系统内存不足");
+        }
+        if (dataJson.getInteger("StatusCode") == 8){
+            throw new Exception("功能不支持");
+        }
+        if (dataJson.getInteger("StatusCode") == 10){
+            throw new Exception("序列化执行失败");
+        }
+        if (dataJson.getInteger("StatusCode") == 11){
+            throw new Exception("Basic 鉴权失败");
+        }
+        if (dataJson.getInteger("StatusCode") == 12){
+            throw new Exception("Digest 鉴权失败");
+        }
+        if (dataJson.getInteger("StatusCode") == 13){
+            throw new Exception("订阅已满");
+        }
+        if (dataJson.getInteger("StatusCode") == 14){
+            throw new Exception("重复订阅");
+        }
+        return dataJson.getJSONObject("Data");
+    }
+
+    public static String getMatchMsg(Integer matchStatus){
+        String matchMsg = "";
+        if (matchStatus ==1){
+            matchMsg = "核验成功";
+        }
+        else if (matchStatus == 2){
+            matchMsg = "对比失败";
+        }
+        else if (matchStatus == 3){
+            matchMsg = "对比成功,不在布控时间";
+        }
+        else if (matchStatus == 10){
+            matchMsg = "对比成功,人脸属性异常";
+        }
+        else {
+            matchMsg = "未知匹配消息";
+        }
+
+        return matchMsg;
+    }
+}
+

+ 19 - 0
common/src/main/java/com/jpsoft/smart/modules/constant/LApiConstant.java

@@ -0,0 +1,19 @@
+package com.jpsoft.smart.modules.constant;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 9:50
+ */
+public class LApiConstant {
+
+    /**
+     * 获取设备的基本信息。
+     */
+    public static final String DEVICEBASICINFO = "/LAPI/V1.0/System/DeviceBasicInfo";
+
+    /**
+     * 获取设备的在线状态,可每隔 3s 获取一次
+     */
+    public static final String KEEPALIVE = "/LAPI/V1.0/System/KeepAlive";
+
+}

+ 26 - 0
common/src/main/java/com/jpsoft/smart/modules/lapi/service/ILapiService.java

@@ -0,0 +1,26 @@
+package com.jpsoft.smart.modules.lapi.service;
+
+import com.jpsoft.smart.modules.base.entity.DeviceInfo;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 9:36
+ */
+public interface ILapiService {
+
+    /**
+     * 通过ip和port查看门禁设备,有设备信息返回为正常
+     * @param ipAddress
+     * @param port
+     * @return
+     * @throws Exception
+     */
+     DeviceInfo findByIpAddressAndPort(String ipAddress, String port) throws Exception;
+
+    /**
+     * 根据设备id查看设备在线状态
+     * @param id 设备id
+     * @return
+     */
+     Boolean keepAlive(String id) throws Exception;
+}

+ 50 - 0
common/src/main/java/com/jpsoft/smart/modules/lapi/service/impl/LapiServiceImpl.java

@@ -0,0 +1,50 @@
+package com.jpsoft.smart.modules.lapi.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jpsoft.smart.modules.base.entity.DeviceInfo;
+import com.jpsoft.smart.modules.base.service.DeviceInfoService;
+import com.jpsoft.smart.modules.common.utils.IApiUtil;
+import com.jpsoft.smart.modules.constant.LApiConstant;
+import com.jpsoft.smart.modules.lapi.service.ILapiService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.UUID;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 9:37
+ */
+@Service
+public class LapiServiceImpl implements ILapiService {
+
+
+    @Autowired
+    private DeviceInfoService deviceInfoService;
+
+    @Override
+    public DeviceInfo findByIpAddressAndPort(String ipAddress, String port) throws Exception {
+        JSONObject jsonObject = IApiUtil.GetRequest(ipAddress + ":" + port + LApiConstant.DEVICEBASICINFO);
+        JSONObject dataJson = jsonObject.getJSONObject("Response");
+        JSONObject response = IApiUtil.getResponse(dataJson);
+        DeviceInfo deviceInfo = new DeviceInfo();
+        deviceInfo.setId(UUID.randomUUID().toString());
+        deviceInfo.setIpAddress(ipAddress);
+        deviceInfo.setPort(port);
+        deviceInfo.setIsOnline(true);
+        deviceInfo.setDeviceNo(response.getString("SerialNumber"));
+
+        return deviceInfo;
+    }
+
+    @Override
+    public Boolean keepAlive(String id) throws Exception{
+        DeviceInfo deviceInfo = deviceInfoService.get(id);
+        if (deviceInfo == null){
+            throw new Exception("设备未绑定");
+        }
+        JSONObject jsonObject = IApiUtil.GetRequest(deviceInfo.getIpAddress()+":" + deviceInfo.getPort()+LApiConstant.KEEPALIVE);
+        JSONObject dataJson = jsonObject.getJSONObject("Response");
+        return true;
+    }
+}

+ 11 - 0
lapi/pom.xml

@@ -27,6 +27,17 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-context</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.jpsoft.smart</groupId>
+            <artifactId>common</artifactId>
+            <version>1.0.0</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 4 - 1
lapi/src/main/java/com/jpsoft/smart/lapi/LapiApplication.java

@@ -3,7 +3,6 @@ package com.jpsoft.smart.lapi;
 import com.jpsoft.smart.lapi.handler.HeartReportHandler;
 import com.jpsoft.smart.lapi.handler.ParseRequestHandler;
 import com.jpsoft.smart.lapi.handler.PersonVerificationHandler;
-import com.jpsoft.smart.lapi.handler.TextDecodeHandler;
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -13,16 +12,20 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.handler.codec.http.HttpObjectAggregator;
 import io.netty.handler.codec.http.HttpServerCodec;
 import lombok.extern.slf4j.Slf4j;
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 import javax.annotation.PreDestroy;
 
 @Slf4j
 @SpringBootApplication
+@EnableTransactionManagement
+@MapperScan("com.jpsoft.smart.**.dao")
 public class LapiApplication implements CommandLineRunner {
     public static void main(String[] args) {
         SpringApplication.run(LapiApplication.class, args);

+ 37 - 2
lapi/src/main/java/com/jpsoft/smart/lapi/handler/PersonVerificationHandler.java

@@ -2,12 +2,15 @@ package com.jpsoft.smart.lapi.handler;
 
 import cn.hutool.json.JSONObject;
 import com.jpsoft.smart.lapi.dto.PersonVerification;
+import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.SimpleChannelInboundHandler;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
@@ -15,6 +18,10 @@ import java.util.Date;
 @Component
 @ChannelHandler.Sharable
 public class PersonVerificationHandler extends SimpleChannelInboundHandler<PersonVerification> {
+
+    @Autowired
+    private PersonDeviceLogService personDeviceLogService;
+
     @Override
     protected void channelRead0(ChannelHandlerContext channelHandlerContext, PersonVerification personVerification) throws Exception {
         log.warn(personVerification.toString());
@@ -24,14 +31,42 @@ public class PersonVerificationHandler extends SimpleChannelInboundHandler<Perso
         log.warn(jsonObject.toString());
       //  JSONObject faceJson = jsonObject.get("FaceInfoList");
         log.warn("FaceInfoList" +jsonObject.getStr("FaceInfoList"));
+
+
         JSONObject faceJson = new JSONObject(jsonObject.getStr("FaceInfoList").substring(1,jsonObject.getStr("FaceInfoList").length()-1));
-        log.warn("faceJson"+faceJson);
+        log.warn(faceJson.getStr("FaceImage"));
+
+        //设备序列号
+        String deviceNo = jsonObject.getStr("DeviceCode");
+
+        //人员温度信息
+        BigDecimal temperature = faceJson.getBigDecimal("Temperature");
+
+        //人员抓拍信息
+        JSONObject faceImageJson = faceJson.getJSONObject("FaceImage");
+
+        //匹配状态信息
+        JSONObject libMatInfoListJson = new JSONObject(jsonObject.getStr("LibMatInfoList").substring(1,jsonObject.getStr("LibMatInfoList").length()-1));
+
+        //匹配人员信息
+        JSONObject matchPersonInfo = libMatInfoListJson.getJSONObject("MatchPersonInfo");
+
+
+        personDeviceLogService.deviceInsertLog(deviceNo,temperature,faceImageJson,libMatInfoListJson,matchPersonInfo);
+
+
+
+
+        /*log.warn("faceJson"+faceJson);
+        log.warn("FaceImage"+faceImageJson);
+        log.warn("LibMatInfoList"+libMatInfoListJson);
+        log.warn("MatchPersonInfo"+matchPersonInfo);
         long timestamp = jsonObject.getLong("Timestamp");
 
         Date date = new Date(timestamp);
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
-        log.warn("考勤时间:" + sdf.format(date));
+        log.warn("考勤时间:" + sdf.format(date));*/
     }
 }

+ 16 - 0
lapi/src/main/resources/application-dev.yml

@@ -0,0 +1,16 @@
+server:
+  port: 9988
+
+spring:
+  datasource:
+    url: jdbc:log4jdbc:mysql://192.168.33.20:3306/smart-community?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    username: smart
+    password: smart
+  devtools:
+    add-properties: false
+    restart:
+      enabled: true
+
+logger:
+  level: WARN
+  dir: E:\mye\WORK\wisdowHouse

+ 84 - 2
lapi/src/main/resources/application.yml

@@ -1,2 +1,84 @@
-server:
-  port: 9988
+spring:
+  datasource:
+    driver-class-name: net.sf.log4jdbc.DriverSpy
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initial-size: 5
+      min-idle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters: stat,wall
+      # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+      connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      # 配置DruidStatFilter
+      web-stat-filter:
+        enabled: true
+        url-pattern: "/*"
+        exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
+      # 配置DruidStatViewServlet
+      stat-view-servlet:
+        url-pattern: "/druid/*"
+        # IP白名单(没有配置或者为空,则允许所有访问)
+        allow:
+        # IP黑名单 (存在共同时,deny优先于allow)
+        deny:
+        #  禁用HTML页面上的“Reset All”功能
+        reset-enable: false
+        # 登录名
+        login-username: admin
+        # 登录密码
+        login-password: jpsoft
+  devtools:
+    restart:
+      enabled: true
+  profiles:
+    active: dev
+  redis:
+    # Redis数据库索引(默认为0)
+    database: 1
+    # Redis服务器地址
+    host: 192.168.33.21
+    #host: 127.0.0.1
+    # Redis服务器连接端口
+    port: 6379
+    # Redis服务器连接密码(默认为空)
+    password:
+    #password: 123456
+    # 连接池最大连接数(使用负值表示没有限制)
+    pool:
+      max-active: 8
+      # 连接池最大阻塞等待时间(使用负值表示没有限制)
+      max-wait: -1
+      # 连接池中的最大空闲连接
+      max-idle: 8
+      # 连接池中的最小空闲连接
+      min-idle: 0
+      # 连接超时时间(毫秒)
+      timeout: 0
+
+mybatis:
+  typeAliasesPackage: com.jpsoft.smart.**.entity
+  mapperLocations: classpath*:mapper/**/*.xml
+  configuration:
+    default-statement-timeout: 60
+
+pagehelper:
+  helperDialect: mysql
+  reasonable: true
+  supportMethodsArguments: true
+  params: count=countSql

+ 2 - 1
web/src/main/java/com/jpsoft/smart/config/WebMvcConfig.java

@@ -58,6 +58,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/base/informationInfo/addMobile")
 				.excludePathPatterns("/base/employeeInfo/mobile/**")
 				.excludePathPatterns("/base/companyInfo/list")
-				.excludePathPatterns("/wechat/**");
+				.excludePathPatterns("/wechat/**")
+				.excludePathPatterns("/mobile/**");
 	}
 }

+ 9 - 4
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonInfoApiController.java

@@ -46,14 +46,15 @@ public class PersonInfoApiController {
             @ApiImplicitParam(name="name",value = "照片名称",required = true,paramType = "form"),
             @ApiImplicitParam(name = "phone",value = "电话号码", required = true,paramType="form")
     })
-    public MessageResult<PersonInfo> findByNameAndPhone(String name,String phone){
-        MessageResult<PersonInfo> messageResult = new MessageResult<>();
+    public MessageResult<Long> findByNameAndPhone(String name,String phone){
+        MessageResult<Long> messageResult = new MessageResult<>();
 
         try {
             PersonInfo personInfo = personInfoService.findByNameAndPhone(name, phone);
 
-            messageResult.setData(personInfo);
+            messageResult.setData(personInfo.getId());
             messageResult.setResult(true);
+            messageResult.setCode(200);
         }
         catch (Exception ex){
             messageResult.setResult(false);
@@ -76,6 +77,7 @@ public class PersonInfoApiController {
 
             messageResult.setData(personInfo);
             messageResult.setResult(true);
+            messageResult.setCode(200);
         }
         catch (Exception ex){
             messageResult.setResult(false);
@@ -114,6 +116,9 @@ public class PersonInfoApiController {
                 //设置当前用户的验证码,60秒后过期
                 valueOperations.set(key, verifyCode, 60000, TimeUnit.SECONDS);
             }
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
         }
         catch (Exception ex){
             messageResult.setResult(false);
@@ -123,7 +128,7 @@ public class PersonInfoApiController {
         return messageResult;
     }
 
-    @PostMapping("mobile/upload")
+    @PostMapping("upload")
     @ApiOperation(value="人员照片上传")
     @ApiImplicitParams({
             @ApiImplicitParam(name="photoName",value = "照片名称",required = true,paramType = "form"),

+ 33 - 0
web/src/test/java/com/jpsoft/smart/LApiTest.java

@@ -0,0 +1,33 @@
+package com.jpsoft.smart;
+
+import com.jpsoft.smart.modules.lapi.service.ILapiService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 9:58
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class LApiTest {
+
+    @Autowired
+    private ILapiService lapiService;
+
+    @Test
+    public void testKeepLive(){
+        try {
+            Boolean result = lapiService.keepAlive("1");
+            System.out.println(result);
+        } catch (Exception e) {
+            e.printStackTrace();
+            String message = e.getMessage();
+        }
+
+    }
+
+}