| | |
| | | { |
| | | var entity = new Menu(); |
| | | entity.Path = $"{parent.Path}{parent.Code}/"; |
| | | entity.Type = EnumMenuType.Button; |
| | | entity.Type = EnumMenuType.Field; |
| | | entity.VisitLevel = parent.VisitLevel; |
| | | request.Adapt(entity); |
| | | if (await CheckExist(entity)) throw Oops.Oh(EnumErrorCodeType.s405, "菜单编号"); |
| | | if (await CheckExist(entity)) throw Oops.Oh(EnumErrorCodeType.s406, "菜单编号"); |
| | | await rep.InsertAsync(entity); |
| | | return entity.Id; |
| | | } |
| | |
| | | return await rep.AsQueryable().AsNoTracking() |
| | | .AnyAsync(it => |
| | | it.ParentId == entity.ParentId |
| | | && it.Type == entity.Type |
| | | && it.Group == entity.Group |
| | | && it.Code == entity.Code |
| | | && it.Id != entity.Id); |