Skip to content

Commit

Permalink
chore : upgrade (#533)
Browse files Browse the repository at this point in the history
* chore : upgrade

* chore : upgrade
  • Loading branch information
wzh425 authored Jul 12, 2023
1 parent db194a8 commit bcd4325
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<MasaFrameworkPackageVersion>1.0.0-rc.3.5</MasaFrameworkPackageVersion>
<MasaFrameworkPackageVersion>1.0.0-rc.4.2</MasaFrameworkPackageVersion>
</PropertyGroup>
</Project>
15 changes: 0 additions & 15 deletions src/Contracts/Masa.Mc.Contracts.Admin/Consts/MasaStackConsts.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task HandleEventAsync(UpdateMessageRecordUserEvent eto)

var user = await GetMessageRecordsUser(messageRecord);

if (messageRecord.SystemId == MasaStackConsts.MC_SYSTEM_ID && user == null)
if (messageRecord.SystemId == MasaStackProject.MC.Name && user == null)
{
user = await CreateExternalUserAsync(messageRecord);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,8 @@ public async Task<IEnumerable<MessageReceiverUser>> TransformUserReceivers(AppCh

private async Task<Dictionary<Guid, string>> GetUserClientIds(AppChannel channel, List<Guid> userIds)
{
var userSystemDatas = await _authClient.UserService.GetSystemListDataAsync<string>(userIds, $"{MasaStackConsts.MC_SYSTEM_ID}:{channel.Code}");
return userIds.ToDictionary(x => x, x =>
{
var userSystemValue = userSystemDatas.GetValueOrDefault(x);
if (userSystemValue == null)
return string.Empty;
var userSystemData = JsonSerializer.Deserialize<UserSystemData>(userSystemValue);
return userSystemData?.ClientId ?? string.Empty;
});
//return userSystemDatas.ToDictionary(x => x.Key, x =>
//{
// var userSystemData = JsonSerializer.Deserialize<UserSystemData>(x.Value);
// return userSystemData?.ClientId ?? string.Empty;
//});

//var userSystemDatas = await _authClient.UserService.GetSystemListDataAsync<UserSystemData>(userIds, $"{MasaStackConsts.MC_SYSTEM_ID}:{channel.Code}");
//return userSystemDatas.ToDictionary(x => x.Key, x => x.Value.ClientId);
var userSystemDatas = await _authClient.UserService.GetSystemListDataAsync<UserSystemData>(userIds, $"{MasaStackProject.MC.Name}:{channel.Code}");
return userSystemDatas.ToDictionary(x => x.Key, x => x.Value?.ClientId ?? string.Empty);
}

private async Task<IEnumerable<MessageReceiverUser>> TransformDepartmentReceiversAsync(AppChannel channel, ExtraPropertyDictionary variables, IEnumerable<MessageTaskReceiver> receivers)
Expand Down Expand Up @@ -205,7 +189,7 @@ private async Task<string> GetChannelUserIdentity(AppChannel Channel, Receiver r
{
if (Channel.Type == ChannelType.App)
{
var userSystemData = await _authClient.UserService.GetSystemDataAsync<UserSystemData>(receiver.SubjectId, $"{MasaStackConsts.MC_SYSTEM_ID}:{Channel.Code}");
var userSystemData = await _authClient.UserService.GetSystemDataAsync<UserSystemData>(receiver.SubjectId, $"{MasaStackProject.MC.Name}:{Channel.Code}");
return userSystemData?.ClientId ?? string.Empty;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<Guid> RegisterJobAsync(Guid jobId, Guid messageTaskId, string

var request = new UpsertSchedulerJobRequest
{
ProjectIdentity = MasaStackConsts.MC_SYSTEM_ID,
ProjectIdentity = MasaStackProject.MC.Name,
Name = jobName,
JobType = JobTypes.Http,
CronExpression = cronExpression,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public async Task ResendAsync(IEventBus eventBus, Guid id)
[RoutePattern(HttpMethod = "Post")]
public async Task BindClientIdAsync([FromServices] IMasaConfiguration configuration, [FromServices] IAuthClient authClient, BindClientIdInputDto inputDto)
{
var systemId = $"{MasaStackConsts.MC_SYSTEM_ID}:{inputDto.ChannelCode}";
var systemId = $"{MasaStackProject.MC.Name}:{inputDto.ChannelCode}";
var userSystemData = await authClient.UserService.GetSystemDataAsync<UserSystemDataDto>(systemId) ?? new();
userSystemData.ClientId = inputDto.ClientId;
await authClient.UserService.UpsertSystemDataAsync<UserSystemDataDto>(systemId, userSystemData);
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Masa.Mc.Web.Admin/Masa.Mc.Web.Admin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Mapster" Version="7.3.0" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.Identity" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Stack.Components" Version="0.0.403" />
<PackageReference Include="Masa.Stack.Components" Version="0.0.409" />
<PackageReference Include="Masa.Utils.Data.Elasticsearch" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.16" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial class OrdinaryMessageCreateModal : AdminCompontentBase
public EventCallback OnOk { get; set; }

private MForm? _form;
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackConsts.MC_SYSTEM_ID };
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackProject.MC.Name };
private bool _visible;
private List<ChannelDto> _channelItems = new();
private List<MessageTaskReceiverDto> _selectReceivers = new();
Expand Down Expand Up @@ -89,7 +89,7 @@ private async Task HandleOkAsync()

private void ResetForm()
{
_model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackConsts.MC_SYSTEM_ID };
_model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackProject.MC.Name };
_selectReceivers = new();
_importReceivers = new();
_selectReceiverType = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial class OrdinaryMessageEditModal : AdminCompontentBase
public EventCallback OnOk { get; set; }

private MForm? _form;
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackConsts.MC_SYSTEM_ID };
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackProject.MC.Name };
private Guid _entityId;
private bool _visible;
private List<ChannelDto> _channelItems = new();
Expand Down Expand Up @@ -114,7 +114,7 @@ private async Task HandleOkAsync()

private void ResetForm()
{
_model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackConsts.MC_SYSTEM_ID };
_model = new() { EntityType = MessageEntityTypes.Ordinary, SystemId = MasaStackProject.MC.Name };
_selectReceivers = new();
_importReceivers = new();
_selectReceiverType = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial class TemplateMessageCreateModal : AdminCompontentBase
public EventCallback OnOk { get; set; }

private MForm? _form;
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackConsts.MC_SYSTEM_ID };
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackProject.MC.Name };
private bool _visible;
private List<MessageTemplateDto> _templateItems = new();
private MessageTemplateDto _messageInfo = new();
Expand Down Expand Up @@ -82,7 +82,7 @@ private async Task HandleOkAsync()

private void ResetForm()
{
_model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackConsts.MC_SYSTEM_ID };
_model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackProject.MC.Name };
_selectReceivers = new();
_importReceivers = new();
_selectReceiverType = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial class TemplateMessageEditModal : AdminCompontentBase
public EventCallback OnOk { get; set; }

private MForm? _form;
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackConsts.MC_SYSTEM_ID };
private MessageTaskUpsertModel _model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackProject.MC.Name };
private Guid _entityId;
private bool _visible;
private List<MessageTemplateDto> _templateItems = new();
Expand Down Expand Up @@ -110,7 +110,7 @@ private async Task HandleOkAsync()

private void ResetForm()
{
_model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackConsts.MC_SYSTEM_ID };
_model = new() { EntityType = MessageEntityTypes.Template, SystemId = MasaStackProject.MC.Name };
_selectReceivers = new();
_importReceivers = new();
_selectReceiverType = false;
Expand Down
3 changes: 2 additions & 1 deletion src/Web/Masa.Mc.Web.Admin/_Imports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@
global using Masa.BuildingBlocks.StackSdks.Auth;
global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model;
global using Masa.Stack.Components.Extensions;
global using Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions;
global using Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions;
global using Masa.Contrib.StackSdks.Config;

0 comments on commit bcd4325

Please sign in to comment.