Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
a1000da7
Commit
a1000da7
authored
2 years ago
by
xiongguangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add get version restful api
parent
6382fcb3
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
2 行删除
+43
-2
postman/ZLMediaKit.postman_collection.json
+27
-2
server/WebApi.cpp
+16
-0
没有找到文件。
postman/ZLMediaKit.postman_collection.json
查看文件 @
a1000da7
{
"info"
:
{
"_postman_id"
:
"
fe6cdfbd-531d-45e6-87e5-d460ce9e6328
"
,
"_postman_id"
:
"
4626d766-16b5-4255-89ba-f7614de2398c
"
,
"name"
:
"ZLMediaKit"
,
"description"
:
"媒体服务器"
,
"schema"
:
"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
...
...
@@ -1087,7 +1087,7 @@
},
{
"key"
:
"speed"
,
"value"
:
2.0
,
"value"
:
"2.0"
,
"description"
:
"要设置的录像倍速"
}
]
...
...
@@ -1690,6 +1690,31 @@
}
},
"response"
:
[]
},
{
"name"
:
"获取版本信息(version)"
,
"request"
:
{
"method"
:
"GET"
,
"header"
:
[],
"url"
:
{
"raw"
:
"{{ZLMediaKit_URL}}/index/api/version?secret={{ZLMediaKit_secret}}"
,
"host"
:
[
"{{ZLMediaKit_URL}}"
],
"path"
:
[
"index"
,
"api"
,
"version"
],
"query"
:
[
{
"key"
:
"secret"
,
"value"
:
"{{ZLMediaKit_secret}}"
}
]
}
},
"response"
:
[]
}
],
"event"
:
[
...
...
This diff is collapsed.
Click to expand it.
server/WebApi.cpp
查看文件 @
a1000da7
...
...
@@ -48,6 +48,10 @@
#include <tchar.h>
#endif // _WIN32
#if defined(ENABLE_VERSION)
#include "version.h"
#endif
using
namespace
std
;
using
namespace
Json
;
using
namespace
toolkit
;
...
...
@@ -1542,6 +1546,18 @@ void installWebApi() {
});
#endif
#if defined(ENABLE_VERSION)
api_regist
(
"/index/api/version"
,[](
API_ARGS_MAP_ASYNC
){
CHECK_SECRET
();
Value
ver
;
ver
[
"buildTime"
]
=
BUILD_TIME
;
ver
[
"branchName"
]
=
BRANCH_NAME
;
ver
[
"commitHash"
]
=
COMMIT_HASH
;
val
[
"data"
]
=
ver
;
invoker
(
200
,
headerOut
,
val
.
toStyledString
());
});
#endif
////////////以下是注册的Hook API////////////
api_regist
(
"/index/hook/on_publish"
,[](
API_ARGS_JSON
){
//开始推流事件
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论