Refactor xApi from Side Affect Changes ...
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCommons.Attributes;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Providers;
|
||||
using xIdentityService.Controllers;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xApi.Base
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[RequireXPowered(true)]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public abstract class XIBaseV1Controller : XIBaseController
|
||||
{
|
||||
//
|
||||
#region Constructor ...
|
||||
protected XIBaseV1Controller(
|
||||
ILogger<XIBaseV1Controller> logger,
|
||||
XAppConfiguration appConfiguration,
|
||||
IXIdentityProvider identityProvider,
|
||||
XValidationProvider validationProvider
|
||||
) : base(
|
||||
logger,
|
||||
appConfiguration,
|
||||
identityProvider,
|
||||
validationProvider
|
||||
)
|
||||
{ }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCommons.Attributes;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Extensions;
|
||||
using xCommons.Providers;
|
||||
using xDataService.Interfaces;
|
||||
using xIdentityService.Controllers;
|
||||
using xIdentityService.Interfaces;
|
||||
using xModels.Base;
|
||||
using xPushService.Base;
|
||||
using xPushService.Constants;
|
||||
|
||||
namespace xApi.Base
|
||||
{
|
||||
//
|
||||
// TODO: Fix this ...
|
||||
// [ApiController]
|
||||
// [ApiVersion("1.0")]
|
||||
// [RequireXPowered(true)]
|
||||
// [Route("api/v{version:apiVersion}/entities/[controller]")]
|
||||
// public abstract class XIBaseV1EntityController<TEntity, TKey> : XIBaseEntityController<TEntity, TKey>
|
||||
// where TEntity : XBaseEntity<TKey>
|
||||
// {
|
||||
// //
|
||||
// #region Constructor ...
|
||||
// protected XIBaseV1EntityController(
|
||||
// ILogger<XIBaseV1EntityController<TEntity, TKey>> logger,
|
||||
// XAppConfiguration appConfiguration,
|
||||
// IXIdentityProvider identityProvider,
|
||||
// XValidationProvider validationProvider,
|
||||
// IXBaseRepository<TEntity, TKey> repository
|
||||
// ) : base(
|
||||
// logger,
|
||||
// appConfiguration,
|
||||
// identityProvider,
|
||||
// validationProvider,
|
||||
// repository
|
||||
// )
|
||||
// { }
|
||||
// #endregion
|
||||
// }
|
||||
|
||||
// public abstract class XIBaseV1EntityHubController<TEntity, TKey> : XIBaseV1EntityController<TEntity, TKey>
|
||||
// where TEntity : XBaseEntity<TKey>
|
||||
// {
|
||||
// //
|
||||
// #region Props ...
|
||||
// public IHubContext<XBaseEntityHub<TEntity, TKey>> Hub { get; }
|
||||
// #endregion
|
||||
|
||||
// //
|
||||
// #region Constructor ...
|
||||
// protected XIBaseV1EntityHubController(
|
||||
// ILogger<XIBaseV1EntityHubController<TEntity, TKey>> logger,
|
||||
// XAppConfiguration appConfiguration,
|
||||
// IXIdentityProvider identityProvider,
|
||||
// XValidationProvider validationProvider,
|
||||
// IXBaseRepository<TEntity, TKey> repository,
|
||||
// IHubContext<XBaseEntityHub<TEntity, TKey>> hub = null
|
||||
// ) : base(
|
||||
// logger,
|
||||
// appConfiguration,
|
||||
// identityProvider,
|
||||
// validationProvider,
|
||||
// repository
|
||||
// )
|
||||
// {
|
||||
// Hub = hub;
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// //
|
||||
// #region Hub ...
|
||||
// [NonAction]
|
||||
// public async Task SendPush(
|
||||
// string action,
|
||||
// string payLoad
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// var actions = new List<string>
|
||||
// {
|
||||
// XBaseEntityHubAction.Add.GetStringValue(),
|
||||
// XBaseEntityHubAction.Update.GetStringValue(),
|
||||
// XBaseEntityHubAction.Delete.GetStringValue(),
|
||||
// XBaseEntityHubAction.AddMany.GetStringValue(),
|
||||
// XBaseEntityHubAction.DeleteMany.GetStringValue(),
|
||||
// XBaseEntityHubAction.UpdateMany.GetStringValue(),
|
||||
// XBaseEntityHubAction.AddOrUpdate.GetStringValue(),
|
||||
// };
|
||||
|
||||
// //
|
||||
// // Validate ...
|
||||
// var isValid =
|
||||
// !Hub.IsNull() &&
|
||||
// !action.IsNullOrEmpty() &&
|
||||
// !payLoad.IsNullOrEmpty() &&
|
||||
// actions.Contains(action);
|
||||
// if (!isValid)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Retrieve Connection Id ...
|
||||
// var connectionId = GetConnectionId();
|
||||
// var clients = Hub.Clients.All;
|
||||
// if (!connectionId.IsNullOrEmpty())
|
||||
// {
|
||||
// clients = Hub.Clients.AllExcept(connectionId);
|
||||
// }
|
||||
|
||||
// //
|
||||
// await clients.SendAsync(action, payLoad, connectionId);
|
||||
// }
|
||||
// #endregion
|
||||
// }
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Providers;
|
||||
using xIdentityService.Controllers;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xApi.Base
|
||||
{
|
||||
[Route("api/v{version:apiVersion}/services/[controller]")]
|
||||
public abstract class XIBaseV1ProviderController : XIBaseProviderController
|
||||
{
|
||||
//
|
||||
#region Constructor ...
|
||||
protected XIBaseV1ProviderController(
|
||||
ILogger logger,
|
||||
XAppConfiguration appConfiguration,
|
||||
IXIdentityProvider identityProvider,
|
||||
XValidationProvider validationProvider
|
||||
) : base(
|
||||
logger,
|
||||
appConfiguration,
|
||||
identityProvider,
|
||||
validationProvider
|
||||
)
|
||||
{ }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace xApi.Controllers
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
[RequireXPowered(true)]
|
||||
public partial class AccountController : XIBaseController
|
||||
public partial class AccountController : XBaseIdentityController
|
||||
{
|
||||
//
|
||||
#region Props ...
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace xApi.Controllers {
|
||||
/// Test all Authentication Policies ...
|
||||
/// </summary>
|
||||
[RequireXPowered (false)]
|
||||
public class TestIdentity : XIBaseController {
|
||||
public class TestIdentity : XBaseIdentityController {
|
||||
public TestIdentity (
|
||||
ILogger<TestIdentity> logger,
|
||||
XAppConfiguration appConfiguration,
|
||||
|
||||
@@ -154,15 +154,6 @@ namespace xApi
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
|
||||
//
|
||||
#region XPushService ...
|
||||
// //
|
||||
// var helper = new XPushServiceHelper();
|
||||
|
||||
// //
|
||||
// app.UseXPushService(helper);
|
||||
#endregion
|
||||
|
||||
//
|
||||
// Use xDataService Middleware ...
|
||||
app.UseXServices(
|
||||
|
||||
Reference in New Issue
Block a user