refactor(system/file): 优化文件相关代码

This commit is contained in:
2025-03-13 21:13:38 +08:00
parent 27cf46409a
commit 74c4270323
6 changed files with 46 additions and 60 deletions

View File

@@ -1,48 +0,0 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.continew.admin.common.constant;
import top.continew.starter.core.constant.StringConstants;
import java.time.LocalDate;
/**
* 系统文件相关常量
*
* @author luoqiz
* @since 2025/3/12 18:11
*/
public class SysFileConstants {
/**
* 用户头像路径前缀
*/
public static final String USER_AVATAR_PATH = "user/avatar/";
/**
* 默认文件路径
*/
public static String getDefaultFilePath() {
LocalDate today = LocalDate.now();
String path = today.getYear() + StringConstants.SLASH + today.getMonthValue() + StringConstants.SLASH + today
.getDayOfMonth() + StringConstants.SLASH;
return path;
}
private SysFileConstants() {
}
}