last ...
This commit is contained in:
@@ -1,347 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using xCommons.Configurations;
|
|
||||||
using xCommons.Extensions;
|
|
||||||
using xExceptions.Constants;
|
|
||||||
using xModels.Dtos;
|
|
||||||
using xStringService.Extensions;
|
|
||||||
using xStringService.Interfaces;
|
|
||||||
using xStringService.Models.Dtos;
|
|
||||||
|
|
||||||
namespace xStringService.Base
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// a Base Class for Handling Resources Based on Specified Types on
|
|
||||||
/// String Resources Use ...
|
|
||||||
/// such as:
|
|
||||||
/// - Terms and Conditions;
|
|
||||||
/// - Contents;
|
|
||||||
/// - News;
|
|
||||||
/// - etc ...
|
|
||||||
/// </summary>
|
|
||||||
public abstract class XBaseStringResourceProvider : IXBaseStringResourceProvider
|
|
||||||
{
|
|
||||||
//
|
|
||||||
#region Props ...
|
|
||||||
public string Prefix { get; }
|
|
||||||
public IXStringProvider Provider { get; }
|
|
||||||
public XAppConfiguration AppConfiguration { get; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Constructor ...
|
|
||||||
public XBaseStringResourceProvider(
|
|
||||||
string prefix,
|
|
||||||
IXStringProvider provider,
|
|
||||||
XAppConfiguration appConfiguration
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Prefix = prefix;
|
|
||||||
Provider = provider;
|
|
||||||
AppConfiguration = appConfiguration;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Prepare Resource Title by Given Data ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string GetResourceTitle(string suffix)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
string result = "";
|
|
||||||
|
|
||||||
//
|
|
||||||
if (suffix.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
result = $"{Prefix}_${suffix}";
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Locales ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <param name="locales"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IEnumerable<XStringDto>> Add(
|
|
||||||
string suffix,
|
|
||||||
IEnumerable<XLocaleResourceDto> locales
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
var has =
|
|
||||||
locales.HasChild() &&
|
|
||||||
!suffix.IsNullOrEmpty();
|
|
||||||
if (!has)
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare Resource ID ...
|
|
||||||
string resourceID = GetResourceTitle(suffix);
|
|
||||||
var result = await locales.SelectAsync(async l =>
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Normalize Language ...
|
|
||||||
if (l.Language.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
l.Language = AppConfiguration.DefaultLanguage;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare Model for Add ...
|
|
||||||
var model = new XStringDto
|
|
||||||
{
|
|
||||||
Language = l.Language,
|
|
||||||
TranslatedValue = l.Value,
|
|
||||||
ResourceTitle = resourceID,
|
|
||||||
};
|
|
||||||
model = await Provider.AddEntity(model);
|
|
||||||
return model;
|
|
||||||
});
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Specified Locals ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="locales"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IEnumerable<XStringDto>> AddOrUpdate(
|
|
||||||
string resource,
|
|
||||||
IEnumerable<XLocaleResourceDto> locales
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
bool isValid =
|
|
||||||
locales.HasChild() &&
|
|
||||||
!resource.IsNullOrEmpty() &&
|
|
||||||
locales.All(l => !l.Value.IsNullOrEmpty() && !l.Language.IsNullOrEmpty());
|
|
||||||
if (!isValid)
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check Resource ...
|
|
||||||
isValid = resource.Contains(Prefix);
|
|
||||||
if (!isValid)
|
|
||||||
{
|
|
||||||
XException.NotAllowed.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await locales.SelectAsync(async l =>
|
|
||||||
await Provider.AddOrUpdateByLocaleResource(
|
|
||||||
item: l,
|
|
||||||
resource: resource
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get Specified Locale ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<XLocaleResourceDto> GetLocale(
|
|
||||||
string suffix,
|
|
||||||
string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Normalize ...
|
|
||||||
if (language.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
language = AppConfiguration.DefaultLanguage;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
if (suffix.IsNullOrEmpty() || language.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare Resource Title ...
|
|
||||||
string resource = GetResourceTitle(suffix);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check Resource Exists ...
|
|
||||||
var isExists = await Provider.IsResourceExists(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
if (!isExists)
|
|
||||||
{
|
|
||||||
XException.NotFound.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Retrieve and Validate Dto Model ...
|
|
||||||
var model = await Provider.Get(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
if (model.IsNullOrDefault())
|
|
||||||
{
|
|
||||||
XException.ActionFailed.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare Result ...
|
|
||||||
var result = model
|
|
||||||
.ToXLocaleResourceDto();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<XResourceDto> AddResource(
|
|
||||||
string suffix,
|
|
||||||
XResourceDto item
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
if (suffix.IsNullOrEmpty() ||
|
|
||||||
item.IsNull() ||
|
|
||||||
!item.Locales.HasChild() ||
|
|
||||||
!item.Locales.All(l => !l.Value.IsNullOrEmpty()))
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare Resource ID ...
|
|
||||||
var addedLocals = await Add(suffix, item.Locales);
|
|
||||||
if (!addedLocals.HasChild())
|
|
||||||
{
|
|
||||||
XException.ActionFailed.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await GetResource(suffix);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get Resources of Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<XResourceDto> GetResource(string suffix)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
if (suffix.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare Resource ID ...
|
|
||||||
string resourceID = GetResourceTitle(suffix);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Prepare ...
|
|
||||||
var result = await Provider.GetResource(resourceID);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Suffix Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task Remove(string suffix)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
if (suffix.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
var resourceID = GetResourceTitle(suffix);
|
|
||||||
await Provider.RemoveResource(resourceID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task Remove(
|
|
||||||
string resource,
|
|
||||||
string language
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Validate ...
|
|
||||||
bool isValid =
|
|
||||||
!resource.IsNullOrEmpty() &&
|
|
||||||
!language.IsNullOrEmpty();
|
|
||||||
if (!isValid)
|
|
||||||
{
|
|
||||||
XException.InvalidArgs.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check resource ID Contains Prefix ...
|
|
||||||
isValid = resource.Contains(Prefix);
|
|
||||||
if (!isValid)
|
|
||||||
{
|
|
||||||
XException.NotAllowed.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check Exists ...
|
|
||||||
var isExists = await Provider.IsResourceExists(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
if (!isExists)
|
|
||||||
{
|
|
||||||
XException.NotFound.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Remove Resource ...
|
|
||||||
await Provider.Remove(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,878 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using xCommons.Configurations;
|
|
||||||
using xCommons.Extensions;
|
|
||||||
using xCommons.Providers;
|
|
||||||
using xIdentityService.Controllers;
|
|
||||||
using xIdentityService.Interfaces;
|
|
||||||
using xModels.Dtos;
|
|
||||||
using xStringService.Interfaces;
|
|
||||||
using xStringService.Models.Dtos;
|
|
||||||
|
|
||||||
namespace xStringService.Controllers
|
|
||||||
{
|
|
||||||
public abstract class XStringServiceControllerBase : XIBaseProviderController, IXStringServiceControllerActions
|
|
||||||
{
|
|
||||||
//
|
|
||||||
#region Props ...
|
|
||||||
public IXStringProvider StringProvider { get; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Constructor ...
|
|
||||||
public XStringServiceControllerBase(
|
|
||||||
ILogger logger,
|
|
||||||
IXStringProvider stringProvider,
|
|
||||||
XAppConfiguration appConfiguration,
|
|
||||||
IXIdentityProvider identityProvider,
|
|
||||||
XValidationProvider validationProvider
|
|
||||||
) : base(
|
|
||||||
logger,
|
|
||||||
appConfiguration,
|
|
||||||
identityProvider,
|
|
||||||
validationProvider
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
StringProvider = stringProvider;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Retrievers ...
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve all Exists Languages ...
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("Languages")]
|
|
||||||
public virtual async Task<ActionResult<IEnumerable<string>>> GetLanguages()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.GetLanguages();
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check Specified Resource Exists or not ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("IsResourceExists")]
|
|
||||||
public virtual async Task<ActionResult<bool>> IsResourceExists(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.IsResourceExists(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> Get(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.Get(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Translation of Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("ResourceValue")]
|
|
||||||
public virtual async Task<ActionResult<string>> GetResourceValue(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.GetResourceValue(
|
|
||||||
resource: resource,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve an Specified Resource Items ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("Resources")]
|
|
||||||
public virtual async Task<ActionResult<IEnumerable<XStringDto>>> GetResources(
|
|
||||||
[FromQuery] string resource
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.GetResources(resource);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Resource Items as XResourceDto Presentation ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("AsResource")]
|
|
||||||
public virtual async Task<ActionResult<XResourceDto>> GetResource(
|
|
||||||
[FromQuery] string resource
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.GetResource(resource);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Query ...
|
|
||||||
/// <summary>
|
|
||||||
/// Query Resource IDs ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("QueryResourceIds")]
|
|
||||||
public virtual ActionResult<XQueryResult<string>> QueryResourceIds(
|
|
||||||
[FromQuery] XQuery query
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = StringProvider
|
|
||||||
.QueryResourceIds(query);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Query Specified Language Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("QueryLanguageResources")]
|
|
||||||
public virtual async Task<ActionResult<XQueryResult<XStringDto>>> QueryLanguageResources(
|
|
||||||
[FromQuery] XQuery query,
|
|
||||||
[FromQuery] string language = null //
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.QueryLanguageResources(
|
|
||||||
query: query,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Query Locale Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("QueryLocaleResources")]
|
|
||||||
public virtual async Task<ActionResult<XQueryResult<XLocaleResourceDto>>> QueryLocaleResources(
|
|
||||||
[FromQuery] XQuery query,
|
|
||||||
[FromQuery] string language = null //
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.QueryLocaleResources(
|
|
||||||
query: query,
|
|
||||||
language: language
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Add/Update Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("Add")]
|
|
||||||
public virtual async Task<ActionResult<bool>> Add(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string value,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.Add(
|
|
||||||
value: value,
|
|
||||||
resource: resource,
|
|
||||||
language: language,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("Update")]
|
|
||||||
public virtual async Task<ActionResult<bool>> Update(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string value,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.Update(
|
|
||||||
value: value,
|
|
||||||
resource: resource,
|
|
||||||
language: language,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("AddOrUpdate")]
|
|
||||||
public virtual async Task<ActionResult<bool>> AddOrUpdate(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string value,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.AddOrUpdate(
|
|
||||||
value: value,
|
|
||||||
resource: resource,
|
|
||||||
language: language,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("AddModel")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> AddEntity(
|
|
||||||
[FromBody] XStringDto item
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider.AddEntity(
|
|
||||||
item: item,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Specified Entity ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("UpdateModel")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> UpdateEntity(
|
|
||||||
[FromBody] XStringDto item
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.UpdateEntity(
|
|
||||||
item: item,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Specified Entitiy ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("AddOrUpdateModel")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> AddOrUpdateEntity(
|
|
||||||
[FromBody] XStringDto item
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.AddOrUpdateEntity(
|
|
||||||
item: item,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Locale Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("AddLocale")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> AddByLocaleResource(
|
|
||||||
[FromBody] XLocaleResourceDto item,
|
|
||||||
[FromQuery] string resource
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.AddByLocaleResource(
|
|
||||||
item: item,
|
|
||||||
resource: resource,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Specified Locale Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("UpdateLocale")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> UpdateByLocaleResource(
|
|
||||||
[FromBody] XLocaleResourceDto item,
|
|
||||||
[FromQuery] string resource
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.UpdateByLocaleResource(
|
|
||||||
item: item,
|
|
||||||
resource: resource,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Resource By Locale ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("AddOrUpdateLocale")]
|
|
||||||
public virtual async Task<ActionResult<XStringDto>> AddOrUpdateByLocaleResource(
|
|
||||||
[FromBody] XLocaleResourceDto item,
|
|
||||||
[FromQuery] string resource
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.AddOrUpdateByLocaleResource(
|
|
||||||
item: item,
|
|
||||||
resource: resource,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update all XResourceDto(s) Locales ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("AddResource")]
|
|
||||||
public virtual async Task<ActionResult<IEnumerable<XStringDto>>> AddByResource(
|
|
||||||
[FromBody] XResourceDto item
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.AddByResource(
|
|
||||||
item: item,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Remove Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Specified Language's Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("RemoveLanguage")]
|
|
||||||
public virtual async Task<ActionResult> RemoveLanguageResources(
|
|
||||||
[FromQuery] string language
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
await StringProvider
|
|
||||||
.RemoveLanguageResources(
|
|
||||||
language: language,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Specified Resource Ids instances ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("RemoveLocales")]
|
|
||||||
public virtual async Task<ActionResult<IEnumerable<XStringDto>>> RemoveResource(
|
|
||||||
[FromQuery] string resource
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.RemoveResource(
|
|
||||||
resource: resource,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpDelete("Remove")]
|
|
||||||
public virtual async Task<ActionResult<bool>> Remove(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
var result = await StringProvider
|
|
||||||
.Remove(
|
|
||||||
resource: resource,
|
|
||||||
language: language,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok(result.
|
|
||||||
ToDynamicObject());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Resource of Specified XResourceDto ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("RemoveResource")]
|
|
||||||
public virtual async Task<ActionResult> RemoveByResource(
|
|
||||||
[FromBody] XResourceDto item
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Do ...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var connectionId = GetConnectionId();
|
|
||||||
|
|
||||||
//
|
|
||||||
await StringProvider
|
|
||||||
.RemoveByResource(
|
|
||||||
item: item,
|
|
||||||
connectionId: connectionId
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
var result = GetExceptionActionResult(ex);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,8 +2,6 @@ using System;
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using xExceptions.Constants;
|
using xExceptions.Constants;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xStringService.Interfaces;
|
|
||||||
using xStringService.Providers;
|
|
||||||
using xStringService.Interfaces.Entities;
|
using xStringService.Interfaces.Entities;
|
||||||
|
|
||||||
namespace xStringService.DI
|
namespace xStringService.DI
|
||||||
@@ -87,9 +85,9 @@ namespace xStringService.DI
|
|||||||
throw exception;
|
throw exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// //
|
||||||
// Main Provider ...
|
// // Main Provider ...
|
||||||
services.Add(new ServiceDescriptor(typeof(IXStringProvider), typeof(XStringProvider), lifeTime));
|
// services.Add(new ServiceDescriptor(typeof(IXStringProvider), typeof(XStringProvider), lifeTime));
|
||||||
|
|
||||||
//
|
//
|
||||||
Log("AddStringService Succeed ...");
|
Log("AddStringService Succeed ...");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using xDataService.Events;
|
using xDataService.Providers;
|
||||||
using xStringService.Interfaces.Entities;
|
using xStringService.Interfaces.Entities;
|
||||||
using xStringService.Models.Entities;
|
using xStringService.Models.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using xCommons.Configurations;
|
|
||||||
using xModels.Dtos;
|
|
||||||
using xStringService.Models.Dtos;
|
|
||||||
|
|
||||||
namespace xStringService.Interfaces
|
|
||||||
{
|
|
||||||
public interface IXBaseStringResourceProvider
|
|
||||||
{
|
|
||||||
//
|
|
||||||
#region Props ...
|
|
||||||
string Prefix { get; }
|
|
||||||
IXStringProvider Provider { get; }
|
|
||||||
XAppConfiguration AppConfiguration { get; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Prepare Resource Title by Given Data ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
string GetResourceTitle(string suffix);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Locales ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <param name="locales"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<XStringDto>> Add(
|
|
||||||
string suffix,
|
|
||||||
IEnumerable<XLocaleResourceDto> locales
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Specified Locals ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="locales"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<XStringDto>> AddOrUpdate(
|
|
||||||
string resource,
|
|
||||||
IEnumerable<XLocaleResourceDto> locales
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get Specified Locale ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XLocaleResourceDto> GetLocale(
|
|
||||||
string suffix,
|
|
||||||
string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XResourceDto> AddResource(
|
|
||||||
string suffix,
|
|
||||||
XResourceDto item
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get Resources of Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XResourceDto> GetResource(string suffix);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Suffix Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="suffix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task Remove(string suffix);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task Remove(
|
|
||||||
string resource,
|
|
||||||
string language
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,307 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.SignalR;
|
|
||||||
using xCommons.Configurations;
|
|
||||||
using xDataService.Configuration;
|
|
||||||
using xModels.Dtos;
|
|
||||||
using xStringService.Hubs;
|
|
||||||
using xStringService.Interfaces.Entities;
|
|
||||||
using xStringService.Models.Dtos;
|
|
||||||
using xStringService.Models.Entities;
|
|
||||||
|
|
||||||
namespace xStringService.Interfaces
|
|
||||||
{
|
|
||||||
public interface IXStringProvider
|
|
||||||
{
|
|
||||||
//
|
|
||||||
#region Props ...
|
|
||||||
IHubContext<XStringEntityHub> Hub { get; }
|
|
||||||
IXStringRepository Repository { get; }
|
|
||||||
XAppConfiguration AppConfiguration { get; }
|
|
||||||
XDataServiceConfiguration DataConfiguration { get; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Retrievers ...
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve all Exists Languages ...
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<string>> GetLanguages();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check Specified Resource Exists or not ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> IsResourceExists(
|
|
||||||
string resource,
|
|
||||||
string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> Get(
|
|
||||||
string resource,
|
|
||||||
string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Translation of Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> GetResourceValue(
|
|
||||||
string resource,
|
|
||||||
string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve an Specified Resource Items ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<XStringDto>> GetResources(string resource);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Resource Items as XResourceDto Presentation ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XResourceDto> GetResource(string resource);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Query ...
|
|
||||||
/// <summary>
|
|
||||||
/// Query Resource IDs ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
XQueryResult<string> QueryResourceIds(XQuery query);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Query Specified Language Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XQueryResult<XStringDto>> QueryLanguageResources(
|
|
||||||
XQuery query,
|
|
||||||
string language = null //
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Query Locale Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XQueryResult<XLocaleResourceDto>> QueryLocaleResources(
|
|
||||||
XQuery query,
|
|
||||||
string language = null //
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Conditional Query Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="condition"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XQueryResult<XStringDto>> ConditionalQueryResources(
|
|
||||||
XQuery query,
|
|
||||||
Expression<Func<XString, bool>> condition,
|
|
||||||
string language = null
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Add/Update Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> Add(
|
|
||||||
string resource,
|
|
||||||
string value,
|
|
||||||
string language = null,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> Update(
|
|
||||||
string resource,
|
|
||||||
string value,
|
|
||||||
string language = null,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> AddOrUpdate(
|
|
||||||
string resource,
|
|
||||||
string value,
|
|
||||||
string language = null,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> AddEntity(
|
|
||||||
XStringDto item,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Specified Entity ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> UpdateEntity(
|
|
||||||
XStringDto item,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Specified Entitiy ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> AddOrUpdateEntity(
|
|
||||||
XStringDto item,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Locale Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> AddByLocaleResource(
|
|
||||||
XLocaleResourceDto item,
|
|
||||||
string resource,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Specified Locale Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> UpdateByLocaleResource(
|
|
||||||
XLocaleResourceDto item,
|
|
||||||
string resource,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Resource By Locale ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<XStringDto> AddOrUpdateByLocaleResource(
|
|
||||||
XLocaleResourceDto item,
|
|
||||||
string resource,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update all XResourceDto(s) Locales ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<XStringDto>> AddByResource(
|
|
||||||
XResourceDto item,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Remove Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Specified Language's Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task RemoveLanguageResources(
|
|
||||||
string language,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Specified Resource Ids instances ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<XStringDto>> RemoveResource(
|
|
||||||
string resource,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> Remove(
|
|
||||||
string resource,
|
|
||||||
string language = null,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Resource of Specified XResourceDto ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="connectionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task RemoveByResource(
|
|
||||||
XResourceDto item,
|
|
||||||
string connectionId = null
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,257 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xModels.Dtos;
|
|
||||||
using xStringService.Models.Dtos;
|
|
||||||
|
|
||||||
namespace xStringService.Interfaces
|
|
||||||
{
|
|
||||||
public interface IXStringServiceControllerActions
|
|
||||||
{
|
|
||||||
//
|
|
||||||
#region Retrievers ...
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve all Exists Languages ...
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<IEnumerable<string>>> GetLanguages();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check Specified Resource Exists or not ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<bool>> IsResourceExists(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> Get(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Translation of Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<string>> GetResourceValue(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve an Specified Resource Items ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<IEnumerable<XStringDto>>> GetResources(
|
|
||||||
[FromQuery] string resource
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve Specified Resource Items as XResourceDto Presentation ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XResourceDto>> GetResource(
|
|
||||||
[FromQuery] string resource
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Query ...
|
|
||||||
/// <summary>
|
|
||||||
/// Query Resource IDs ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
ActionResult<XQueryResult<string>> QueryResourceIds(
|
|
||||||
[FromQuery] XQuery query
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Query Specified Language Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XQueryResult<XStringDto>>> QueryLanguageResources(
|
|
||||||
[FromQuery] XQuery query,
|
|
||||||
[FromQuery] string language = null //
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Query Locale Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XQueryResult<XLocaleResourceDto>>> QueryLocaleResources(
|
|
||||||
[FromQuery] XQuery query,
|
|
||||||
[FromQuery] string language = null //
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Add/Update Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<bool>> Add(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string value,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<bool>> Update(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string value,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<bool>> AddOrUpdate(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string value,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> AddEntity(
|
|
||||||
[FromBody] XStringDto item
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Specified Entity ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> UpdateEntity(
|
|
||||||
[FromBody] XStringDto item
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Specified Entitiy ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> AddOrUpdateEntity(
|
|
||||||
[FromBody] XStringDto item
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Specified Locale Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> AddByLocaleResource(
|
|
||||||
[FromBody] XLocaleResourceDto item,
|
|
||||||
[FromQuery] string resource
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update Specified Locale Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> UpdateByLocaleResource(
|
|
||||||
[FromBody] XLocaleResourceDto item,
|
|
||||||
[FromQuery] string resource
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update Resource By Locale ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<XStringDto>> AddOrUpdateByLocaleResource(
|
|
||||||
[FromBody] XLocaleResourceDto item,
|
|
||||||
[FromQuery] string resource
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add Or Update all XResourceDto(s) Locales ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<IEnumerable<XStringDto>>> AddByResource(
|
|
||||||
[FromBody] XResourceDto item
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//
|
|
||||||
#region Remove Actions ...
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Specified Language's Resources ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult> RemoveLanguageResources(
|
|
||||||
[FromQuery] string language
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Specified Resource Ids instances ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<IEnumerable<XStringDto>>> RemoveResource(
|
|
||||||
[FromQuery] string resource
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove Specified Resource ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="resource"></param>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult<bool>> Remove(
|
|
||||||
[FromQuery] string resource,
|
|
||||||
[FromQuery] string language = null
|
|
||||||
);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove all Resource of Specified XResourceDto ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ActionResult> RemoveByResource(
|
|
||||||
[FromBody] XResourceDto item
|
|
||||||
);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
|
<!-- <add key="megan" value="https://hub.megan.ir/nuget/index.json" /> -->
|
||||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" />
|
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" disableTLSCertificateValidation="true" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
Reference in New Issue
Block a user