Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCheckController ¶
type AuthCheckController struct {
beego.Controller
}
func (*AuthCheckController) Prepare ¶
func (a *AuthCheckController) Prepare()
type DeviceController ¶
type DeviceController struct {
AuthCheckController
}
func (*DeviceController) AppointChannelList ¶
func (d *DeviceController) AppointChannelList()
*
- @api {get} /api/v1/devices/:id/channels 查询指定设备下的通道列表
- @apiVersion 1.0.0
- @apiGroup device
- @apiName AppointChannelList
- @apiDescription 注释::id参数是deviceID
- @apiParam {String} token 授权码
- @apiParam {Number} [page] 页码,分页时默认从1开始
- @apiParam {Number} [limit] 分页大小,默认为100
- @apiParam {String} [status] 按通道状态查询,在线:ON;离线:OFF,状态值不区分大小写,非二者则默认查询所有记录
- @apiParam {bool} [noPage] 是否不分页,true:不分页;false:分页。布尔类型不区分大小写,默认分页
- @apiSuccessExample {json} Response-Example
- {
- "errCode": 200,
- "errMsg": "Success OK",
- "totalCount": 100 //符合status状态的通道总数
- "channelList": [
- {
- "channelID": "ys666_123", //通道ID
- "channelName": "Camera123", //通道名
- "deviceID": "ys666", //设备ID
- "status": "ON" //设备状态:ON-在线;OFF-离线
- "createdAt": "2020-10-20 10-20-10", //创建时间
- "updatedAt": "2020-10-20 10-20-10" //更新时间
- }
- ]
- }
func (*DeviceController) DeviceList ¶
func (d *DeviceController) DeviceList()
*
- @api {get} /api/v1/devices 设备列表
- @apiVersion 1.0.0
- @apiGroup device
- @apiName DeviceList
- @apiParam {String} token 授权码
- @apiParam {Number} [page] 页码,分页时默认从1开始
- @apiParam {Number} [limit] 分页大小,默认100
- @apiParam {String} [status] 按设备状态查询,在线:ON;离线:OFF,状态值不区分大小写,非二者则默认查询所有记录
- @apiParam {bool} [noPage] 是否不分页,true:不分页;false:分页。布尔类型不区分大小写,默认分页
- @apiSuccessExample {json} Response-Example
- {
- "errCode": 200,
- "errMsg": "Success OK",
- "totalCount": 100, //符合status状态的设备总数
- "deviceList": [
- {
- "deviceID": "ys666", //设备ID
- "deviceIP": "192.168.1.169", //设备IP
- "deviceName": "ys", //设备名
- "serialNumber": "666666", //设备序列号
- "status": "ON" //设备状态:ON-在线;OFF-离线
- "createdAt": "2020-10-20 10-20-10", //创建时间
- "updatedAt": "2020-10-20 10-20-10" //更新时间
- }
- ]
- }
type HookController ¶
type HookController struct {
beego.Controller
}
func (*HookController) HTTPAccessHook ¶
func (h *HookController) HTTPAccessHook()
func (*HookController) PublishHook ¶
func (h *HookController) PublishHook()
on_publish body: { "app" : "rtp", "id" : "1C144B0A", "ip" : "192.168.1.101", "params" : "", "port" : 36674, "schema" : "rtp", "stream" : "1C144B0A", "vhost" : "__defaultVhost__" }
func (*HookController) RecordMP4Hook ¶
func (h *HookController) RecordMP4Hook()
func (*HookController) StreamNoneReaderHook ¶
func (h *HookController) StreamNoneReaderHook()
on_stream_none_reader body: { "app" : "rtp", "schema" : "rtp", "stream" : "1C144B0A", "vhost" : "__defaultVhost__" }
func (*HookController) StreamNotFound ¶
func (h *HookController) StreamNotFound()
on_stream_not_found body: { "app" : "rtp", "id" : "140404024416544", "ip" : "192.168.1.169", "params" : "", "port" : 60888, "schema" : "rtmp", "stream" : "76F94898", "vhost" : "__defaultVhost__" }
收到此hook指令表示流媒体重启等操作,此时内存中存在的sessionURL无效,需清除
type PTZController ¶
type PTZController struct {
AuthCheckController
}
*
- @apiDefine ptz 云台控制接口
func (*PTZController) PTZCtrl ¶
func (s *PTZController) PTZCtrl()
* * @api {post} /api/v1/channels/:id/ptz 云台控制 * @apiVersion 1.0.0 * @apiGroup ptz * @apiName PTZCtrl
- @apiDescription 注释::id参数是channelID
- @apiParam {String} token 授权码
- @apiParam {String} [cmd] 方向命令:LEFT RIHGT UP DOWN,空为LEFT
- @apiParam {String} [action] 控制动作:Start、Stop,空为Start
- @apiParam {Number} [speed] 云台控制速度:1-7,空为4
- @apiSuccessExample {json} Success-Response:
- {
- "errCode": 200,
- "errMsg": "Success OK",
- }
type StreamController ¶
type StreamController struct {
AuthCheckController
}
func (*StreamController) StartStream ¶
func (s *StreamController) StartStream()
type SystemController ¶
type SystemController struct {
AuthCheckController
}
func (*SystemController) Login ¶
func (s *SystemController) Login()
*
- @api {post} /api/v1/system/login 登录
- @apiGroup system
- @apiName Login
- @apiParamExample {json} Request-Example:
- {
- "username": "wyd",
- "password": "wyd666" //32位MD5加密小写数据,暂时用户名密码不进行校验
- }
- @apiSuccessExample {json} Success-Response:
- {
- "errCode": 200,
- "errMsg": "Success OK",
- "token": "this is token" //后面所有接口需验证此token,用法是作为URL参数使用
- }
func (*SystemController) Logout ¶
func (s *SystemController) Logout()
*
- @api {get} /api/v1/system/logout 登出
- @apiVersion 1.0.0
- @apiGroup system
- @apiName Logout
- @apiParam {String} token 授权码
- @apiSuccessExample {json} Response-Example
- {
- "errCode": 200,
- "errMsg": "Success OK"
- }
func (*SystemController) SystemInfo ¶
func (s *SystemController) SystemInfo()
*
- @api {get} /api/v1/system/info 获取系统信息
- @apiVersion 1.0.0
- @apiGroup system
- @apiName SystemInfo
- @apiParam {String} token 授权码
- @apiSuccessExample {json} Response-Example
- {
- "errCode": 200,
- "errMsg": "Success OK",
- "cpuUsedPercent": "6%", //CPU使用率
- "virtualMemory": {
- "total": "8079MB", //总内存
- "available": "2565MB", //当前可用内存
- "used": "5514MB", //当前已使用内存
- "usedPercent": "68%" //当前内存使用率
- },
- "network": {
- "uploadSpeed": "0KB/s", //上传速度
- "downloadSpeed": "0KB/s" //下载速度
- },
- "deviceInfo": {
- "totalCount": 0, //设备总数
- "onlineCount": 0 //设备在线总数
- },
- "channelInfo": {
- "totalCount": 0, //通道总数
- "onlineCount": 0 //通道在线总数
- }
- }
Click to show internal directories.
Click to hide internal directories.