From 604e1a7962f18074806e415202f54cdf2e038ae8 Mon Sep 17 00:00:00 2001 From: wuzihao <lsd@123> Date: Sat, 25 Mar 2023 14:03:07 +0800 Subject: [PATCH 1/5] reactor : Use AspNetCore Authentication --- .../Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj index 5308f134e..3e89b13ef 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj @@ -12,7 +12,7 @@ <ItemGroup> <ProjectReference Include="..\..\..\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj" /> - <ProjectReference Include="..\Masa.Contrib.StackSdks.Caller\Masa.Contrib.StackSdks.Caller.csproj" /> + <ProjectReference Include="..\..\Service\Caller\Authentication\Masa.Contrib.Service.Caller.Authentication.AspNetCore\Masa.Contrib.Service.Caller.Authentication.AspNetCore.csproj" /> <ProjectReference Include="..\..\Service\Caller\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj" /> </ItemGroup> From 7dea99869cb3ca4c5546dbde1744897de62b03d1 Mon Sep 17 00:00:00 2001 From: wzh425 <wuzihao425@outlook.com> Date: Fri, 5 May 2023 13:36:49 +0800 Subject: [PATCH 2/5] reactor(stack-mc) : Some SDK methods support channel code --- .../Model/GetMessageTaskModel.cs | 12 ++++++++++++ .../Model/GetWebsiteMessageModel.cs | 2 ++ .../Model/MessageTaskUpsertModel.cs | 2 ++ 3 files changed, 16 insertions(+) diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs index 12df9d88c..4b288db19 100644 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs @@ -6,15 +6,27 @@ namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class GetMessageTaskModel : PaginatedOptions { public string Filter { get; set; } = string.Empty; + public Guid ChannelId { get; set; } + + public string ChannelCode { get; set; } = string.Empty; + public MessageTypes? EntityType { get; set; } + public bool? IsDraft { get; set; } + public bool? IsEnabled { get; set; } + public MessageTaskTimeTypes? TimeType { get; set; } + public DateTime? StartTime { get; set; } + public DateTime? EndTime { get; set; } + public MessageTaskStatuses? Status { get; set; } + public MessageTaskSources? Source { get; set; } + public string SystemId { get; set; } = string.Empty; public GetMessageTaskModel(int page, int pageSize, Dictionary<string, bool>? sorting = null) : base(page, pageSize, sorting) diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs index 423df3463..4da1f5883 100644 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs @@ -11,6 +11,8 @@ public class GetWebsiteMessageModel : PaginatedOptions public Guid? ChannelId { get; set; } + public string ChannelCode { get; set; } = string.Empty; + public bool? IsRead { get; set; } public string Tag { get; set; } = string.Empty; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs index 9752f949a..86b282a52 100644 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs @@ -9,6 +9,8 @@ public class MessageTaskUpsertModel public Guid ChannelId { get; set; } + public string ChannelCode { get; set; } = string.Empty; + public ChannelTypes ChannelType { get; set; } public MessageTypes EntityType { get; set; } From 25752f71deea64aa0c45ec1e841987ff68dc12a4 Mon Sep 17 00:00:00 2001 From: wzh425 <wuzihao425@outlook.com> Date: Fri, 5 May 2023 13:41:52 +0800 Subject: [PATCH 3/5] chore : Restore project reference --- .../Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj index 3e89b13ef..5308f134e 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj @@ -12,7 +12,7 @@ <ItemGroup> <ProjectReference Include="..\..\..\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj" /> - <ProjectReference Include="..\..\Service\Caller\Authentication\Masa.Contrib.Service.Caller.Authentication.AspNetCore\Masa.Contrib.Service.Caller.Authentication.AspNetCore.csproj" /> + <ProjectReference Include="..\Masa.Contrib.StackSdks.Caller\Masa.Contrib.StackSdks.Caller.csproj" /> <ProjectReference Include="..\..\Service\Caller\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj" /> </ItemGroup> From 47ae328e4dc4985f0780b05a133f23004daf9f4e Mon Sep 17 00:00:00 2001 From: wzh425 <wuzihao425@outlook.com> Date: Fri, 5 May 2023 13:47:31 +0800 Subject: [PATCH 4/5] reactor(stack-mc) : Remove API Route Get Prefix --- .../Service/WebsiteMessageService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs index 907041141..e2a9eab8e 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs @@ -30,7 +30,7 @@ public async Task DeleteAsync(Guid id) public async Task<List<WebsiteMessageChannelModel>> GetChannelListAsync() { - var requestUri = $"{_party}/GetChannelList"; + var requestUri = $"{_party}/ChannelList"; return await _caller.GetAsync<List<WebsiteMessageChannelModel>>(requestUri) ?? new(); } @@ -42,7 +42,7 @@ public async Task<PaginatedListModel<WebsiteMessageModel>> GetListAsync(GetWebsi public async Task<List<WebsiteMessageModel>> GetNoticeListAsync(GetNoticeListModel options) { - var requestUri = $"{_party}/GetNoticeList"; + var requestUri = $"{_party}/NoticeList"; return await _caller.GetAsync<GetNoticeListModel, List<WebsiteMessageModel>>(requestUri, options) ?? new(); } From 6cc015a56a4b774aa2a9310a7dee927a7cdf4bb9 Mon Sep 17 00:00:00 2001 From: wzh425 <wuzihao425@outlook.com> Date: Fri, 5 May 2023 16:52:00 +0800 Subject: [PATCH 5/5] test : Unit Test Adjustment --- .../WebsiteMessageServiceTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs index 3f6cb049d..0548168d5 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs @@ -61,7 +61,7 @@ public async Task TestDeleteAsync() public async Task TestGetChannelListAsync() { var data = new List<WebsiteMessageChannelModel>(); - var requestUri = $"api/website-message/GetChannelList"; + var requestUri = $"api/website-message/ChannelList"; var caller = new Mock<ICaller>(); caller.Setup(provider => provider.GetAsync<List<WebsiteMessageChannelModel>>(requestUri, default)).ReturnsAsync(data).Verifiable(); var websiteMessageService = new Mock<WebsiteMessageService>(caller.Object); @@ -75,7 +75,7 @@ public async Task TestGetNoticeListAsync() { var options = new GetNoticeListModel(); var data = new List<WebsiteMessageModel>(); - var requestUri = $"api/website-message/GetNoticeList"; + var requestUri = $"api/website-message/NoticeList"; var caller = new Mock<ICaller>(); caller.Setup(provider => provider.GetAsync<GetNoticeListModel, List<WebsiteMessageModel>>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); var websiteMessageService = new Mock<WebsiteMessageService>(caller.Object);