优化代码

This commit is contained in:
阿沐 2023-03-31 22:31:49 +08:00
parent 476646d1e0
commit acb5c077da
2 changed files with 3 additions and 8 deletions

View File

@ -4,7 +4,6 @@ import io.minio.BucketExistsArgs;
import io.minio.MakeBucketArgs;
import io.minio.MinioClient;
import io.minio.PutObjectArgs;
import net.maku.framework.common.constant.Constant;
import net.maku.framework.common.exception.ServerException;
import net.maku.storage.properties.StorageProperties;
import org.springframework.http.MediaType;
@ -44,7 +43,7 @@ public class MinioStorageService extends StorageService {
minioClient.makeBucket(MakeBucketArgs.builder().bucket(properties.getMinio().getBucketName()).build());
}
String contentType = Constant.CONTENTTYPE_OCTET_STREAM;
String contentType = MediaType.APPLICATION_OCTET_STREAM_VALUE;
Optional<MediaType> mediaType = MediaTypeFactory.getMediaType(path);
if (mediaType.isPresent()) {
contentType = mediaType.get().toString();

View File

@ -45,12 +45,8 @@ public interface Constant {
String OK = "OK";
/**
* pgsql的driver
*/
String PGSQL_DRIVER = "org.postgresql.Driver";
/**
* Content-Type
* pgsql的driver
*/
String CONTENTTYPE_OCTET_STREAM = "application/octet-stream";
String PGSQL_DRIVER = "org.postgresql.Driver";
}