重构代码:AppHelper方法RetrieveAppsByUserName更改为RetrievesByUserName

This commit is contained in:
Argo-Surface 2019-02-25 15:14:09 +08:00
parent b6224cd8c5
commit 473641b155
4 changed files with 5 additions and 7 deletions

View File

@ -1,5 +1,4 @@
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security.DataAccess;
using Bootstrap.Security.Filter; using Bootstrap.Security.Filter;
using Longbow.Web; using Longbow.Web;
using Longbow.Web.SignalR; using Longbow.Web.SignalR;
@ -125,7 +124,7 @@ namespace Bootstrap.Admin
app.UseResponseCompression(); app.UseResponseCompression();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseAuthentication(); app.UseAuthentication();
app.UseBootstrapAdminAuthorization(RoleHelper.RetrieveRolesByUserName, RoleHelper.RetrieveRolesByUrl, AppHelper.RetrieveAppsByUserName); app.UseBootstrapAdminAuthorization(RoleHelper.RetrieveRolesByUserName, RoleHelper.RetrieveRolesByUrl, AppHelper.RetrievesByUserName);
app.UseCacheManagerCorsHandler(); app.UseCacheManagerCorsHandler();
app.UseSignalR(routes => { routes.MapHub<SignalRHub>("/NotiHub"); }); app.UseSignalR(routes => { routes.MapHub<SignalRHub>("/NotiHub"); });
app.UseMvc(routes => app.UseMvc(routes =>

View File

@ -41,7 +41,7 @@ namespace Bootstrap.DataAccess.MongoDB
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
/// <returns></returns> /// <returns></returns>
public override IEnumerable<string> RetrieveAppsByUserName(string userName) public override IEnumerable<string> RetrievesByUserName(string userName)
{ {
var ret = new List<string>(); var ret = new List<string>();
var roles = RoleHelper.RetrieveRolesByUserName(userName); var roles = RoleHelper.RetrieveRolesByUserName(userName);

View File

@ -46,7 +46,7 @@ namespace Bootstrap.DataAccess
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
/// <returns></returns> /// <returns></returns>
public virtual IEnumerable<string> RetrieveAppsByUserName(string userName) => DbHelper.RetrieveAppsByUserName(userName); public virtual IEnumerable<string> RetrievesByUserName(string userName) => DbHelper.RetrieveAppsByUserName(userName);
/// <summary> /// <summary>
/// 根据角色ID以及选定的App ID保到角色应用表 /// 根据角色ID以及选定的App ID保到角色应用表

View File

@ -1,5 +1,4 @@
using Bootstrap.Security.DataAccess; using Longbow.Cache;
using Longbow.Cache;
using Longbow.Data; using Longbow.Data;
using System.Collections.Generic; using System.Collections.Generic;
@ -34,6 +33,6 @@ namespace Bootstrap.DataAccess
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<string> RetrieveAppsByUserName(string userName) => DbContextManager.Create<App>().RetrieveAppsByUserName(userName); public static IEnumerable<string> RetrievesByUserName(string userName) => DbContextManager.Create<App>().RetrievesByUserName(userName);
} }
} }