sean.zhou
2022-03-21 17835b967b48f2676cce3bbed081c6580602ee1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.dji.sample.storage.service.impl;
 
import com.dji.sample.component.oss.model.MinIOConfiguration;
import com.dji.sample.component.oss.service.impl.MinIOServiceImpl;
import com.dji.sample.media.model.StsCredentialsDTO;
import com.dji.sample.storage.service.IStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
/**
 * @author sean
 * @version 0.3
 * @date 2021/12/31
 */
@Service
public class MinIOStorageServiceImpl implements IStorageService {
 
    @Autowired
    private MinIOServiceImpl ossService;
 
    @Override
    public StsCredentialsDTO getSTSCredentials() {
        return StsCredentialsDTO.builder()
                .endpoint(MinIOConfiguration.endpoint)
                .bucket(MinIOConfiguration.bucket)
                .credentials(ossService.getCredentials())
                .provider(MinIOConfiguration.PROVIDER)
                .objectKeyPrefix(MinIOConfiguration.objectDirPrefix)
                .region(MinIOConfiguration.region)
                .build();
    }
 
 
}