last ...
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using xModels.Base;
|
||||
using xPushService.Base;
|
||||
using xPushService.Interfaces;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
public interface IXBaseProvidedHasTag<TEntity, TDto, TKey, THub> : IXBaseProvided<TEntity, TDto, TKey, THub>, IXTagProvided<TEntity, TDto, TKey, THub>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TDto : XBaseEntityDto<TKey>
|
||||
where THub : XBaseDtoHub<TEntity, TDto, TKey>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using xIdentityModels.Models;
|
||||
using xModels.Base;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// a Tag Provided Service is a Model Provider Service which
|
||||
/// can Contains Tags ...
|
||||
/// </summary>
|
||||
public interface IXTagProvided<TEntity, TDto, TKey, THub>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TDto : XBaseEntityDto<TKey>
|
||||
where THub : XBaseDtoHub<TEntity, TDto, TKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// Attach Tag to Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task AttachTag(
|
||||
TKey id,
|
||||
string tag,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Detach Tag of Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task DetachTag(
|
||||
TKey id,
|
||||
string tag,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Attach Tags to Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task AttachTags(
|
||||
TKey id,
|
||||
IEnumerable<string> tags,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Detach Tags of Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task DetachTags(
|
||||
TKey id,
|
||||
IEnumerable<string> tags,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Detach all Attached Tags of Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task DetachTags(
|
||||
TKey id,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get Specified Item Tags ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<string>> GetTags(
|
||||
TKey id,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using xModels.Base;
|
||||
using xPushService.Base;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
public interface IXTagProvidedController<TEntity, TDto, TKey, THub>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TDto : XBaseEntityDto<TKey>
|
||||
where THub : XBaseDtoHub<TEntity, TDto, TKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// Attach Tag to Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{id}/tags/attach")]
|
||||
Task<ActionResult> AttachTag(
|
||||
[FromRoute] TKey id,
|
||||
[FromBody] XBaseValueContainer<string> tag,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Detach Tag of Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{id}/tags/detach")]
|
||||
Task<ActionResult> DetachTag(
|
||||
[FromRoute] TKey id,
|
||||
[FromBody] XBaseValueContainer<string> tag,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Attach Tags to Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{id}/tags/attachs")]
|
||||
Task<ActionResult> AttachTags(
|
||||
[FromRoute] TKey id,
|
||||
[FromBody] XBaseRangeRequest<string> tags,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Detach Tags of Specified Item ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{id}/tags/detachs")]
|
||||
Task<ActionResult> DetachTags(
|
||||
[FromRoute] TKey id,
|
||||
[FromBody] XBaseRangeRequest<string> tags = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get Specified Item Tags ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}/tags")]
|
||||
Task<ActionResult<IEnumerable<string>>> GetTags(
|
||||
[FromRoute] TKey id,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user