feat: initialize shared tenant workbench data
This commit is contained in:
@@ -26,7 +26,7 @@ func (s *sSysImMailboxConfig) Get(ctx context.Context, in *sysin.ImMailboxConfig
|
||||
return nil, err
|
||||
}
|
||||
res = &sysin.ImMailboxConfigModel{}
|
||||
if err = imworkbench.DefaultClient(ctx).Get(ctx, "/internal/admin/workbench/mailbox-config", nil, res); err != nil {
|
||||
if err = imworkbench.DefaultClient(ctx).GetForTenant(ctx, "/internal/admin/workbench/mailbox-config", nil, tenant.Id, tenant.Code, res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if res != nil {
|
||||
@@ -52,7 +52,7 @@ func (s *sSysImMailboxConfig) Update(ctx context.Context, in *sysin.ImMailboxCon
|
||||
if in.AttachmentPolicy != nil && in.AttachmentPolicy.String() != "" && in.AttachmentPolicy.String() != "null" {
|
||||
attachmentPolicy = in.AttachmentPolicy.String()
|
||||
}
|
||||
if err = imworkbench.DefaultClient(ctx).Post(ctx, "/internal/admin/workbench/mailbox-config", g.Map{
|
||||
if err = imworkbench.DefaultClient(ctx).PostForTenant(ctx, "/internal/admin/workbench/mailbox-config", g.Map{
|
||||
"enabled": in.Enabled,
|
||||
"allow_anonymous": in.AllowAnonymous,
|
||||
"required_fields": requiredFields,
|
||||
@@ -60,7 +60,7 @@ func (s *sSysImMailboxConfig) Update(ctx context.Context, in *sysin.ImMailboxCon
|
||||
"attachment_policy": attachmentPolicy,
|
||||
"notice_title": in.NoticeTitle,
|
||||
"notice_content": in.NoticeContent,
|
||||
}, nil); err != nil {
|
||||
}, tenant.Id, tenant.Code, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
_ = writeImAdminAudit(ctx, tenant.Id, "im_mailbox_config_update", "im_mailbox_config", 1, "success", g.Map{"enabled": in.Enabled})
|
||||
|
||||
Reference in New Issue
Block a user