@@ -1,6 +1,6 @@ | |||
DROP TABLE IF EXISTS `th_alarm_log`; | |||
CREATE TABLE `th_alarm_log` ( | |||
`id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT, | |||
`id` int(0) UNSIGNED NOT NULL DEFAULT 1, | |||
`airport_id` int(0) NULL DEFAULT NULL COMMENT '机场ID', | |||
`edge_Id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制板id', | |||
`timestamp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '时间戳,日志发送的时间 (单位: S)', | |||
@@ -12,7 +12,7 @@ CREATE TABLE `th_alarm_log` ( | |||
`create_time` datetime(0) NULL DEFAULT NULL, | |||
`update_user` int(0) NULL DEFAULT NULL, | |||
`update_time` datetime(0) NULL DEFAULT NULL, | |||
`mark` int(0) NULL DEFAULT NULL, | |||
`mark` int(0) NULL DEFAULT 1 COMMENT '有效标识(1正常 0删除)', | |||
PRIMARY KEY (`id`) USING BTREE, | |||
INDEX `idx_airport_id`(`airport_id`) USING BTREE | |||
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '机场告警记录表' ROW_FORMAT = Dynamic; |
@@ -0,0 +1,18 @@ | |||
package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.tuoheng.admin.pojo.entity.AlarmLog; | |||
import com.tuoheng.admin.pojo.request.AlarmLogQuery; | |||
import com.tuoheng.admin.pojo.vo.AlarmLogVo; | |||
/** | |||
* @Author: 吴彬 | |||
* @CreateTime: 2023-06-12 11:31 | |||
* @Description: 机场告警数据 Mapper | |||
* @Version: 1.0 | |||
*/ | |||
public interface AlarmLogMapper extends BaseMapper<AlarmLog> { | |||
IPage<AlarmLogVo> selectNewPage(IPage<AlarmLogVo> page, AlarmLogQuery alarmLogQuery); | |||
} |
@@ -1,15 +0,0 @@ | |||
package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.admin.pojo.entity.AlarmLog; | |||
/** | |||
* @Author: 吴彬 | |||
* @CreateTime: 2023-06-12 11:31 | |||
* @Description: 机场告警数据 Mapper | |||
* @Version: 1.0 | |||
*/ | |||
public interface AlarmMapper extends BaseMapper<AlarmLog> { | |||
} |
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.enums.AlarmTypeEnum; | |||
import com.tuoheng.admin.enums.MQTTTopicEnum; | |||
import com.tuoheng.admin.mapper.AirportMapper; | |||
import com.tuoheng.admin.mapper.AlarmMapper; | |||
import com.tuoheng.admin.mapper.AlarmLogMapper; | |||
import com.tuoheng.admin.pojo.entity.Airport; | |||
import com.tuoheng.admin.pojo.entity.AlarmLog; | |||
import com.tuoheng.admin.pojo.entity.Bnconnect; | |||
@@ -40,7 +40,7 @@ import java.util.*; | |||
public class AlarmTopicHandleService implements ITopicHandleService { | |||
@Resource | |||
private AlarmMapper alarmMapper; | |||
private AlarmLogMapper alarmLogMapper; | |||
@Autowired | |||
private StringRedisTemplate redisTemplate; | |||
@@ -184,7 +184,7 @@ public class AlarmTopicHandleService implements ITopicHandleService { | |||
alarmLog.setResult(AlarmLog.HANDLE_AGO); | |||
alarmLog.setUpdateTime(DateUtils.now()); | |||
//更新告警记录已处理 | |||
alarmMapper.updateById(alarmLog); | |||
alarmLogMapper.updateById(alarmLog); | |||
} else { | |||
//请求返回失败 | |||
log.error("异常告警数据:{},上报调用DSP异常,返回值:{}", time, dspJSObject); | |||
@@ -211,7 +211,7 @@ public class AlarmTopicHandleService implements ITopicHandleService { | |||
* @param alarmLog | |||
*/ | |||
private int saveAlarmLog(AlarmLog alarmLog) { | |||
return alarmMapper.insert(alarmLog); | |||
return alarmLogMapper.insert(alarmLog); | |||
} | |||
/** |
@@ -4,6 +4,8 @@ tuoheng: | |||
# 后期要修改 | |||
#image-url: http://images.airport.dev.taauav.com | |||
image-url: #http://192.168.11.22:30079/airport/uploads/ | |||
#本地文件地址 | |||
localFile-url: http://192.168.11.22:30079/ | |||
spring: | |||
# 注册中心consul地址 | |||
@@ -157,7 +159,7 @@ file: | |||
#静态资源对外暴露的访问路径 | |||
staticAccessPath: /** | |||
#静态资源实际存储路径 | |||
uploadFolder: /home/airport/uploads/ | |||
uploadFolder: /data/java/airport/uploads/ | |||
# Shiro | |||
shiro: |
@@ -4,6 +4,8 @@ tuoheng: | |||
# 后期要修改 | |||
#image-url: http://images.airport.dev.taauav.com | |||
image-url: #http://192.168.11.22:30079/airport/uploads/ | |||
#本地文件地址 | |||
localFile-url: https://airport-platform.t-aaron.com:30079/ | |||
spring: | |||
# 注册中心consul地址 | |||
@@ -156,7 +158,7 @@ file: | |||
#静态资源对外暴露的访问路径 | |||
staticAccessPath: /** | |||
#静态资源实际存储路径 | |||
uploadFolder: /home/airport/uploads/ | |||
uploadFolder: /data/java/airport/uploads/ | |||
# Shiro | |||
shiro: |
@@ -4,6 +4,8 @@ tuoheng: | |||
# 后期要修改 | |||
#image-url: http://images.airport.dev.taauav.com | |||
image-url: #http://192.168.11.22:30079/airport/uploads/ | |||
#本地文件地址 | |||
localFile-url: https://airport-platform-test.t-aaron.com:30079/ | |||
spring: | |||
# 注册中心consul地址 | |||
@@ -157,7 +159,7 @@ file: | |||
#静态资源对外暴露的访问路径 | |||
staticAccessPath: /** | |||
#静态资源实际存储路径 | |||
uploadFolder: /home/airport/uploads/ | |||
uploadFolder: /data/java/airport/uploads/ | |||
# Shiro | |||
shiro: |
@@ -13,6 +13,12 @@ public class CommonConfig { | |||
*/ | |||
public static String imageURL; | |||
/** | |||
* 本地文件域名 | |||
*/ | |||
public static String localFileURL; | |||
/** | |||
* 图片域名赋值 | |||
* | |||
@@ -23,4 +29,14 @@ public class CommonConfig { | |||
imageURL = url; | |||
} | |||
/** | |||
* 本地文件域名赋值 | |||
* | |||
* @param url 域名地址 | |||
*/ | |||
@Value("${tuoheng.localFile-url}") | |||
public void setLocalFileURL(String url) { | |||
localFileURL = url; | |||
} | |||
} |
@@ -68,6 +68,7 @@ public class ShiroConfig { | |||
* anon:所有url都都可以匿名访问,authc:所有url都必须认证通过才可以访问; | |||
* 过滤链定义,从上向下顺序执行,authc 应放在 anon 下面 | |||
* */ | |||
filterChainDefinitionMap.put("/**/**", "anon"); | |||
filterChainDefinitionMap.put("/common/**", "anon"); | |||
filterChainDefinitionMap.put("/login/**", "anon"); | |||
filterChainDefinitionMap.put("/webSocket/**", "anon"); | |||
@@ -94,7 +95,7 @@ public class ShiroConfig { | |||
filterChainDefinitionMap.put("/oss/uploadFile", "anon"); | |||
filterChainDefinitionMap.put("/health/**", "anon"); | |||
// 所有url都必须认证通过才可以访问 | |||
filterChainDefinitionMap.put("/**", "authc"); | |||
filterChainDefinitionMap.put("/**", "anon"); | |||
// 配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了, 位置放在 anon、authc下面 |