增加数据库脚本

This commit is contained in:
lin
2025-05-19 10:39:49 +08:00
parent c981e7f470
commit 5224f2b5c0
7 changed files with 979 additions and 5 deletions

View File

@@ -26,19 +26,19 @@ public class Device {
*/
@Schema(description = "名称")
private String name;
/**
* 生产厂商
*/
@Schema(description = "生产厂商")
private String manufacturer;
/**
* 型号
*/
@Schema(description = "型号")
private String model;
/**
* 固件版本
*/
@@ -78,7 +78,7 @@ public class Device {
*/
@Schema(description = "wan地址")
private String hostAddress;
/**
* 在线
*/
@@ -212,4 +212,7 @@ public class Device {
@Schema(description = "所属服务Id")
private String serverId;
@Schema(description = "所属服务Id")
private Integer deviceType;
}

View File

@@ -46,6 +46,7 @@ public interface DeviceMapper {
"server_id,"+
"media_server_id," +
"broadcast_push_after_ack," +
"device_type," +
"(SELECT count(0) FROM wvp_device_channel dc WHERE dc.data_type = 1 and dc.data_device_id= de.id) as channel_count "+
" FROM wvp_device de WHERE de.device_id = #{deviceId}")
Device getDeviceByDeviceId( @Param("deviceId") String deviceId);
@@ -80,6 +81,7 @@ public interface DeviceMapper {
"ssrc_check,"+
"as_message_channel,"+
"broadcast_push_after_ack,"+
"device_type,"+
"geo_coord_sys,"+
"server_id,"+
"on_line"+
@@ -113,6 +115,7 @@ public interface DeviceMapper {
"#{ssrcCheck}," +
"#{asMessageChannel}," +
"#{broadcastPushAfterAck}," +
"#{deviceType}," +
"#{geoCoordSys}," +
"#{serverId}," +
"#{onLine}" +
@@ -174,6 +177,7 @@ public interface DeviceMapper {
"ssrc_check,"+
"as_message_channel,"+
"broadcast_push_after_ack,"+
"device_type,"+
"geo_coord_sys,"+
"on_line,"+
"media_server_id,"+
@@ -216,6 +220,7 @@ public interface DeviceMapper {
"ssrc_check,"+
"as_message_channel,"+
"broadcast_push_after_ack,"+
"device_type,"+
"geo_coord_sys,"+
"server_id,"+
"on_line"+
@@ -249,6 +254,7 @@ public interface DeviceMapper {
"ssrc_check,"+
"as_message_channel,"+
"broadcast_push_after_ack,"+
"device_type,"+
"geo_coord_sys,"+
"server_id,"+
"on_line"+
@@ -283,6 +289,7 @@ public interface DeviceMapper {
"ssrc_check,"+
"as_message_channel,"+
"broadcast_push_after_ack,"+
"device_type,"+
"geo_coord_sys,"+
"on_line"+
" FROM wvp_device WHERE ip = #{host} AND port=#{port}")
@@ -293,7 +300,7 @@ public interface DeviceMapper {
"SET update_time=#{updateTime}, custom_name=#{name} , password=#{password}, stream_mode=#{streamMode}" +
", ip=#{ip}, sdp_ip=#{sdpIp}, port=#{port}, charset=#{charset}" +
", ssrc_check=#{ssrcCheck}, as_message_channel=#{asMessageChannel}" +
", broadcast_push_after_ack=#{broadcastPushAfterAck}, geo_coord_sys=#{geoCoordSys}, media_server_id=#{mediaServerId}" +
", broadcast_push_after_ack=#{broadcastPushAfterAck}, device_type=#{deviceType}, geo_coord_sys=#{geoCoordSys}, media_server_id=#{mediaServerId}" +
" WHERE id=#{id}"+
" </script>"})
void updateCustom(Device device);
@@ -309,6 +316,7 @@ public interface DeviceMapper {
"ssrc_check,"+
"as_message_channel,"+
"broadcast_push_after_ack,"+
"device_type,"+
"geo_coord_sys,"+
"on_line,"+
"stream_mode," +
@@ -325,6 +333,7 @@ public interface DeviceMapper {
"#{ssrcCheck}," +
"#{asMessageChannel}," +
"#{broadcastPushAfterAck}," +
"#{deviceType}," +
"#{geoCoordSys}," +
"#{onLine}," +
"#{streamMode}," +

View File

@@ -195,6 +195,7 @@ public class DeviceServiceImpl implements IDeviceService {
}
@Override
@Transactional
public void offline(String deviceId, String reason) {
Device device = getDeviceByDeviceIdFromDb(deviceId);
if (device == null) {
@@ -223,6 +224,7 @@ public class DeviceServiceImpl implements IDeviceService {
device.setOnLine(false);
redisCatchStorage.updateDevice(device);
deviceMapper.update(device);
if (device.getDeviceType() )
//进行通道离线
// deviceChannelMapper.offlineByDeviceId(deviceId);
// 离线释放所有ssrc
@@ -254,6 +256,8 @@ public class DeviceServiceImpl implements IDeviceService {
}
}
private boolean is
@Override
public boolean addCatalogSubscribe(Device device) {
if (device == null || device.getSubscribeCycleForCatalog() < 0) {