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
db70aec6
Unverified
Commit
db70aec6
authored
Aug 04, 2022
by
dreamisdream
Committed by
GitHub
Aug 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加webapi deleteRecordDirectroy(删除录像文件夹) (#1851)
parent
1491770d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
63 行增加
和
1 行删除
+63
-1
postman/ZLMediaKit.postman_collection.json
+46
-0
server/WebApi.cpp
+17
-1
没有找到文件。
postman/ZLMediaKit.postman_collection.json
查看文件 @
db70aec6
...
...
@@ -946,6 +946,52 @@
"response"
:
[]
},
{
"name"
:
"删除录像文件夹(deleteRecordDirectroy)"
,
"request"
:
{
"method"
:
"GET"
,
"header"
:
[],
"url"
:
{
"raw"
:
"{{ZLMediaKit_URL}}/index/api/deleteRecordDirectroy?secret={{ZLMediaKit_secret}}&vhost={{defaultVhost}}&app=proxy&stream=2&period=2020-01-01"
,
"host"
:
[
"{{ZLMediaKit_URL}}"
],
"path"
:
[
"index"
,
"api"
,
"deleteRecordDirectroy"
],
"query"
:
[
{
"key"
:
"secret"
,
"value"
:
"{{ZLMediaKit_secret}}"
,
"description"
:
"api操作密钥(配置文件配置),如果操作ip是127.0.0.1,则不需要此参数"
},
{
"key"
:
"vhost"
,
"value"
:
"{{defaultVhost}}"
,
"description"
:
"虚拟主机,例如__defaultVhost__"
},
{
"key"
:
"app"
,
"value"
:
"proxy"
,
"description"
:
"应用名,例如 live"
},
{
"key"
:
"stream"
,
"value"
:
"2"
,
"description"
:
"流id,例如 test"
},
{
"key"
:
"period"
,
"value"
:
"2020-01-01"
,
"description"
:
"流的录像日期,格式为2020-01-01,如果不是完整的日期,那么会删除失败"
}
]
}
},
"response"
:
[]
},
{
"name"
:
"开始录制(startRecord)"
,
"request"
:
{
"method"
:
"GET"
,
...
...
server/WebApi.cpp
查看文件 @
db70aec6
...
...
@@ -1332,7 +1332,23 @@ void installWebApi() {
invoker
(
200
,
headerOut
,
val
.
toStyledString
());
});
});
// 删除录像文件夹
// http://127.0.0.1/index/api/deleteRecordDirectroy?vhost=__defaultVhost__&app=live&stream=ss&period=2020-01-01
api_regist
(
"/index/api/deleteRecordDirectroy"
,
[](
API_ARGS_MAP
)
{
CHECK_SECRET
();
CHECK_ARGS
(
"vhost"
,
"app"
,
"stream"
);
auto
record_path
=
Recorder
::
getRecordPath
(
Recorder
::
type_mp4
,
allArgs
[
"vhost"
],
allArgs
[
"app"
],
allArgs
[
"stream"
],
allArgs
[
"customized_path"
]);
auto
period
=
allArgs
[
"period"
];
record_path
=
record_path
+
period
+
"/"
;
int
result
=
File
::
delete_file
(
record_path
.
data
());
if
(
!
result
)
{
record_path
=
"delete error"
;
}
val
[
"code"
]
=
result
;
val
[
"path"
]
=
record_path
.
data
();
});
//获取录像文件夹列表或mp4文件列表
//http://127.0.0.1/index/api/getMp4RecordFile?vhost=__defaultVhost__&app=live&stream=ss&period=2020-01
api_regist
(
"/index/api/getMp4RecordFile"
,
[](
API_ARGS_MAP
){
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论