Commit 04f3511fb3f3598cfb1646ba7ab58bf20e1a0de3
1 parent
10ae1bba
优化mysql建库脚本
Showing
4 changed files
with
11 additions
and
9 deletions
sql/mysql.sql
| ... | ... | @@ -46,7 +46,7 @@ create table device_channel |
| 46 | 46 | streamId varchar(50) null, |
| 47 | 47 | deviceId varchar(50) not null, |
| 48 | 48 | parental varchar(50) null, |
| 49 | - hasAudio tinyint(1) null, | |
| 49 | + hasAudio bit(1) null, | |
| 50 | 50 | primary key (channelId, deviceId) |
| 51 | 51 | ); |
| 52 | 52 | |
| ... | ... | @@ -100,7 +100,7 @@ create table parent_platform |
| 100 | 100 | characterSet varchar(50) null, |
| 101 | 101 | ptz int null, |
| 102 | 102 | rtcp int null, |
| 103 | - status tinyint(1) null | |
| 103 | + status bit(1) null | |
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | 106 | create table platform_gb_channel |
| ... | ... | @@ -131,9 +131,9 @@ create table stream_proxy |
| 131 | 131 | timeout_ms int null, |
| 132 | 132 | ffmpeg_cmd_key varchar(50) null, |
| 133 | 133 | rtp_type varchar(50) null, |
| 134 | - enable_hls tinyint(1) null, | |
| 135 | - enable_mp4 tinyint(1) null, | |
| 136 | - enable tinyint(1) not null, | |
| 134 | + enable_hls bit(1) null, | |
| 135 | + enable_mp4 bit(1) null, | |
| 136 | + enable bit(1) not null, | |
| 137 | 137 | primary key (app, stream) |
| 138 | 138 | ); |
| 139 | 139 | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
| ... | ... | @@ -780,7 +780,9 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { |
| 780 | 780 | } else { |
| 781 | 781 | } |
| 782 | 782 | }else { |
| 783 | - logger.warn("收到[ "+deviceId+" ]心跳信息, 但是设备" + (device == null? "不存在":"离线") + ", 心跳信息不予以回复"); | |
| 783 | + logger.warn("收到[ "+deviceId+" ]心跳信息, 但是设备" + (device == null? "不存在":"离线") + ", 回复401"); | |
| 784 | + Response response = getMessageFactory().createResponse(Response.UNAUTHORIZED, evt.getRequest()); | |
| 785 | + getServerTransaction(evt).sendResponse(response); | |
| 784 | 786 | } |
| 785 | 787 | } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) { |
| 786 | 788 | e.printStackTrace(); | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| ... | ... | @@ -46,7 +46,7 @@ public interface DeviceChannelMapper { |
| 46 | 46 | "<if test=\"PTZType != null\">, PTZType=${PTZType}</if>" + |
| 47 | 47 | "<if test=\"status != null\">, status='${status}'</if>" + |
| 48 | 48 | "<if test=\"streamId != null\">, streamId='${streamId}'</if>" + |
| 49 | - "<if test=\"hasAudio != null\">, hasAudio='${hasAudio}'</if>" + | |
| 49 | + "<if test=\"hasAudio != null\">, hasAudio=${hasAudio}</if>" + | |
| 50 | 50 | "WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+ |
| 51 | 51 | " </script>"}) |
| 52 | 52 | int update(DeviceChannel channel); | ... | ... |
src/main/resources/application-dev.yml
| ... | ... | @@ -13,8 +13,8 @@ spring: |
| 13 | 13 | timeout: 10000 |
| 14 | 14 | # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置 |
| 15 | 15 | datasource: |
| 16 | - # name: eiot | |
| 17 | - # url: jdbc:mysql://127.0.0.1:3306/eiot?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true | |
| 16 | + # name: wvp | |
| 17 | + # url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true | |
| 18 | 18 | # username: |
| 19 | 19 | # password: |
| 20 | 20 | # type: com.alibaba.druid.pool.DruidDataSource | ... | ... |