mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
chore: 移除 lombok 依赖
再度精简依赖
This commit is contained in:
@@ -18,8 +18,8 @@ package top.charles7c.continew.starter.storage.local.autoconfigure;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -37,16 +37,19 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableWebMvc
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@EnableConfigurationProperties(LocalStorageProperties.class)
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.STORAGE_LOCAL, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
public class LocalStorageAutoConfiguration implements WebMvcConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LocalStorageAutoConfiguration.class);
|
||||
private final LocalStorageProperties properties;
|
||||
|
||||
public LocalStorageAutoConfiguration(LocalStorageProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
Map<String, LocalStorageProperties.LocalStorageMapping> mappingMap = properties.getMapping();
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.storage.local.autoconfigure;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
@@ -30,7 +29,6 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.STORAGE_LOCAL)
|
||||
public class LocalStorageProperties {
|
||||
|
||||
@@ -47,7 +45,6 @@ public class LocalStorageProperties {
|
||||
/**
|
||||
* 本地存储映射
|
||||
*/
|
||||
@Data
|
||||
public static class LocalStorageMapping {
|
||||
|
||||
/**
|
||||
@@ -64,5 +61,55 @@ public class LocalStorageProperties {
|
||||
* 单文件上传大小限制
|
||||
*/
|
||||
private DataSize maxFileSize = DataSize.ofMegabytes(1);
|
||||
|
||||
public String getPathPattern() {
|
||||
return pathPattern;
|
||||
}
|
||||
|
||||
public void setPathPattern(String pathPattern) {
|
||||
this.pathPattern = pathPattern;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public DataSize getMaxFileSize() {
|
||||
return maxFileSize;
|
||||
}
|
||||
|
||||
public void setMaxFileSize(DataSize maxFileSize) {
|
||||
this.maxFileSize = maxFileSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LocalStorageMapping{" + "pathPattern='" + pathPattern + '\'' + ", location='" + location + '\'' + ", maxFileSize=" + maxFileSize + '}';
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Map<String, LocalStorageMapping> getMapping() {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
public void setMapping(Map<String, LocalStorageMapping> mapping) {
|
||||
this.mapping = mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LocalStorageProperties{" + "enabled=" + enabled + ", mapping=" + mapping + '}';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user