This commit is contained in:
2023-05-31 10:19:05 +08:00
parent 1b65a7a9e5
commit 9c621c75cd
238 changed files with 9905 additions and 4034 deletions

View File

@@ -1,4 +1,5 @@
using JNPF.Common.Const;
using Aop.Api.Domain;
using JNPF.Common.Const;
using JNPF.Common.Core.Handlers;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
@@ -70,7 +71,7 @@ public class SystemService : IDynamicApiController, ITransient
/// <param name="input">参数.</param>
/// <returns></returns>
[HttpGet("")]
public async Task<dynamic> GetList([FromQuery] KeywordInput input)
public async Task<dynamic> GetList([FromQuery] SystemQuery input)
{
var authorIds = await _repository.AsSugarClient().Queryable<AuthorizeEntity>()
.Where(x => x.ItemType.Equals("system") && x.ObjectType.Equals("Role") && _userManager.Roles.Contains(x.ObjectId)).Select(x => x.ItemId).ToListAsync();
@@ -81,6 +82,8 @@ public class SystemService : IDynamicApiController, ITransient
whereLambda = whereLambda.And(x => authorIds.Contains(x.Id));
if (input.keyword.IsNotEmptyOrNull())
whereLambda = whereLambda.And(x => x.FullName.Contains(input.keyword) || x.EnCode.Contains(input.keyword));
if (input.enableMark.IsNotEmptyOrNull())
whereLambda = whereLambda.And(x => x.EnabledMark == SqlFunc.ToInt32(input.enableMark));
var output = (await _repository.AsQueryable().Where(whereLambda).OrderBy(a => a.SortCode).OrderByDescending(a => a.CreatorTime).ToListAsync()).Adapt<List<SystemListOutput>>();
return new { list = output };
}
@@ -215,7 +218,7 @@ public class SystemService : IDynamicApiController, ITransient
allUserOnlineList.RemoveAll((x) => x.connectionId == item.connectionId);
// 删除用户登录信息缓存.
var mCacheKey = string.Format("{0}{1}_{2}", CommonConst.CACHEKEYUSER, tenantId, item.userId);
var mCacheKey = string.Format("{0}:{1}:{2}", tenantId, CommonConst.CACHEKEYUSER, item.userId);
await _cacheManager.DelAsync(mCacheKey);
});
await _cacheManager.SetAsync(cacheKey, allUserOnlineList);