155 lines
5.5 KiB
C#
155 lines
5.5 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using xCategoryService.Models.Dtos;
|
|
using xCategoryService.Models.Entities;
|
|
using xCategoryService.Providers.Dtos;
|
|
using xModels.Dtos;
|
|
using xPushService.Interfaces;
|
|
|
|
namespace xCategoryService.Interfaces
|
|
{
|
|
public interface IXSubCategoryProviderController : IXBaseProvidedController<XSubCategory, XSubCategoryDto, int, XSubCategoryDtoHub>
|
|
{
|
|
/// <summary>
|
|
/// Check Has Specified Locale or not ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="language"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Resources/{id}/HasLocale")]
|
|
Task<ActionResult<bool>> HasLocale(
|
|
[FromRoute] int id,
|
|
[FromQuery] string language,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Load an Item by all of it's Related Translations ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Resources/{id}")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> GetResource(
|
|
[FromRoute] int id,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Add Item for Specified Language ...
|
|
/// </summary>
|
|
/// <param name="item"></param>
|
|
/// <param name="language"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Resources")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> Add(
|
|
[FromBody] XSubCategoryDto item,
|
|
[FromQuery] string language = null,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Add Item by it's Locales and Reference ...
|
|
/// </summary>
|
|
/// <param name="item"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Resources/AddResource")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> AddResource(
|
|
[FromBody] XSubCategoryResourceDto item,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Remove Item for Specified Language ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="language">if null, Remove All</param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpDelete("Resources/{id}")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> Remove(
|
|
[FromRoute] int id,
|
|
[FromQuery] string language = null,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Update an Item for Specified Language ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="item"></param>
|
|
/// <param name="language"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpPut("Resources/{id}")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> Update(
|
|
[FromRoute] int id,
|
|
[FromBody] XSubCategoryDto item,
|
|
[FromQuery] string language = null,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Refresh a Resource ...
|
|
/// </summary>
|
|
/// <param name="resource"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Resources/Refresh")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> Refresh(
|
|
[FromBody] XSubCategoryResourceDto resource,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Get All Resources ...
|
|
/// </summary>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Resources/All")]
|
|
Task<ActionResult<IEnumerable<XSubCategoryResourceDto>>> GetAllResources(
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Find One Resource ...
|
|
/// </summary>
|
|
/// <param name="query"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Resources/Find/One")]
|
|
Task<ActionResult<XSubCategoryResourceDto>> FindOneResource(
|
|
[FromQuery] string query,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Find Many Resource ...
|
|
/// </summary>
|
|
/// <param name="query"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Resources/Find/Many")]
|
|
Task<ActionResult<IEnumerable<XSubCategoryResourceDto>>> FindManyResource(
|
|
[FromQuery] string query,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Retrieve Resources by Query Pattern ...
|
|
/// </summary>
|
|
/// <param name="query"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Resources/Query")]
|
|
Task<ActionResult<XQueryResult<XSubCategoryResourceDto>>> QueryResources(
|
|
[FromQuery] XQuery query = null,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
}
|
|
} |