package com.xunhong.erp.turbo.infra.app.executor.query;


import com.xunhong.erp.turbo.api.user.dto.vo.OssTokenVO;
import com.xunhong.erp.turbo.infra.domain.entity.Credentials;
import com.xunhong.erp.turbo.infra.domain.gateway.OssGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author m809745357
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class OssTokenQryExe {

	private final OssGateway ossGateway;

	/**
	 * @return
	 */
	public OssTokenVO execute() {
		Credentials ossToken = ossGateway.getOssToken();
		OssTokenVO ossTokenVO = new OssTokenVO();
		ossTokenVO.setSecurityToken(ossToken.getSecurityToken());
		ossTokenVO.setAccessKeyId(ossToken.getAccessKeyId());
		ossTokenVO.setAccessKeySecret(ossToken.getAccessKeySecret());
		ossTokenVO.setDomain(ossToken.getDomain());
		ossTokenVO.setRegion(ossToken.getRegion());
		ossTokenVO.setBucket(ossToken.getBucket());
		return ossTokenVO;
	}
}
