Camera Information System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.0 KiB

using Cis.Application.Core.Component.MarkSeacher;
namespace Cis.Application.Core;
[ApiDescriptionSettings(CoreInfo.GroupName, Order = CoreInfo.MarkSearchGroupOrder)]
public class MarkSearchService : IDynamicApiController, ITransient
{
#region Attr
private readonly IMarkSearcherServer _markSearcherServer;
#endregion Attr
public MarkSearchService(IMarkSearcherServer markSearcherServer)
{
_markSearcherServer = markSearcherServer;
}
/// <summary>
/// 激活 Searcher
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <returns></returns>
[HttpPost]
public async Task<bool> ActivateSearcher([Required][FromForm] long cameraId)
{
return await _markSearcherServer.ActivateSearcherAsync(cameraId);
}
/// <summary>
/// 解除 Searcher
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <returns></returns>
[HttpPost]
public async Task<bool> DeactivateSearcher([Required][FromForm] long cameraId)
{
return await _markSearcherServer.DeactivateSearcherAsync(cameraId);
}
/// <summary>
/// 是否存在 Searcher
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <returns></returns>
[HttpGet]
public async Task<bool> IsExistsSearcher([Required] long cameraId)
{
return await _markSearcherServer.IsExistsSearcherAsync(cameraId);
}
/// <summary>
/// 激活标签
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <param name="markLabelId">cmMarkLabelId</param>
/// <returns></returns>
[HttpPost]
public async Task<bool> ActivateMarkLabel([Required][FromForm] long cameraId, [Required][FromForm] long markLabelId)
{
return await _markSearcherServer.ActivateMarkLabelAsync(cameraId, markLabelId);
}
/// <summary>
/// 解除标签
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <param name="markLabelId">cmMarkLabelId</param>
/// <returns></returns>
[HttpPost]
public async Task<bool> DeactivateMarkLabel([Required][FromForm] long cameraId, [Required][FromForm] long markLabelId)
{
return await _markSearcherServer.DeactivateMarkLabelAsync(cameraId, markLabelId);
}
/// <summary>
/// 是否存在标签
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <param name="markLabelId">cmMarkLabelId</param>
/// <returns></returns>
[HttpGet]
public async Task<bool> IsExistsMarkLabel([Required] long cameraId, [Required] long markLabelId)
{
return await _markSearcherServer.IsExistsMarkLabelAsync(cameraId, markLabelId);
}
/// <summary>
/// 获取标签计算结果列表
/// </summary>
/// <param name="cameraId">cbCameraId</param>
/// <returns></returns>
[HttpGet]
public async Task<List<MarkLabelCalcResult>> GetMarkLabelCalcResultList([Required] long cameraId)
{
return await _markSearcherServer.GetMarkLabelCalcResultListAsync(cameraId);
}
}