mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
⬆️ 因旧版本 Spring 的安全问题, 升级 Spring 为 2.5.4 版本, 兼容新版本
This commit is contained in:
@@ -3,6 +3,7 @@ package im.zhaojun.zfile;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
/**
|
||||
@@ -10,6 +11,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
||||
*/
|
||||
@EnableAsync
|
||||
@SpringBootApplication
|
||||
@EnableJpaRepositories("im.zhaojun.zfile.repository")
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
public class ZfileApplication {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
@@ -31,7 +31,7 @@ public class OneDriveConfig {
|
||||
|
||||
ClientHttpRequestInterceptor interceptor = (httpRequest, bytes, clientHttpRequestExecution) -> {
|
||||
HttpHeaders headers = httpRequest.getHeaders();
|
||||
Integer driveId = Integer.valueOf(((LinkedList)headers.get("driveId")).get(0).toString());
|
||||
Integer driveId = Integer.valueOf(((List)headers.get("driveId")).get(0).toString());
|
||||
|
||||
StorageConfig accessTokenConfig =
|
||||
storageConfigService.findByDriveIdAndKey(driveId, StorageConfigConstant.ACCESS_TOKEN_KEY);
|
||||
|
||||
@@ -2,6 +2,7 @@ package im.zhaojun.zfile.model.entity;
|
||||
|
||||
import im.zhaojun.zfile.model.enums.StorageTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -15,6 +16,7 @@ import javax.persistence.Lob;
|
||||
*/
|
||||
@Entity(name = "STORAGE_CONFIG")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class StorageConfig {
|
||||
|
||||
@Id
|
||||
|
||||
@@ -67,7 +67,7 @@ public class DriveConfigService {
|
||||
* @return 驱动器列表
|
||||
*/
|
||||
public List<DriveConfig> list() {
|
||||
Sort sort = new Sort(Sort.Direction.ASC,"orderNum");
|
||||
Sort sort = Sort.by(Sort.Direction.ASC,"orderNum");
|
||||
return driverConfigRepository.findAll(sort);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DriveConfigService {
|
||||
DriveConfig driveConfig = new DriveConfig();
|
||||
driveConfig.setEnable(true);
|
||||
Example<DriveConfig> example = Example.of(driveConfig);
|
||||
Sort sort = new Sort(Sort.Direction.ASC,"orderNum");
|
||||
Sort sort = Sort.by(Sort.Direction.ASC,"orderNum");
|
||||
return driverConfigRepository.findAll(example, sort);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user