|
|
|
|
@ -78,12 +78,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<Response<int>> ExchangeCamera(string camera,int position,string videoId)
|
|
|
|
|
public async Task<Response<int>> ExchangeCamera(Zhibo zhiboReq)
|
|
|
|
|
{
|
|
|
|
|
Response<int> response = new Response<int>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var videoids = videoId.Split("/");
|
|
|
|
|
var videoids = zhiboReq.videoId.Split("/");
|
|
|
|
|
var topicRequest = $"thing/product/" + videoids[0] +"/services";
|
|
|
|
|
var requestData = new
|
|
|
|
|
{
|
|
|
|
|
@ -93,8 +93,8 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
|
|
data = new
|
|
|
|
|
{
|
|
|
|
|
camera_position = position,
|
|
|
|
|
video_id = videoId
|
|
|
|
|
camera_position = zhiboReq.position,
|
|
|
|
|
video_id = zhiboReq.videoId
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
string payload = JsonSerializer.Serialize(requestData);
|
|
|
|
|
@ -128,13 +128,13 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<Response<int>> SetCamera(string cameraType, string videoId)
|
|
|
|
|
public async Task<Response<int>> SetCamera(Zhibo zhiboReq)
|
|
|
|
|
{
|
|
|
|
|
Response<int> response = new Response<int>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var videoids = videoId.Split("/");
|
|
|
|
|
var videoids = zhiboReq.videoId.Split("/");
|
|
|
|
|
var topicRequest = $"thing/product/" + videoids[0] + "/services";
|
|
|
|
|
var requestData = new
|
|
|
|
|
{
|
|
|
|
|
@ -144,8 +144,8 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
|
|
data = new
|
|
|
|
|
{
|
|
|
|
|
video_type = cameraType,
|
|
|
|
|
video_id = videoId
|
|
|
|
|
video_type = zhiboReq.cameraType,
|
|
|
|
|
video_id = zhiboReq.videoId
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
string payload = JsonSerializer.Serialize(requestData);
|
|
|
|
|
@ -179,12 +179,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<Response<int>> SetCameraVideo(int videoQuality, string videoId)
|
|
|
|
|
public async Task<Response<int>> SetCameraVideo(Zhibo zhiboReq)
|
|
|
|
|
{
|
|
|
|
|
Response<int> response = new Response<int>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var videoids = videoId.Split("/");
|
|
|
|
|
var videoids = zhiboReq.videoId.Split("/");
|
|
|
|
|
var topicRequest = $"thing/product/" + videoids[0] + "/services";
|
|
|
|
|
var requestData = new
|
|
|
|
|
{
|
|
|
|
|
@ -194,8 +194,8 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
|
|
data = new
|
|
|
|
|
{
|
|
|
|
|
video_quality = videoQuality,
|
|
|
|
|
video_id = videoId
|
|
|
|
|
video_quality = zhiboReq.videoQuality,
|
|
|
|
|
video_id = zhiboReq.videoId
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
string payload = JsonSerializer.Serialize(requestData);
|
|
|
|
|
@ -229,12 +229,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<Response<int>> EndLive( string videoId)
|
|
|
|
|
public async Task<Response<int>> EndLive( Zhibo zhiboReq)
|
|
|
|
|
{
|
|
|
|
|
Response<int> response = new Response<int>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var videoids = videoId.Split("/");
|
|
|
|
|
var videoids = zhiboReq.videoId.Split("/");
|
|
|
|
|
var topicRequest = $"thing/product/" + videoids[0] + "/services";
|
|
|
|
|
var requestData = new
|
|
|
|
|
{
|
|
|
|
|
@ -245,7 +245,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
data = new
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
video_id = videoId
|
|
|
|
|
video_id = zhiboReq.videoId
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
string payload = JsonSerializer.Serialize(requestData);
|
|
|
|
|
@ -282,12 +282,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<Response<int>> StartLive(string videoId,int urlType,string url,int quality)
|
|
|
|
|
public async Task<Response<int>> StartLive(Zhibo zhiboReq)
|
|
|
|
|
{
|
|
|
|
|
Response<int> response = new Response<int>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var videoids = videoId.Split("/");
|
|
|
|
|
var videoids = zhiboReq.videoId.Split("/");
|
|
|
|
|
var topicRequest = $"thing/product/" + videoids[0] + "/services";
|
|
|
|
|
var requestData = new
|
|
|
|
|
{
|
|
|
|
|
@ -297,10 +297,10 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
|
|
|
timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
|
|
data = new
|
|
|
|
|
{
|
|
|
|
|
url_type = urlType,
|
|
|
|
|
url = url,
|
|
|
|
|
video_quality = quality,
|
|
|
|
|
video_id = videoId
|
|
|
|
|
url_type = zhiboReq.urlType,
|
|
|
|
|
url = zhiboReq.url,
|
|
|
|
|
video_quality = zhiboReq.videoQuality,
|
|
|
|
|
video_id = zhiboReq.videoId
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
string payload = JsonSerializer.Serialize(requestData);
|
|
|
|
|
|