diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs index a4ba3acdc..00de46cec 100644 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs @@ -15,17 +15,19 @@ public class TeamDetailModel public TeamTypes TeamType { get; set; } - public List Admins { get; set; } + public List Admins { get; set; } = new(); - public List Members { get; set; } + public List Members { get; set; } = new(); + + public List AdminRoles { get; set; } = new(); + + public List MemberRoles { get; set; } = new(); public TeamDetailModel() { Name = ""; Avatar = ""; Description = ""; - Admins = new(); - Members = new(); } public TeamDetailModel( diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs index 9ef4dd96a..6c8765718 100644 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs @@ -7,7 +7,7 @@ public interface IUserService { Task> GetListByTeamAsync(Guid teamId); - Task> GetListByRoleAsync(Guid roleId); + Task> GetListByRoleAsync(Guid roleId); Task> GetListByDepartmentAsync(Guid departmentId); diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs index 235d435aa..2688d404e 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs @@ -40,10 +40,10 @@ public async Task> GetListByDepartmentAsync(Guid departmentId) return await _caller.GetAsync>(requestUri, new { id = departmentId }) ?? new(); } - public async Task> GetListByRoleAsync(Guid roleId) + public async Task> GetListByRoleAsync(Guid roleId) { - var requestUri = $"api/staff/getListByRole"; - return await _caller.GetAsync>(requestUri, new { id = roleId }) ?? new(); + var requestUri = $"api/user/getListByRole"; + return await _caller.GetAsync>(requestUri, new { id = roleId }) ?? new(); } public async Task> GetListByTeamAsync(Guid teamId) diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs index e52d5bfd8..b934c5b2e 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs @@ -113,17 +113,17 @@ public async Task TestGetListByTeamAsync() [TestMethod] public async Task TestGetListByRoleAsync() { - var data = new List() + var data = new List() { - new StaffModel() + new UserModel() }; Guid roleId = Guid.NewGuid(); - var requestUri = $"api/staff/getListByRole"; + var requestUri = $"api/user/getListByRole"; var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); var userService = GetUserService(caller); var result = await userService.GetListByRoleAsync(roleId); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); Assert.IsTrue(result.Count == 1); }