|
|
|
|
@ -76,16 +76,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public GbTaskSubmitResultDto GbTaskSubmit(GbTaskSubmitDto gbTaskSubmit)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/submit";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
string json = JsonConvert.SerializeObject(gbTaskSubmit);
|
|
|
|
|
Console.WriteLine($"请求报文:{json}");
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(gbTaskSubmit).Result.GetJsonAsync<GbTaskSubmitResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(gbTaskSubmit).Result.GetJsonAsync<GbTaskSubmitResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -98,14 +89,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public GbContinueTaskResultDto GbContinueTask(GbContinueTaskDto gbContinueTask)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/extend/continue";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(gbContinueTask).Result.GetJsonAsync<GbContinueTaskResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(gbContinueTask).Result.GetJsonAsync<GbContinueTaskResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -118,14 +102,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public GbCancelTaskResultDto GbCancelTask(GbCancelTaskDto gbCancelTask)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/cancel";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(gbCancelTask).Result.GetJsonAsync<GbCancelTaskResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(gbCancelTask).Result.GetJsonAsync<GbCancelTaskResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -138,14 +115,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public TaskGroupResultDto TaskGroup(TaskGroupDto taskGroup)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/group";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(taskGroup).Result.GetJsonAsync<TaskGroupResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(taskGroup).Result.GetJsonAsync<TaskGroupResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -158,14 +128,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public TaskPriorityResultDto SetTaskPriority(TaskPriorityDto taskPriority)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/priority";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(taskPriority).Result.GetJsonAsync<TaskPriorityResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(taskPriority).Result.GetJsonAsync<TaskPriorityResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -178,14 +141,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public ZonePauseResultDto ZonePause(ZonePauseDto zonePause)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/zone/pause";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(zonePause).Result.GetJsonAsync<ZonePauseResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(zonePause).Result.GetJsonAsync<ZonePauseResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -198,14 +154,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public ZoneHomingResultDto ZoneHoming(ZoneHomingDto zoneHoming)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/zone/homing";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(zoneHoming).Result.GetJsonAsync<ZoneHomingResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(zoneHoming).Result.GetJsonAsync<ZoneHomingResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -218,14 +167,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public ZoneBanishResultDto ZoneBanish(ZoneBanishDto zoneBanish)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/zone/banish";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(zoneBanish).Result.GetJsonAsync<ZoneBanishResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(zoneBanish).Result.GetJsonAsync<ZoneBanishResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -238,14 +180,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public ZoneBlockadeResultDto ZoneBlockade(ZoneBlockadeDto zoneBlockade)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/zone/blockade";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(zoneBlockade).Result.GetJsonAsync<ZoneBlockadeResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(zoneBlockade).Result.GetJsonAsync<ZoneBlockadeResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -258,14 +193,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public CarrierBindResultDto CarrierBind(CarrierBindDto carrierBind)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/carrier/bind";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(carrierBind).Result.GetJsonAsync<CarrierBindResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(carrierBind).Result.GetJsonAsync<CarrierBindResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -278,14 +206,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public CarrierUnbindResultDto CarrierUnbind(CarrierUnbindDto carrierUnbind)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/carrier/unbind";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(carrierUnbind).Result.GetJsonAsync<CarrierUnbindResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(carrierUnbind).Result.GetJsonAsync<CarrierUnbindResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -298,14 +219,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public SiteBindResultDto SiteBind(SiteBindDto siteBind)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/site/bind";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(siteBind).Result.GetJsonAsync<SiteBindResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(siteBind).Result.GetJsonAsync<SiteBindResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -318,14 +232,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public CarrierLockResultDto CarrierLock(CarrierLockDto carrierLock)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/carrier/lock";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(carrierLock).Result.GetJsonAsync<CarrierLockResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(carrierLock).Result.GetJsonAsync<CarrierLockResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -338,14 +245,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public SiteLockResultDto SiteLock(SiteLockDto siteLock)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/site/lock";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(siteLock).Result.GetJsonAsync<SiteLockResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(siteLock).Result.GetJsonAsync<SiteLockResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -358,14 +258,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public PreTaskResultDto PreTask(PreTaskDto preTask)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/pretask";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(preTask).Result.GetJsonAsync<PreTaskResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(preTask).Result.GetJsonAsync<PreTaskResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -378,14 +271,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public QueryTaskResultDto QueryTaskStatus(QueryTaskDto queryTask)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/task/query";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(queryTask).Result.GetJsonAsync<QueryTaskResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(queryTask).Result.GetJsonAsync<QueryTaskResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -398,14 +284,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public QueryRobotResultDto QueryRobotStatus(QueryRobotDto queryRobot)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/robot/query";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(queryRobot).Result.GetJsonAsync<QueryRobotResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(queryRobot).Result.GetJsonAsync<QueryRobotResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -418,14 +297,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public QueryCarrierResultDto QueryCarrierStatus(QueryCarrierDto queryCarrier)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/carrier/query";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(queryCarrier).Result.GetJsonAsync<QueryCarrierResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(queryCarrier).Result.GetJsonAsync<QueryCarrierResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -438,14 +310,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public MatLabelBindResultDto MatLabelBind(MatLabelBindDto matLabelBind)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/matlabel/bind";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(matLabelBind).Result.GetJsonAsync<MatLabelBindResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(matLabelBind).Result.GetJsonAsync<MatLabelBindResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -458,14 +323,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public MatLabelUnbindResultDto MatLabelUnbind(MatLabelUnbindDto matLabelUnbind)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/matlabel/unbind";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(matLabelUnbind).Result.GetJsonAsync<MatLabelUnbindResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(matLabelUnbind).Result.GetJsonAsync<MatLabelUnbindResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -478,14 +336,7 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public EquipmentNotifyResultDto EquipmentNotify(EquipmentNotifyDto equipmentNotify)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/spi/wcs/robot/eqpt/notify";
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(equipmentNotify).Result.GetJsonAsync<EquipmentNotifyResultDto>().Result;
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(equipmentNotify).Result.GetJsonAsync<EquipmentNotifyResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -498,14 +349,23 @@ namespace Sln.Wcs.HikRoBotSdk
|
|
|
|
|
public EquipmentNotifyResultDto EquipmentNotifyGbt(EquipmentNotifyDto equipmentNotify)
|
|
|
|
|
{
|
|
|
|
|
string url = $"{hikRoBotConfig.api}/spi/wcs/robot/eqpt/notifyGbt";
|
|
|
|
|
return GenRequestHeader(url).PostJsonAsync(equipmentNotify).Result.GetJsonAsync<EquipmentNotifyResultDto>().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 生成请求头
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="url"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private IFlurlRequest GenRequestHeader(string url)
|
|
|
|
|
{
|
|
|
|
|
var request = url
|
|
|
|
|
.WithHeader("Content-Type", hikRoBotConfig.contentType)
|
|
|
|
|
.WithHeader("User-Agent", hikRoBotConfig.userAgent)
|
|
|
|
|
.WithHeader("X-lr-request-id", System.Guid.NewGuid().ToString("N"))
|
|
|
|
|
.WithHeader("X-lr-version", hikRoBotConfig.xlrVersion)
|
|
|
|
|
.WithTimeout(TimeSpan.FromSeconds(15));
|
|
|
|
|
|
|
|
|
|
return request.PostJsonAsync(equipmentNotify).Result.GetJsonAsync<EquipmentNotifyResultDto>().Result;
|
|
|
|
|
return request;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|