com.github.linyuzai.download.autoconfigure.properties.DownloadConceptProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of concept-download-spring-boot-starter Show documentation
Show all versions of concept-download-spring-boot-starter Show documentation
Build a download in a simple way
package com.github.linyuzai.download.autoconfigure.properties;
import com.github.linyuzai.download.core.cache.Cacheable;
import com.github.linyuzai.download.core.compress.CompressFormat;
import com.github.linyuzai.download.core.contenttype.ContentType;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.Map;
@Data
@ConfigurationProperties(prefix = "concept.download")
public class DownloadConceptProperties {
private ResponseProperties response = new ResponseProperties();
private SourceProperties source = new SourceProperties();
private CompressProperties compress = new CompressProperties();
@Data
public static class ResponseProperties {
/**
* Content-Type Header
*/
private String contentType = ContentType.OCTET_STREAM;
/**
* 额外的响应头 / Additional response headers
*/
private Map headers;
}
@Data
public static class SourceProperties {
private CacheProperties cache = new CacheProperties();
}
@Data
public static class CompressProperties {
/**
* 压缩格式 / Compression format
*/
private String format = CompressFormat.ZIP;
private CacheProperties cache = new CacheProperties();
}
@Data
public static class CacheProperties {
/**
* 是否开启缓存 / If cache is enabled
*/
private boolean enabled;
/**
* 缓存地址 / Path of cache
*/
private String path = Cacheable.PATH;
/**
* 下载结束后缓存是否删除 / If delete cache after downloading
*/
private boolean delete;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy