|
|
@ -7,6 +7,7 @@ import com.dji.sample.media.model.StsCredentialsDTO; |
|
|
|
import com.dji.sample.storage.service.IStorageService; |
|
|
|
import com.dji.sample.storage.service.IStorageService; |
|
|
|
import com.dji.sample.storage.service.impl.AliyunStorageServiceImpl; |
|
|
|
import com.dji.sample.storage.service.impl.AliyunStorageServiceImpl; |
|
|
|
import com.dji.sample.storage.service.impl.MinIOStorageServiceImpl; |
|
|
|
import com.dji.sample.storage.service.impl.MinIOStorageServiceImpl; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
@ -20,13 +21,14 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RestController |
|
|
|
@RestController |
|
|
|
@RequestMapping("${url.storage.prefix}${url.storage.version}/workspaces/") |
|
|
|
@RequestMapping("${url.storage.prefix}${url.storage.version}/workspaces/") |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
public class StorageController { |
|
|
|
public class StorageController { |
|
|
|
|
|
|
|
|
|
|
|
private IStorageService storageService; |
|
|
|
private IStorageService storageService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private void setOssService(@Autowired AliyunStorageServiceImpl aliyunStorageService, |
|
|
|
private void setOssService(@Autowired(required = false) AliyunStorageServiceImpl aliyunStorageService, |
|
|
|
@Autowired MinIOStorageServiceImpl minIOStorageService) { |
|
|
|
@Autowired(required = false) MinIOStorageServiceImpl minIOStorageService) { |
|
|
|
if (AliyunOSSConfiguration.enable) { |
|
|
|
if (AliyunOSSConfiguration.enable) { |
|
|
|
this.storageService = aliyunStorageService; |
|
|
|
this.storageService = aliyunStorageService; |
|
|
|
return; |
|
|
|
return; |
|
|
@ -35,7 +37,7 @@ public class StorageController { |
|
|
|
this.storageService = minIOStorageService; |
|
|
|
this.storageService = minIOStorageService; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new NullPointerException("storageService is null."); |
|
|
|
log.error("storageService is null."); |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get temporary credentials for uploading the media and wayline in DJI Pilot. |
|
|
|
* Get temporary credentials for uploading the media and wayline in DJI Pilot. |
|
|
|