| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | public String getIpPort() { |
| | | return tcpserver + "/" + tcpport; |
| | | return tcpserver + ":" + tcpport; |
| | | } |
| | | |
| | | @Resource |
| | |
| | | .encryptStr(getEncryptStr()) |
| | | .timeStamp(timestamp) |
| | | .build(); |
| | | TyHttpCommonReceiver<AccessTokenReceiver> getTokenRes = tyClient.getToken(gtd); |
| | | try { |
| | | TyHttpCommonReceiver<AccessTokenReceiver> getTokenRes = tyClient.getToken(gtd); |
| | | accessToken = getTokenRes.getContent(); |
| | | } catch (Exception e) { |
| | | log.error("获取token失败:{}", e.getMessage()); |
| | | } |
| | | //{"state":0,"content":{"companyId":4127,"accessToken":"sOONT0MMVdoKcMBibb40xxgrUrq0Hw9RFiajic3KOzoNtk"}} |
| | | accessToken = getTokenRes.getContent(); |
| | | return accessToken; |
| | | } |
| | | |
| | | } |