feat: file module support i18n message
This commit is contained in:
@@ -123,6 +123,8 @@ job.cron.not.blank=Cron expression cannot be blank
|
|||||||
job.cron.length.valid=Cron expression length cannot exceed 255 characters
|
job.cron.length.valid=Cron expression length cannot exceed 255 characters
|
||||||
job.execute.success=The scheduled task was executed successfully, the time taken: {0} milliseconds
|
job.execute.success=The scheduled task was executed successfully, the time taken: {0} milliseconds
|
||||||
job.execute.spend.time=the time taken: {0} milliseconds
|
job.execute.spend.time=the time taken: {0} milliseconds
|
||||||
|
## wfc-file
|
||||||
|
file.cannot.null=File must not be null or empty
|
||||||
|
|
||||||
## wfc-common
|
## wfc-common
|
||||||
common.operate.success=Operation successful
|
common.operate.success=Operation successful
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ job.cron.not.blank=Cron expression cannot be blank
|
|||||||
job.cron.length.valid=Cron expression length cannot exceed 255 characters
|
job.cron.length.valid=Cron expression length cannot exceed 255 characters
|
||||||
job.execute.success=The scheduled task was executed successfully, the time taken: {0} milliseconds
|
job.execute.success=The scheduled task was executed successfully, the time taken: {0} milliseconds
|
||||||
job.execute.spend.time=the time taken: {0} milliseconds
|
job.execute.spend.time=the time taken: {0} milliseconds
|
||||||
|
## wfc-file
|
||||||
|
file.cannot.null=File must not be null or empty
|
||||||
|
|
||||||
## wfc-common
|
## wfc-common
|
||||||
common.operate.success=Operation successful
|
common.operate.success=Operation successful
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ job.cron.not.blank=Cron表达式不能为空
|
|||||||
job.cron.length.valid=Cron执行表达式不能超过255个字符
|
job.cron.length.valid=Cron执行表达式不能超过255个字符
|
||||||
job.execute.success=定时任务执行成功, 耗时:{0} 毫秒
|
job.execute.success=定时任务执行成功, 耗时:{0} 毫秒
|
||||||
job.execute.spend.time=总共耗时:{0} 毫秒
|
job.execute.spend.time=总共耗时:{0} 毫秒
|
||||||
|
## wfc-file
|
||||||
|
file.cannot.null=文件不能为空
|
||||||
|
|
||||||
## wfc-common
|
## wfc-common
|
||||||
common.operate.success=操作成功
|
common.operate.success=操作成功
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.wfc.common.core.exception.file.FileNameLengthLimitExceededException;
|
|||||||
import org.wfc.common.core.exception.file.FileSizeLimitExceededException;
|
import org.wfc.common.core.exception.file.FileSizeLimitExceededException;
|
||||||
import org.wfc.common.core.exception.file.InvalidExtensionException;
|
import org.wfc.common.core.exception.file.InvalidExtensionException;
|
||||||
import org.wfc.common.core.utils.DateUtils;
|
import org.wfc.common.core.utils.DateUtils;
|
||||||
|
import org.wfc.common.core.utils.MessageUtils;
|
||||||
import org.wfc.common.core.utils.StringUtils;
|
import org.wfc.common.core.utils.StringUtils;
|
||||||
import org.wfc.common.core.utils.file.FileTypeUtils;
|
import org.wfc.common.core.utils.file.FileTypeUtils;
|
||||||
import org.wfc.common.core.utils.file.MimeTypeUtils;
|
import org.wfc.common.core.utils.file.MimeTypeUtils;
|
||||||
@@ -66,7 +67,7 @@ public class FileUploadUtils {
|
|||||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||||
InvalidExtensionException {
|
InvalidExtensionException {
|
||||||
if (file == null || file.isEmpty()) {
|
if (file == null || file.isEmpty()) {
|
||||||
throw new IllegalArgumentException("File must not be null or empty");
|
throw new IllegalArgumentException(MessageUtils.message("file.cannot.null"));
|
||||||
}
|
}
|
||||||
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
|
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
|
||||||
|
|||||||
Reference in New Issue
Block a user