fix(邮件通知): 优化获取邮件附件,过大时的抛错国际化 (#568)

* fix(邮件通知): 优化获取邮件附件,过大时的抛错国际化

* fix(邮件通知): 优化使用通用的国际化信息

* fix(邮件通知): 代码优化

---------

Co-authored-by: fighter-wang <11291691+fighter-wang@user.noreply.gitee.com>
This commit is contained in:
fighter-wang 2024-09-03 18:32:39 +08:00 committed by GitHub
parent 3ce520ebe6
commit bf7e19c92e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -154,7 +154,14 @@ public class DefaultEmailNotifier extends AbstractNotifier<EmailTemplate> {
return Flux
.fromIterable(template.getAttachments().entrySet())
.flatMap(entry -> Mono.zip(Mono.just(entry.getKey()), convertResource(entry.getValue())))
.flatMap(entry -> Mono
.zip(Mono.just(entry.getKey()), convertResource(entry.getValue()))
.onErrorResume(err -> Mono
.error(() -> new BusinessException.NoStackTrace("error.load_attachment_failed",
500,
entry.getKey(),
err.getMessage())))
)
.flatMap(tp2 -> Mono
.fromCallable(() -> {
//添加附件

View File

@ -0,0 +1 @@
error.load_attachment_failed=load attachment [{0}] failed:{1}

View File

@ -0,0 +1 @@
error.load_attachment_failed=\u52A0\u8F7D\u9644\u4EF6[{0}]\u5931\u8D25\uFF1A{1}