fix: GetGroupChannels api

This commit is contained in:
pggiroro
2025-04-28 20:30:29 +08:00
parent 4c2a8ed7f4
commit 7bcd619bf5
3 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -1617,8 +1617,8 @@ func (gb *GB28181Plugin) GetGroupChannels(ctx context.Context, req *pb.GetGroupC
ELSE true
END AS in_group
`).
Joins("LEFT JOIN "+deviceTable+" AS d ON dc.device_db_id = d.id").
Joins("LEFT JOIN "+groupsChannelTable+" AS gc ON dc.device_id = gc.channel_id AND gc.group_id = ?", req.GroupId)
Joins("LEFT JOIN "+deviceTable+" AS d ON dc.device_id = d.device_id").
Joins("LEFT JOIN "+groupsChannelTable+" AS gc ON dc.channel_id = gc.channel_id AND gc.group_id = ?", req.GroupId)
// 如果有设备ID过滤条件
if req.DeviceId != "" {
@@ -1682,7 +1682,7 @@ func (gb *GB28181Plugin) GetGroupChannels(ctx context.Context, req *pb.GetGroupC
resp.Code = 0
resp.Message = "获取通道列表成功"
resp.Total = int32(total)
resp.List = pbGroupChannels
resp.Data = pbGroupChannels
return resp, nil
}
+5 -5
View File
@@ -5640,7 +5640,7 @@ type GroupChannelsResponse struct {
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
List []*GroupChannel `protobuf:"bytes,4,rep,name=list,proto3" json:"list,omitempty"`
Data []*GroupChannel `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -5696,9 +5696,9 @@ func (x *GroupChannelsResponse) GetTotal() int32 {
return 0
}
func (x *GroupChannelsResponse) GetList() []*GroupChannel {
func (x *GroupChannelsResponse) GetData() []*GroupChannel {
if x != nil {
return x.List
return x.Data
}
return nil
}
@@ -6479,7 +6479,7 @@ const file_gb28181_proto_rawDesc = "" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" +
"\x05total\x18\x03 \x01(\x05R\x05total\x12,\n" +
"\x04list\x18\x04 \x03(\v2\x18.gb28181pro.GroupChannelR\x04list\"6\n" +
"\x04data\x18\x04 \x03(\v2\x18.gb28181pro.GroupChannelR\x04data\"6\n" +
"\x14PlaybackPauseRequest\x12\x1e\n" +
"\n" +
"streamPath\x18\x01 \x01(\tR\n" +
@@ -6705,7 +6705,7 @@ var file_gb28181_proto_depIdxs = []int32{
68, // 23: gb28181pro.GroupsListResponse.data:type_name -> gb28181pro.Group
68, // 24: gb28181pro.GroupsPageInfo.data:type_name -> gb28181pro.Group
86, // 25: gb28181pro.AddGroupChannelRequest.channels:type_name -> gb28181pro.AddGroupChannelRequest.Channel
78, // 26: gb28181pro.GroupChannelsResponse.list:type_name -> gb28181pro.GroupChannel
78, // 26: gb28181pro.GroupChannelsResponse.data:type_name -> gb28181pro.GroupChannel
2, // 27: gb28181pro.api.List:input_type -> gb28181pro.GetDevicesRequest
1, // 28: gb28181pro.api.GetDevice:input_type -> gb28181pro.GetDeviceRequest
2, // 29: gb28181pro.api.GetDevices:input_type -> gb28181pro.GetDevicesRequest
+1 -1
View File
@@ -1093,7 +1093,7 @@ message GroupChannelsResponse {
int32 code = 1;
string message = 2;
int32 total = 3;
repeated GroupChannel list = 4;
repeated GroupChannel data = 4;
}
//