forked from elunez/eladmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
78 additions
and
27 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
eladmin-common/src/main/java/me/zhengjie/config/FileProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.zhengjie.config; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Data | ||
@Configuration | ||
@ConfigurationProperties(prefix = "file") | ||
public class FileProperties { | ||
|
||
/** 文件大小限制 */ | ||
private Long maxSize; | ||
|
||
/** 头像大小限制 */ | ||
private Long avatarMaxSize; | ||
|
||
private ElPath mac; | ||
|
||
private ElPath linux; | ||
|
||
private ElPath windows; | ||
|
||
public ElPath getPath(){ | ||
String os = System.getProperty("os.name"); | ||
if(os.toLowerCase().startsWith("win")) { | ||
return windows; | ||
} else if(os.toLowerCase().startsWith("mac")){ | ||
return mac; | ||
} | ||
return linux; | ||
} | ||
|
||
@Data | ||
public static class ElPath{ | ||
|
||
private String path; | ||
|
||
private String avatar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters