Browse Source

fix(platform): 编辑时应检查是否重名

pull/1194/head
colin 9 months ago
parent
commit
a2b8763dad
  1. 3
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataMoveDto.cs
  2. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs
  3. 4
      aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs

3
aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataMoveDto.cs

@ -1,8 +1,11 @@
using System;
using System.ComponentModel;
namespace LINGYUN.Platform.Datas;
public class DataMoveDto
{
[DisplayName("DisplayName:ParentData")]
public Guid? ParentId { get; set; }
}

4
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs

@ -130,6 +130,10 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService
if (!string.Equals(data.Name, input.Name, StringComparison.InvariantCultureIgnoreCase))
{
if (await DataRepository.FindByNameAsync(input.Name) != null)
{
throw new UserFriendlyException(L["DuplicateData", input.Name]);
}
data.Name = input.Name;
}
if (!string.Equals(data.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase))

4
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs

@ -94,6 +94,10 @@ public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppServic
if (!string.Equals(layout.Name, input.Name, StringComparison.InvariantCultureIgnoreCase))
{
if (await LayoutRepository.FindByNameAsync(input.Name) != null)
{
throw new UserFriendlyException(L["DuplicateLayout", input.Name]);
}
layout.Name = input.Name;
}
if (!string.Equals(layout.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase))

Loading…
Cancel
Save