This commit is contained in:
ky_sunl
2021-04-23 10:56:05 +00:00
parent bd18dd95b7
commit 02b5311f9a
15 changed files with 45 additions and 45 deletions

View File

@@ -54,7 +54,7 @@ namespace Dilon.Core.Service
/// 文件Id
/// </summary>
[Required(ErrorMessage = "文件Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
}
public class QueryFileInoInput : DeleteFileInfoInput

View File

@@ -8,6 +8,6 @@
/// <summary>
/// 文件Id
/// </summary>
public long Id { get; set; }
public string Id { get; set; }
}
}

View File

@@ -173,7 +173,7 @@ namespace Dilon.Core.Service
/// <returns></returns>
private static async Task UploadFile(IFormFile file, string pathType)
{
var fileId = IDGenerator.NextId();
var fileId = Guid.NewGuid().ToString();
var fileSizeKb = (long)(file.Length / 1024.0); // 文件大小KB
var originalFilename = file.FileName; // 文件原始名称

View File

@@ -8,12 +8,12 @@
/// <summary>
/// id
/// </summary>
public long? Id { get; set; }
public string Id { get; set; }
/// <summary>
/// 父id
/// </summary>
public long? Pid { get; set; }
public string Pid { get; set; }
/// <summary>
/// 路由名称, 必须设置,且不能重名

View File

@@ -10,7 +10,7 @@ namespace Dilon.Core.Service
/// <summary>
/// 父Id
/// </summary>
public virtual long Pid { get; set; }
public virtual string Pid { get; set; }
/// <summary>
/// 名称
@@ -103,7 +103,7 @@ namespace Dilon.Core.Service
/// 菜单Id
/// </summary>
[Required(ErrorMessage = "菜单Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
}
public class UpdateMenuInput : AddMenuInput
@@ -112,13 +112,13 @@ namespace Dilon.Core.Service
/// 菜单Id
/// </summary>
[Required(ErrorMessage = "菜单Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
/// <summary>
/// 父Id
/// </summary>DeleteMenuInput
[Required(ErrorMessage = "父级菜单Id不能为空")]
public override long Pid { get; set; }
public override string Pid { get; set; }
}
public class QueryMenuInput : DeleteMenuInput

View File

@@ -11,19 +11,19 @@ namespace Dilon.Core.Service
/// <summary>
/// 菜单Id
/// </summary>
public long Id { get; set; }
public string Id { get; set; }
/// <summary>
/// 子节点
/// </summary>
public List<MenuOutput> Children { get; set; } = new List<MenuOutput>();
public long GetId()
public string GetId()
{
return Id;
}
public long GetPid()
public string GetPid()
{
return Pid;
}

View File

@@ -11,12 +11,12 @@ namespace Dilon.Core.Service
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
public string Id { get; set; }
/// <summary>
/// 父Id
/// </summary>
public long ParentId { get; set; }
public string ParentId { get; set; }
/// <summary>
/// 名称
@@ -38,12 +38,12 @@ namespace Dilon.Core.Service
/// </summary>
public List<MenuTreeOutput> Children { get; set; } = new List<MenuTreeOutput>();
public long GetId()
public string GetId()
{
return Id;
}
public long GetPid()
public string GetPid()
{
return ParentId;
}

View File

@@ -9,12 +9,12 @@ namespace Dilon.Core.Service
Task AddMenu(AddMenuInput input);
Task<List<AntDesignTreeNode>> ChangeAppMenu(ChangeAppMenuInput input);
Task DeleteMenu(DeleteMenuInput input);
Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(long userId, string appCode);
Task<List<string>> GetLoginPermissionList(long userId);
Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(string userId, string appCode);
Task<List<string>> GetLoginPermissionList(string userId);
Task<dynamic> GetMenu(QueryMenuInput input);
Task<dynamic> GetMenuList([FromQuery] MenuInput input);
Task<dynamic> GetMenuTree([FromQuery] MenuInput input);
Task<List<string>> GetUserMenuAppCodeList(long userId);
Task<List<string>> GetUserMenuAppCodeList(string userId);
Task<bool> HasMenu(string appCode);
Task<dynamic> TreeForGrant([FromQuery] MenuInput input);
Task UpdateMenu(UpdateMenuInput input);

View File

@@ -45,7 +45,7 @@ namespace Dilon.Core.Service
/// <param name="userId"></param>
/// <returns></returns>
[NonAction]
public async Task<List<string>> GetLoginPermissionList(long userId)
public async Task<List<string>> GetLoginPermissionList(string userId)
{
var permissions = await _sysCacheService.GetPermission(userId); // 先从缓存里面读取
if (permissions == null || permissions.Count < 1)
@@ -68,7 +68,7 @@ namespace Dilon.Core.Service
/// <param name="appCode"></param>
/// <returns></returns>
[NonAction]
public async Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(long userId, string appCode)
public async Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(string userId, string appCode)
{
var antDesignTreeNodes = await _sysCacheService.GetMenu(userId, appCode); // 先从缓存里面读取
if (antDesignTreeNodes == null || antDesignTreeNodes.Count < 1)
@@ -109,7 +109,7 @@ namespace Dilon.Core.Service
{
Title = u.Name,
Icon = u.Icon,
Show = u.Visible == YesOrNot.Y.ToString(),
Show = u.Visible,
Link = u.Link,
Target = u.OpenType == (int)MenuOpenType.OUTER ? "_blank" : ""
}
@@ -125,7 +125,7 @@ namespace Dilon.Core.Service
/// <param name="userId"></param>
/// <returns></returns>
[NonAction]
public async Task<List<string>> GetUserMenuAppCodeList(long userId)
public async Task<List<string>> GetUserMenuAppCodeList(string userId)
{
var roleIdList = await _sysUserRoleService.GetUserRoleIdList(userId);
var menuIdList = await _sysRoleMenuService.GetRoleMenuIdList(roleIdList);
@@ -159,11 +159,11 @@ namespace Dilon.Core.Service
/// </summary>
/// <param name="pid"></param>
/// <returns></returns>
private async Task<string> CreateNewPids(long pid)
private async Task<string> CreateNewPids(string pid)
{
if (pid == 0L)
if (pid.Equals(System.Guid.Empty.ToString()))
{
return "[0],";
return "[" + System.Guid.Empty + "],";
}
else
{
@@ -296,7 +296,7 @@ namespace Dilon.Core.Service
if (input.Application != oldMenu.Application)
{
// 父节点不是根节点不能移动应用
if (oldMenu.Pid != 0L)
if (!oldMenu.Pid.Equals(System.Guid.Empty.ToString()))
throw Oops.Oh(ErrorCode.D4007);
updateSubAppsFlag = true;
}
@@ -389,7 +389,7 @@ namespace Dilon.Core.Service
[HttpGet("/sysMenu/treeForGrant")]
public async Task<dynamic> TreeForGrant([FromQuery] MenuInput input)
{
var menuIdList = new List<long>();
var menuIdList = new List<string>();
if (_userManager.SuperAdmin)
{
var roleIdList = await _sysUserRoleService.GetUserRoleIdList(_userManager.UserId);

View File

@@ -24,7 +24,7 @@ namespace Dilon.Core.Service
/// <summary>
/// 用户Id
/// </summary>
public long UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// 用户名称

View File

@@ -31,7 +31,7 @@ namespace Dilon.Core.Service
/// <summary>
/// 通知到的人
/// </summary>
public virtual List<long> NoticeUserIdList { get; set; }
public virtual List<string> NoticeUserIdList { get; set; }
}
public class AddNoticeInput : NoticeInput
@@ -64,7 +64,7 @@ namespace Dilon.Core.Service
/// 通知到的人
/// </summary>
[Required(ErrorMessage = "通知到的人不能为空")]
public override List<long> NoticeUserIdList { get; set; }
public override List<string> NoticeUserIdList { get; set; }
}
public class DeleteNoticeInput
@@ -73,7 +73,7 @@ namespace Dilon.Core.Service
/// Id
/// </summary>
[Required(ErrorMessage = "通知公告Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
}
public class UpdateNoticeInput : AddNoticeInput
@@ -82,7 +82,7 @@ namespace Dilon.Core.Service
/// Id
/// </summary>
[Required(ErrorMessage = "通知公告Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
}
public class QueryNoticeInput : DeleteNoticeInput

View File

@@ -5,9 +5,9 @@ namespace Dilon.Core.Service.Notice
{
public interface ISysNoticeUserService
{
Task Add(long noticeId, List<long> noticeUserIdList, int noticeUserStatus);
Task<List<SysNoticeUser>> GetNoticeUserListByNoticeId(long noticeId);
Task Read(long noticeId, long userId, int status);
Task Update(long noticeId, List<long> noticeUserIdList, int noticeUserStatus);
Task Add(string noticeId, List<string> noticeUserIdList, int noticeUserStatus);
Task<List<SysNoticeUser>> GetNoticeUserListByNoticeId(string noticeId);
Task Read(string noticeId, string userId, int status);
Task Update(string noticeId, List<string> noticeUserIdList, int noticeUserStatus);
}
}

View File

@@ -27,7 +27,7 @@ namespace Dilon.Core.Service.Notice
/// <param name="noticeUserIdList"></param>
/// <param name="noticeUserStatus"></param>
/// <returns></returns>
public Task Add(long noticeId, List<long> noticeUserIdList, int noticeUserStatus)
public Task Add(string noticeId, List<string> noticeUserIdList, int noticeUserStatus)
{
noticeUserIdList.ForEach(u =>
{
@@ -48,7 +48,7 @@ namespace Dilon.Core.Service.Notice
/// <param name="noticeUserIdList"></param>
/// <param name="noticeUserStatus"></param>
/// <returns></returns>
public async Task Update(long noticeId, List<long> noticeUserIdList, int noticeUserStatus)
public async Task Update(string noticeId, List<string> noticeUserIdList, int noticeUserStatus)
{
var noticeUsers = await _sysNoticeUserRep.Where(u => u.NoticeId == noticeId).ToListAsync();
noticeUsers.ForEach(u =>
@@ -64,7 +64,7 @@ namespace Dilon.Core.Service.Notice
/// </summary>
/// <param name="noticeId"></param>
/// <returns></returns>
public async Task<List<SysNoticeUser>> GetNoticeUserListByNoticeId(long noticeId)
public async Task<List<SysNoticeUser>> GetNoticeUserListByNoticeId(string noticeId)
{
return await _sysNoticeUserRep.Where(u => u.NoticeId == noticeId).ToListAsync();
}
@@ -76,7 +76,7 @@ namespace Dilon.Core.Service.Notice
/// <param name="userId"></param>
/// <param name="status"></param>
/// <returns></returns>
public async Task Read(long noticeId, long userId, int status)
public async Task Read(string noticeId, string userId, int status)
{
var noticeUser = await _sysNoticeUserRep.FirstOrDefaultAsync(u => u.NoticeId == noticeId && u.UserId == userId);
if (noticeUser != null)

View File

@@ -149,9 +149,9 @@ namespace Dilon.Core.Service
/// <returns></returns>
private async Task FillPids(SysOrg sysOrg)
{
if (sysOrg.Pid.Equals(System.Guid.Empty.ToString(), System.StringComparison.OrdinalIgnoreCase))
if (sysOrg.Pid.Equals(System.Guid.Empty.ToString()))
{
sysOrg.Pids = "[" + 0 + "],";
sysOrg.Pids = "[" + System.Guid.Empty + "],";
}
else
{

View File

@@ -64,7 +64,7 @@ namespace Dilon.Core.Service
/// 职位Id
/// </summary>
[Required(ErrorMessage = "职位Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
}
public class UpdatePosInput : AddPosInput
@@ -73,7 +73,7 @@ namespace Dilon.Core.Service
/// 职位Id
/// </summary>
[Required(ErrorMessage = "职位Id不能为空")]
public long Id { get; set; }
public string Id { get; set; }
}
public class QueryPosInput : DeletePosInput