fix:modify api/records

This commit is contained in:
pg
2025-03-11 15:06:28 +08:00
committed by pggiroro
parent 8866e7a68d
commit 7d83b9dede
5 changed files with 604 additions and 604 deletions
+3 -3
View File
@@ -963,7 +963,7 @@ func (gb *GB28181ProPlugin) QueryRecord(ctx context.Context, req *pb.QueryRecord
for _, record := range recordReq.Response {
for _, item := range record.RecordList.Item {
resp.Records = append(resp.Records, &pb.RecordItem{
resp.Data = append(resp.Data, &pb.RecordItem{
DeviceId: item.DeviceID,
Name: item.Name,
FilePath: item.FilePath,
@@ -981,8 +981,8 @@ func (gb *GB28181ProPlugin) QueryRecord(ctx context.Context, req *pb.QueryRecord
resp.Message = fmt.Sprintf("success, received %d/%d records", recordReq.ReceivedNum, recordReq.SumNum)
// 排序录像列表,按StartTime升序排序
sort.Slice(resp.Records, func(i, j int) bool {
return resp.Records[i].StartTime < resp.Records[j].StartTime
sort.Slice(resp.Data, func(i, j int) bool {
return resp.Data[i].StartTime < resp.Data[j].StartTime
})
// 清理请求
+1 -1
View File
@@ -164,7 +164,7 @@ func (d *ForwardDialog) Start() (err error) {
if d.SSRC == 0 {
d.SSRC = uint32(ssrcValue)
}
sdpInfo = append(sdpInfo, fmt.Sprintf("y=%d", d.SSRC))
sdpInfo = append(sdpInfo, fmt.Sprintf("y=%s", d.SSRC))
// 创建INVITE请求
request := sip.NewRequest(sip.INVITE, sip.Uri{User: channelId, Host: device.IP})
+36 -36
View File
@@ -911,47 +911,47 @@ func (gb *GB28181ProPlugin) OnInvite(req *sip.Request, tx sip.ServerTransaction)
wdc.stream_proxy_id,
wdc.create_time,
wdc.update_time,
COALESCE(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,
COALESCE(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,
COALESCE(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,
COALESCE(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,
COALESCE(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,
COALESCE(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,
COALESCE(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,
COALESCE(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,
COALESCE(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,
COALESCE(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,
COALESCE(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,
COALESCE(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,
COALESCE(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,
COALESCE(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,
COALESCE(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,
COALESCE(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,
COALESCE(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,
COALESCE(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,
COALESCE(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,
COALESCE(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,
COALESCE(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,
COALESCE(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,
COALESCE(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,
COALESCE(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,
COALESCE(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,
COALESCE(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,
COALESCE(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,
COALESCE(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,
COALESCE(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,
COALESCE(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,
COALESCE(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,
COALESCE(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,
COALESCE(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,
COALESCE(wpgc.custom_svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode
COALESCE(NULLIF(wpgc.custom_device_id, ''), NULLIF(wdc.gb_device_id, ''), NULLIF(wdc.device_id, '')) as gb_device_id,
COALESCE(NULLIF(wpgc.custom_name, ''), NULLIF(wdc.gb_name, ''), NULLIF(wdc.name, '')) as gb_name,
COALESCE(NULLIF(wpgc.custom_manufacturer, ''), NULLIF(wdc.gb_manufacturer, ''), NULLIF(wdc.manufacturer, '')) as gb_manufacturer,
COALESCE(NULLIF(wpgc.custom_model, ''), NULLIF(wdc.gb_model, ''), NULLIF(wdc.model, '')) as gb_model,
COALESCE(NULLIF(wpgc.custom_owner, ''), NULLIF(wdc.gb_owner, ''), NULLIF(wdc.owner, '')) as gb_owner,
COALESCE(NULLIF(wpgc.custom_civil_code, ''), NULLIF(wdc.gb_civil_code, ''), NULLIF(wdc.civil_code, '')) as gb_civil_code,
COALESCE(NULLIF(wpgc.custom_block, ''), NULLIF(wdc.gb_block, ''), NULLIF(wdc.block, '')) as gb_block,
COALESCE(NULLIF(wpgc.custom_address, ''), NULLIF(wdc.gb_address, ''), NULLIF(wdc.address, '')) as gb_address,
COALESCE(NULLIF(wpgc.custom_parental, ''), NULLIF(wdc.gb_parental, ''), NULLIF(wdc.parental, '')) as gb_parental,
COALESCE(NULLIF(wpgc.custom_parent_id, ''), NULLIF(wdc.gb_parent_id, ''), NULLIF(wdc.parent_id, '')) as gb_parent_id,
COALESCE(NULLIF(wpgc.custom_safety_way, ''), NULLIF(wdc.gb_safety_way, ''), NULLIF(wdc.safety_way, '')) as gb_safety_way,
COALESCE(NULLIF(wpgc.custom_register_way, ''), NULLIF(wdc.gb_register_way, ''), NULLIF(wdc.register_way, '')) as gb_register_way,
COALESCE(NULLIF(wpgc.custom_cert_num, ''), NULLIF(wdc.gb_cert_num, ''), NULLIF(wdc.cert_num, '')) as gb_cert_num,
COALESCE(NULLIF(wpgc.custom_certifiable, ''), NULLIF(wdc.gb_certifiable, ''), NULLIF(wdc.certifiable, '')) as gb_certifiable,
COALESCE(NULLIF(wpgc.custom_err_code, ''), NULLIF(wdc.gb_err_code, ''), NULLIF(wdc.err_code, '')) as gb_err_code,
COALESCE(NULLIF(wpgc.custom_end_time, ''), NULLIF(wdc.gb_end_time, ''), NULLIF(wdc.end_time, '')) as gb_end_time,
COALESCE(NULLIF(wpgc.custom_secrecy, ''), NULLIF(wdc.gb_secrecy, ''), NULLIF(wdc.secrecy, '')) as gb_secrecy,
COALESCE(NULLIF(wpgc.custom_ip_address, ''), NULLIF(wdc.gb_ip_address, ''), NULLIF(wdc.ip_address, '')) as gb_ip_address,
COALESCE(NULLIF(wpgc.custom_port, ''), NULLIF(wdc.gb_port, ''), NULLIF(wdc.port, '')) as gb_port,
COALESCE(NULLIF(wpgc.custom_password, ''), NULLIF(wdc.gb_password, ''), NULLIF(wdc.password, '')) as gb_password,
COALESCE(NULLIF(wpgc.custom_status, ''), NULLIF(wdc.gb_status, ''), NULLIF(wdc.status, '')) as gb_status,
COALESCE(NULLIF(wpgc.custom_longitude, ''), NULLIF(wdc.gb_longitude, ''), NULLIF(wdc.longitude, '')) as gb_longitude,
COALESCE(NULLIF(wpgc.custom_latitude, ''), NULLIF(wdc.gb_latitude, ''), NULLIF(wdc.latitude, '')) as gb_latitude,
COALESCE(NULLIF(wpgc.custom_ptz_type, ''), NULLIF(wdc.gb_ptz_type, ''), NULLIF(wdc.ptz_type, '')) as gb_ptz_type,
COALESCE(NULLIF(wpgc.custom_position_type, ''), NULLIF(wdc.gb_position_type, ''), NULLIF(wdc.position_type, '')) as gb_position_type,
COALESCE(NULLIF(wpgc.custom_room_type, ''), NULLIF(wdc.gb_room_type, ''), NULLIF(wdc.room_type, '')) as gb_room_type,
COALESCE(NULLIF(wpgc.custom_use_type, ''), NULLIF(wdc.gb_use_type, ''), NULLIF(wdc.use_type, '')) as gb_use_type,
COALESCE(NULLIF(wpgc.custom_supply_light_type, ''), NULLIF(wdc.gb_supply_light_type, ''), NULLIF(wdc.supply_light_type, '')) as gb_supply_light_type,
COALESCE(NULLIF(wpgc.custom_direction_type, ''), NULLIF(wdc.gb_direction_type, ''), NULLIF(wdc.direction_type, '')) as gb_direction_type,
COALESCE(NULLIF(wpgc.custom_resolution, ''), NULLIF(wdc.gb_resolution, ''), NULLIF(wdc.resolution, '')) as gb_resolution,
COALESCE(NULLIF(wpgc.custom_business_group_id, ''), NULLIF(wdc.gb_business_group_id, ''), NULLIF(wdc.business_group_id, '')) as gb_business_group_id,
COALESCE(NULLIF(wpgc.custom_download_speed, ''), NULLIF(wdc.gb_download_speed, ''), NULLIF(wdc.download_speed, '')) as gb_download_speed,
COALESCE(NULLIF(wpgc.custom_svc_space_support_mod, ''), NULLIF(wdc.gb_svc_space_support_mod, ''), NULLIF(wdc.svc_space_support_mod, '')) as gb_svc_space_support_mod,
COALESCE(NULLIF(wpgc.custom_svc_time_support_mode, ''), NULLIF(wdc.gb_svc_time_support_mode, ''), NULLIF(wdc.svc_time_support_mode, '')) as gb_svc_time_support_mode
FROM
device_channel_gb28181pro wdc
channel_gb28181pro wdc
LEFT JOIN
platform_channel_gb28181pro wpgc ON wdc.id = wpgc.device_channel_id
WHERE
wpgc.platform_id = ? AND
COALESCE(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) = ?
COALESCE(NULLIF(wpgc.custom_device_id,''), NULLIF(wdc.gb_device_id,''), NULLIF(wdc.device_id,'')) = ?
ORDER BY
wdc.id
`
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -721,7 +721,7 @@ message QueryRecordRequest {
message QueryRecordResponse {
int32 code = 1;
string message = 2;
repeated RecordItem records = 3;
repeated RecordItem data = 3;
string device_id = 4;
string channel_id = 5;
string sn = 6;