Пример #1
0
 /// <summary>
 /// 保存任务方法
 /// </summary>
 /// <param name="task"></param>
 /// <returns></returns>
 public static bool Save(Task task) => DbContextManager.Create <Task>().Save(task);
Пример #2
0
 /// <summary>
 /// 查詢所有角色
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <Role> Retrieves() => CacheManager.GetOrAdd(RetrieveRolesDataKey, key => DbContextManager.Create <Role>()?.Retrieves()) ?? new Role[0];
Пример #3
0
 /// <summary>
 /// 查询指定页码登录日志
 /// </summary>
 /// <param name="po"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="ip"></param>
 public static Page <LoginUser> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string ip) => DbContextManager.Create <LoginUser>().RetrieveByPages(po, startTime, endTime, ip);
Пример #4
0
 /// <summary>
 /// 查询指定页码登录日志
 /// </summary>
 /// <param name="po"></param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="ip"></param>
 public static Page <LoginUser> RetrievePages(PaginationOption po, DateTime?startTime, DateTime?endTime, string?ip) => DbContextManager.Create <LoginUser>()?.RetrieveByPages(po, startTime, endTime, ip) ?? new Page <LoginUser>()
 {
     Items = new List <LoginUser>()
 };
Пример #5
0
 /// <summary>
 /// 通过用户名獲取授權角色集合
 /// </summary>
 /// <param name="userName">指定用户名</param>
 /// <returns>角色名稱集合</returns>
 public static IEnumerable <string> RetrievesByUserName(string userName) => CacheManager.GetOrAdd(string.Format("{0}-{1}", DbHelper.RetrieveRolesByUserNameDataKey, userName), key => DbContextManager.Create <Role>()?.RetrievesByUserName(userName), DbHelper.RetrieveRolesByUserNameDataKey) ?? new string[0];
Пример #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="msg"></param>
 /// <returns></returns>
 public static bool Save(Message msg) => DbContextManager.Create <Message>().Save(msg);
Пример #7
0
 /// <summary>
 /// 通过用户獲得所有選單
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <BootstrapMenu> RetrieveAllMenus(string?userName) => string.IsNullOrEmpty(userName) ? new BootstrapMenu[0] : CacheManager.GetOrAdd($"{RetrieveMenusAll}-{userName}", key => DbContextManager.Create <Menu>()?.RetrieveAllMenus(userName), RetrieveMenusAll) ?? new BootstrapMenu[0];
Пример #8
0
 /// <summary>
 /// 通过groupId获取所有用户
 /// </summary>
 /// <param name="groupId"></param>
 /// <returns></returns>
 public static IEnumerable <User> RetrievesByGroupId(string groupId) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveUsersByGroupIdDataKey, groupId), k => DbContextManager.Create <User>().RetrievesByGroupId(groupId), RetrieveUsersByRoleIdDataKey);
Пример #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static BootstrapUser RetrieveUserByUserName(string userName) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveUsersByNameDataKey, userName), k => DbContextManager.Create <User>().RetrieveUserByUserName(userName), RetrieveUsersByNameDataKey);
Пример #10
0
 /// <summary>
 /// 根据角色ID指派应用程序
 /// </summary>
 /// <param name="roleId"></param>
 /// <returns></returns>
 public static IEnumerable <App> RetrievesByRoleId(string roleId) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveAppsByRoleIdDataKey, roleId), key => DbContextManager.Create <App>().RetrievesByRoleId(roleId), RetrieveAppsByRoleIdDataKey);
Пример #11
0
 /// <summary>
 /// 根据指定用户名获得授权应用程序集合
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <string> RetrievesByUserName(string userName) => DbContextManager.Create <App>().RetrievesByUserName(userName);
Пример #12
0
 /// <summary>
 /// 根据用户查询部门信息
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public static IEnumerable <Group> RetrievesByUserId(string userId) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveGroupsByUserIdDataKey, userId), k => DbContextManager.Create <Group>()?.RetrievesByUserId(userId), RetrieveGroupsByUserIdDataKey) ?? new Group[0];
Пример #13
0
 /// <summary>
 /// 查询所有群组信息
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <Group> Retrieves() => CacheManager.GetOrAdd(RetrieveGroupsDataKey, key => DbContextManager.Create <Group>()?.Retrieves()) ?? new Group[0];
Пример #14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <BootstrapGroup> RetrievesByUserName(string userName) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveGroupsByUserNameDataKey, userName), r => DbContextManager.Create <Group>()?.RetrievesByUserName(userName), RetrieveGroupsByUserNameDataKey) ?? new BootstrapGroup[0];
Пример #15
0
 /// <summary>
 /// 标旗
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <Message> Mark(string userName) => DbContextManager.Create <Message>().Mark(userName);
Пример #16
0
 /// <summary>
 /// 通过登录账号获得用户信息
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static ResetUser RetrieveResetUserByUserName(string userName) => DbContextManager.Create <ResetUser>().RetrieveUserByUserName(userName);
Пример #17
0
 /// <summary>
 /// 获取Header处显示的消息列表
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <Message> Retrieves(string userName) => CacheManager.GetOrAdd(RetrieveMessageDataKey, key => DbContextManager.Create <Message>().RetrieveHeaders(userName).OrderByDescending(n => n.SendTime));
Пример #18
0
 /// <summary>
 /// 通过登录账户获得重置密码原因
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <KeyValuePair <DateTime, string> > RetrieveResetReasonsByUserName(string userName) => DbContextManager.Create <ResetUser>().RetrieveResetReasonsByUserName(userName);
Пример #19
0
 /// <summary>
 /// 通过角色獲取相關選單集合
 /// </summary>
 /// <param name="roleId"></param>
 /// <returns></returns>
 public static IEnumerable <string> RetrieveMenusByRoleId(string roleId) => CacheManager.GetOrAdd($"{RetrieveMenusByRoleIdDataKey}-{roleId}", k => DbContextManager.Create <Menu>()?.RetrieveMenusByRoleId(roleId), RetrieveMenusByRoleIdDataKey) ?? new string[0];
Пример #20
0
 /// <summary>
 /// 查询所有用户
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <User> Retrieves() => CacheManager.GetOrAdd(RetrieveUsersDataKey, key => DbContextManager.Create <User>().Retrieves());
Пример #21
0
 /// <summary>
 /// 通过當前用户名與指定選單路徑獲取此選單下所有授權按鈕集合 (userName, url, auths) => bool
 /// </summary>
 /// <param name="userName">當前操作用户名</param>
 /// <param name="url">資源按鈕所属選單</param>
 /// <param name="auths">資源授權碼</param>
 /// <returns></returns>
 public static bool AuthorizateButtons(string userName, string url, string auths) => DbContextManager.Create <Menu>()?.AuthorizateButtons(userName, url, auths) ?? false;
Пример #22
0
 /// <summary>
 /// 获得指定IP历史访问记录
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="ip"></param>
 /// <returns></returns>
 public static IEnumerable <Trace> RetrieveAll(DateTime?startTime, DateTime?endTime, string ip) => DbContextManager.Create <Trace>().RetrieveAll(startTime, endTime, ip);
Пример #23
0
 /// <summary>
 /// 根據GroupId查詢和該Group有關的所有Roles
 /// </summary>
 /// <param name="groupId"></param>
 /// <returns></returns>
 public static IEnumerable <Role> RetrievesByGroupId(string groupId) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveRolesByGroupIdDataKey, groupId), key => DbContextManager.Create <Role>()?.RetrievesByGroupId(groupId), RetrieveRolesByGroupIdDataKey) ?? new Role[0];
Пример #24
0
 /// <summary>
 /// 收件箱
 /// </summary>
 /// <param name="userName"></param>
 public static IEnumerable <Message> Inbox(string userName) => DbContextManager.Create <Message>().Inbox(userName);
Пример #25
0
 /// <summary>
 /// 通过指定 Url 地址獲得授權角色集合
 /// </summary>
 /// <param name="url">請求 Url 地址</param>
 /// <param name="appId">應用程式Id</param>
 /// <returns>角色名稱集合</returns>
 public static IEnumerable <string> RetrievesByUrl(string url, string appId) => CacheManager.GetOrAdd(string.Format("{0}-{1}-{2}", DbHelper.RetrieveRolesByUrlDataKey, url, appId), key => DbContextManager.Create <Role>()?.RetrievesByUrl(url, appId), DbHelper.RetrieveRolesByUrlDataKey) ?? new string[0];
Пример #26
0
 /// <summary>
 /// 发件箱
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <Message> SendMail(string userName) => DbContextManager.Create <Message>().SendMail(userName);
Пример #27
0
 /// <summary>
 /// 查詢某個用户所拥有的角色
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <Role> RetrievesByUserId(string userId) => CacheManager.GetOrAdd($"{RetrieveRolesByUserIdDataKey}-{userId}", key => DbContextManager.Create <Role>()?.RetrievesByUserId(userId), RetrieveRolesByUserIdDataKey) ?? new Role[0];
Пример #28
0
 /// <summary>
 /// 垃圾箱
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <Message> Trash(string userName) => DbContextManager.Create <Message>().Trash(userName);
Пример #29
0
 /// <summary>
 /// 查询所有登录日志
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="ip"></param>
 /// <returns></returns>
 public static IEnumerable <LoginUser> RetrieveAll(DateTime?startTime, DateTime?endTime, string ip)
 {
     return(DbContextManager.Create <LoginUser>().RetrieveAll(startTime, endTime, ip));
 }
Пример #30
0
 /// <summary>
 /// 根据指定用户名获得授权应用程序集合
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public static IEnumerable <string> RetrievesByUserName(string userName) => CacheManager.GetOrAdd($"{DbHelper.RetrieveAppsByUserNameDataKey}-{userName}", key => DbContextManager.Create <App>().RetrievesByUserName(userName), RetrieveAppsByUserNameDataKey);