Merge pull request 'twt_2008-patch-2' (#200) from twt_2008/Admin.NET.Pro:twt_2008-patch-2 into main
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/200
This commit is contained in:
commit
a0f6e595dd
@ -24,6 +24,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
private readonly SysRoleMenuService _sysRoleMenuService;
|
||||
private readonly SysConfigService _sysConfigService;
|
||||
private readonly SysCacheService _sysCacheService;
|
||||
private readonly IEventPublisher _eventPublisher;
|
||||
|
||||
public SysTenantService(SqlSugarRepository<SysTenant> sysTenantRep,
|
||||
SqlSugarRepository<SysOrg> sysOrgRep,
|
||||
@ -36,7 +37,8 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
SysUserRoleService sysUserRoleService,
|
||||
SysRoleMenuService sysRoleMenuService,
|
||||
SysConfigService sysConfigService,
|
||||
SysCacheService sysCacheService)
|
||||
SysCacheService sysCacheService,
|
||||
IEventPublisher eventPublisher)
|
||||
{
|
||||
_sysTenantRep = sysTenantRep;
|
||||
_sysOrgRep = sysOrgRep;
|
||||
@ -50,6 +52,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
_sysRoleMenuService = sysRoleMenuService;
|
||||
_sysConfigService = sysConfigService;
|
||||
_sysCacheService = sysCacheService;
|
||||
_eventPublisher = eventPublisher;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -254,6 +257,9 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
1310000000801 // 关于项目
|
||||
};
|
||||
await _sysRoleMenuService.GrantRoleMenu(new RoleMenuInput() { Id = newRole.Id, MenuIdList = menuIdList });
|
||||
|
||||
//发布新增租户事件
|
||||
await _eventPublisher.PublishAsync(CommonConst.InitTenant, tenant);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -295,6 +301,9 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
await _sysOrgRep.AsDeleteable().Where(u => u.TenantId == input.Id).ExecuteCommandAsync();
|
||||
|
||||
await _sysPosRep.AsDeleteable().Where(u => u.TenantId == input.Id).ExecuteCommandAsync();
|
||||
|
||||
//发布删除租户事件
|
||||
await _eventPublisher.PublishAsync(CommonConst.DeleteTenant, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user