| | |
| | | import com.ard.tianyu.http.TyClient; |
| | | import com.ard.tianyu.model.dto.TokenDTO; |
| | | import com.ard.tianyu.model.receiver.AccessTokenReceiver; |
| | | import com.ard.tianyu.model.receiver.BoxReceiver; |
| | | import com.ard.tianyu.model.receiver.TyHttpCommonReceiver; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * TianyuConfiguration |
| | |
| | | |
| | | private String accesskeysecret; |
| | | |
| | | private String tcpserver; |
| | | |
| | | private Integer tcpport; |
| | | |
| | | private long timestamp; |
| | | public long getTimeStamp() |
| | | { |
| | | |
| | | public long getTimeStamp() { |
| | | timestamp = new Date().getTime(); |
| | | return timestamp; |
| | | } |
| | | |
| | | private String encryptstr; |
| | | |
| | | public String getEncryptStr() |
| | | { |
| | | public String getEncryptStr() { |
| | | String sb = new StringBuilder() |
| | | .append(accesskeyid) |
| | | .append(accesskeysecret) |
| | |
| | | return encryptstr; |
| | | } |
| | | |
| | | public String getIpPort() { |
| | | return tcpserver + ":" + tcpport; |
| | | } |
| | | |
| | | @Resource |
| | | private TyClient tyClient; |
| | | |
| | | private AccessTokenReceiver accessToken; |
| | | |
| | | public AccessTokenReceiver getAccessToken() { |
| | | if(accessToken != null) |
| | | if (accessToken != null) |
| | | return accessToken; |
| | | // 准备请求的json |
| | | TokenDTO gtd = TokenDTO.builder() |