NextGB, web demo powerd by vue

This commit is contained in:
chenhaibo
2025-02-03 16:27:46 +08:00
parent 0b7126b12b
commit c80247286e
113 changed files with 16731 additions and 9944 deletions
+83
View File
@@ -0,0 +1,83 @@
package models
import "encoding/xml"
type Record struct {
DeviceID string `xml:"DeviceID" json:"device_id"`
Name string `xml:"Name" json:"name"`
FilePath string `xml:"FilePath" json:"file_path"`
Address string `xml:"Address" json:"address"`
StartTime string `xml:"StartTime" json:"start_time"`
EndTime string `xml:"EndTime" json:"end_time"`
Secrecy int `xml:"Secrecy" json:"secrecy"`
Type string `xml:"Type" json:"type"`
}
// Example XML structure for channel info:
//
// <Item>
// <DeviceID>34020000001320000002</DeviceID>
// <Name>209</Name>
// <Manufacturer>UNIVIEW</Manufacturer>
// <Model>HIC6622-IR@X33-VF</Model>
// <Owner>IPC-B2202.7.11.230222</Owner>
// <CivilCode>CivilCode</CivilCode>
// <Address>Address</Address>
// <Parental>1</Parental>
// <ParentID>75015310072008100002</ParentID>
// <SafetyWay>0</SafetyWay>
// <RegisterWay>1</RegisterWay>
// <Secrecy>0</Secrecy>
// <Status>ON</Status>
// <Longitude>0.0000000</Longitude>
// <Latitude>0.0000000</Latitude>
// <Info>
// <PTZType>1</PTZType>
// <Resolution>6/4/2</Resolution>
// <DownloadSpeed>0</DownloadSpeed>
// </Info>
// </Item>
type ChannelInfo struct {
DeviceID string `json:"device_id"`
ParentID string `json:"parent_id"`
Name string `json:"name"`
Manufacturer string `json:"manufacturer"`
Model string `json:"model"`
Owner string `json:"owner"`
CivilCode string `json:"civil_code"`
Address string `json:"address"`
Port int `json:"port"`
Parental int `json:"parental"`
SafetyWay int `json:"safety_way"`
RegisterWay int `json:"register_way"`
Secrecy int `json:"secrecy"`
IPAddress string `json:"ip_address"`
Status ChannelStatus `json:"status"`
Longitude float64 `json:"longitude"`
Latitude float64 `json:"latitude"`
Info struct {
PTZType int `json:"ptz_type"`
Resolution string `json:"resolution"`
DownloadSpeed string `json:"download_speed"` // Speed levels: 1/2/4/8
} `json:"info"`
// Custom fields
Ssrc string `json:"ssrc"`
}
type ChannelStatus string
type XmlMessageInfo struct {
XMLName xml.Name
CmdType string
SN int
DeviceID string
DeviceName string
Manufacturer string
Model string
Channel string
DeviceList []ChannelInfo `xml:"DeviceList>Item"`
RecordList []*Record `xml:"RecordList>Item"`
SumNum int
}
+80
View File
@@ -0,0 +1,80 @@
package models
type BaseRequest struct {
DeviceID string `json:"device_id"`
ChannelID string `json:"channel_id"`
}
type InviteRequest struct {
BaseRequest
MediaServerId int `json:"media_server_id"`
PlayType int `json:"play_type"` // 0: live, 1: playback, 2: download
SubStream int `json:"sub_stream"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
}
type InviteResponse struct {
ChannelID string `json:"channel_id"`
URL string `json:"url"`
}
type SessionRequest struct {
BaseRequest
URL string `json:"url"`
}
type ByeRequest struct {
SessionRequest
}
type PauseRequest struct {
SessionRequest
}
type ResumeRequest struct {
SessionRequest
}
type SpeedRequest struct {
SessionRequest
Speed float32 `json:"speed"`
}
type PTZControlRequest struct {
BaseRequest
PTZ string `json:"ptz"`
Speed string `json:"speed"`
}
type QueryRecordRequest struct {
BaseRequest
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
}
type MediaServer struct {
Name string `json:"name"`
Type string `json:"type"`
IP string `json:"ip"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
Secret string `json:"secret"`
IsDefault int `json:"is_default"`
}
type MediaServerRequest struct {
MediaServer
}
type MediaServerResponse struct {
MediaServer
ID int `json:"id"`
CreatedAt string `json:"created_at"`
}
type CommonResponse struct {
Code int `json:"code"`
Data interface{} `json:"data"`
}