feat 人脸上传,内部支持客户端授权
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Sys.Entities;
|
||||
using Dlhis.Entity.Sys.Enums;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
@@ -36,15 +37,69 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<Guid>> GetAssignmentsAsync(string userNo, DeviceAssignmentTypeEnumType uniqueType, Guid? uniqueValue)
|
||||
public async Task<List<Guid>> GetAssignmentsAsync(string userNo, DeviceAssignmentTypeEnumType? uniqueType)
|
||||
{
|
||||
var assignments = await _dbContext.Queryable<DevicePermissionEntity>()
|
||||
.Where(x => x.UniqueType == uniqueType)
|
||||
.WhereIF(uniqueValue.HasValue, x => x.UniqueValue == uniqueValue)
|
||||
.WhereIF(uniqueType.HasValue, x => x.UniqueType == uniqueType)
|
||||
.Where(x => x.UserNo == userNo)
|
||||
.Select(x => x.UniqueValue)
|
||||
.ToListAsync();
|
||||
|
||||
return assignments;
|
||||
}
|
||||
|
||||
public async Task<List<Guid>> GetAssignDeviceCodesAsync(string userNo)
|
||||
{
|
||||
var groupCodes = await GetAssignmentsAsync(userNo, DeviceAssignmentTypeEnumType.Group);
|
||||
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>().ToListAsync();
|
||||
|
||||
return null;
|
||||
//var deviceCodes = await GetAssignmentsAsync(userNo, DeviceAssignmentTypeEnumType.Device);
|
||||
|
||||
|
||||
//var permissionCodes = await _dbContext.Queryable<MenuPermissionEntity>()
|
||||
// .Where(x => x.UniqueType == uniqueType)
|
||||
// .Where(x => x.UniqueValue == uniqueData)
|
||||
// .Select(x => x.Code)
|
||||
// .ToListAsync();
|
||||
|
||||
//var menus = await GetListAsync(PlatformEnumType.PCAdmin);
|
||||
|
||||
//foreach (var menu in menus)
|
||||
//{
|
||||
// if (menu.Items.Any())
|
||||
// {
|
||||
// var codes = RecursionHandler(menu.Items, permissionCodes);
|
||||
// permissionCodes.RemoveAll(x => codes.Contains(x));
|
||||
// }
|
||||
//}
|
||||
|
||||
//return permissionCodes;
|
||||
|
||||
//static List<string> RecursionHandler(List<MenuResponse> menus, List<string> innerPermissions)
|
||||
//{
|
||||
// var codes = new HashSet<string>();
|
||||
// foreach (var menu in menus)
|
||||
// {
|
||||
// if (menu.Items.Any())
|
||||
// {
|
||||
// var innerPermissionCodes = RecursionHandler(menu.Items, innerPermissions);
|
||||
// foreach (var item in innerPermissionCodes)
|
||||
// {
|
||||
// codes.Add(item);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (!innerPermissions.Contains(menu.Code))
|
||||
// {
|
||||
// foreach (var item in menu.Items.Select(x => x.Code))
|
||||
// {
|
||||
// codes.Add(item);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// return codes.ToList();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user