feat(controller): 新增多个任务类用于合同和客户相关操作 feat(service): 新增ProxyUtils工具类替代Hibernate.isInitialized检查 refactor(controller): 重构多个控制器和皮肤类,使用ProxyUtils替代Hibernate refactor(service): 重构服务类,移除Hibernate依赖并优化方法实现 fix(controller): 修复表格单元格初始化逻辑,确保代理对象正确加载 chore: 更新项目版本号至0.0.58-SNAPSHOT docs: 添加MyProperties类用于管理下载路径配置
36 lines
931 B
Java
36 lines
931 B
Java
package com.ecep.contract;
|
|
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import java.io.File;
|
|
import java.nio.file.Path;
|
|
import java.nio.file.Paths;
|
|
|
|
@Component
|
|
@ConfigurationProperties(prefix = "my")
|
|
public class MyProperties {
|
|
@Getter
|
|
@Setter
|
|
private String downloadsPath;
|
|
|
|
|
|
/**
|
|
* 尝试返回当前用户的下载文件夹
|
|
*/
|
|
public File getDownloadDirectory() {
|
|
String downloadsPath = getDownloadsPath();
|
|
if (StringUtils.hasText(downloadsPath)) {
|
|
return new File(downloadsPath);
|
|
}
|
|
|
|
// 没有配置下载目录时,尝试使用默认设置
|
|
String home = System.getProperty("user.home");
|
|
Path path = Paths.get(home, "Downloads");
|
|
return path.toFile();
|
|
}
|
|
}
|