mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
获取线程负载接口返回code字段
简化代码
This commit is contained in:
parent
aef8fb8849
commit
d440c424c4
@ -296,6 +296,7 @@ void installWebApi() {
|
|||||||
obj["delay"] = vecDelay[i++];
|
obj["delay"] = vecDelay[i++];
|
||||||
val["data"].append(obj);
|
val["data"].append(obj);
|
||||||
}
|
}
|
||||||
|
val["code"] = API::Success;
|
||||||
invoker("200 OK", headerOut, val.toStyledString());
|
invoker("200 OK", headerOut, val.toStyledString());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -313,6 +314,7 @@ void installWebApi() {
|
|||||||
obj["delay"] = vecDelay[i++];
|
obj["delay"] = vecDelay[i++];
|
||||||
val["data"].append(obj);
|
val["data"].append(obj);
|
||||||
}
|
}
|
||||||
|
val["code"] = API::Success;
|
||||||
invoker("200 OK", headerOut, val.toStyledString());
|
invoker("200 OK", headerOut, val.toStyledString());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -393,8 +395,6 @@ void installWebApi() {
|
|||||||
API_REGIST(api,getMediaList,{
|
API_REGIST(api,getMediaList,{
|
||||||
CHECK_SECRET();
|
CHECK_SECRET();
|
||||||
//获取所有MediaSource列表
|
//获取所有MediaSource列表
|
||||||
val["code"] = API::Success;
|
|
||||||
val["msg"] = "success";
|
|
||||||
MediaSource::for_each_media([&](const string &schema,
|
MediaSource::for_each_media([&](const string &schema,
|
||||||
const string &vhost,
|
const string &vhost,
|
||||||
const string &app,
|
const string &app,
|
||||||
@ -479,13 +479,9 @@ void installWebApi() {
|
|||||||
//踢掉tcp会话
|
//踢掉tcp会话
|
||||||
auto session = SessionMap::Instance().get(allArgs["id"]);
|
auto session = SessionMap::Instance().get(allArgs["id"]);
|
||||||
if(!session){
|
if(!session){
|
||||||
val["code"] = API::OtherFailed;
|
throw ApiRetException("can not find the target",API::OtherFailed);
|
||||||
val["msg"] = "can not find the target";
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
session->safeShutdown();
|
session->safeShutdown();
|
||||||
val["code"] = API::Success;
|
|
||||||
val["msg"] = "success";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
static auto addStreamProxy = [](const string &vhost,
|
static auto addStreamProxy = [](const string &vhost,
|
||||||
|
Loading…
Reference in New Issue
Block a user