✨ feat: 添加多语言可以追加
This commit is contained in:
parent
723f85e3e3
commit
4ef9f7c2e6
|
@ -28,4 +28,8 @@ public class I18nUpdateByFileDto {
|
|||
@NotBlank(message = "多语言key不能为空")
|
||||
private String fileType;
|
||||
|
||||
@Schema(name = "append", title = "文件类型/json/excel")
|
||||
@NotNull(message = "是否追加")
|
||||
private Boolean append = true;
|
||||
|
||||
}
|
10392
auth_admin.sql
10392
auth_admin.sql
File diff suppressed because it is too large
Load Diff
|
@ -219,6 +219,7 @@ public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18n> implements I1
|
|||
String type = dto.getType();
|
||||
MultipartFile file = dto.getFile();
|
||||
String fileType = dto.getFileType();
|
||||
Boolean append = dto.getAppend();
|
||||
|
||||
// 判断是否有这个语言的key
|
||||
List<I18nType> i18nTypeList = i18nTypeMapper.selectList(Wrappers.<I18nType>lambdaQuery().eq(I18nType::getTypeName, type));
|
||||
|
@ -235,7 +236,7 @@ public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18n> implements I1
|
|||
List<Long> ids = i18nList.stream().map(BaseEntity::getId).toList();
|
||||
|
||||
// 删除这个类型下所有的多语言
|
||||
if (!ids.isEmpty()) removeByIds(ids);
|
||||
if (!ids.isEmpty() && !append) removeByIds(ids);
|
||||
|
||||
// 存入内容
|
||||
if (fileType.equals(FileType.JSON)) {
|
||||
|
|
Loading…
Reference in New Issue