91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.92MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-09-02
  • 語言: Java
  • 標簽:

資源簡介

在環(huán)信官網(wǎng)對java調(diào)用例子很少,至少我沒找到。我在網(wǎng)上找到一個demo,進行了一系列bug修復后重新共享給大家。

資源截圖

代碼片段和文件信息

package?com.lianqu.huanxin.core.model;
import?java.util.HashMap;
import?java.util.Map;

import?org.apache.http.client.methods.HttpEntityEnclosingRequestbase;
import?org.apache.http.client.methods.HttpRequestbase;

import?com.lianqu.huanxin.core.service.TalkHttpService;
import?com.lianqu.huanxin.core.tool._Global;
public?class?Authentic?{
private?static?Token?token?=?new?Token();
private?TalkHttpService?service;
public?Authentic(TalkHttpService?service)?{
this.service?=?service;
}
public?Authentic(TalkHttpService?service?Token?token)?{
this.service?=?service;
if(token!=null){
Authentic.token?=?token;
}
}
public?Token?getToken()?{
this.flush();
return?token;
}
public?void?task()?{
this.flush();
}
public?void?applyAuthentication(HttpEntityEnclosingRequestbase?request)?{
this.flush();
request.addHeader(“Authorization““Bearer?“+token.toString());
}
public?void?applyAuthentication(HttpRequestbase?request)?{
this.flush();
request.addHeader(“Authorization““Bearer?“+token.toString());
}
private?void?flush()?{
synchronized(Authentic.class){
try{
if(token.isExpire()){
if(_Global.APP_CLIENT_ID!=null&&_Global.APP_CLIENT_SECRET!=null){
Mapject>param?=?new?HashMapject>();
param.put(“grant_type““client_credentials“);
param.put(“client_id“_Global.APP_CLIENT_ID);
param.put(“client_secret“_Global.APP_CLIENT_SECRET);
TalkNode?res?=?service.request(_Global.URR_TOKEN_Global.HTTP_METHOD_POSTparamnullnull);
if(res!=null&&res.getAccess_token()!=null&&res.getExpires_in()!=null&&res.getExpires_in()>0){
token?=?new?Token(res.getAccess_token()res.getExpires_in()*1000+System.currentTimeMillis());
}
}
}
}catch(Exception?e){
e.printStackTrace();
}
}
}
public?static?class?Token?{
private?String?token;
private?Long?expire;
public?Token()?{}
public?Token(String?token?long?expire)?{
this.token?=?token;
this.expire?=?expire;
}
public?String?getToken()?{
return?token;
}
public?void?setToken(String?token)?{
this.token?=?token;
}
public?Long?getExpire()?{
return?expire;
}
public?void?setExpire(Long?expire)?{
this.expire?=?expire;
}
public?boolean?isExpire()?{
return?expire==null||System.currentTimeMillis()>expire;
}
@Override
public?String?toString()?{
return?token;
}
}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-10-31?18:38??HXTest\
?????文件?????????529??2017-10-31?18:38??HXTest\.classpath
?????目錄???????????0??2017-10-31?18:38??HXTest\.myeclipse\
?????文件?????????285??2017-11-29?10:34??HXTest\.mymetadata
?????文件????????1533??2017-10-31?18:38??HXTest\.project
?????目錄???????????0??2017-10-31?18:39??HXTest\.settings\
?????文件?????????493??2017-10-31?18:38??HXTest\.settings\.jsdtscope
?????文件?????????107??2017-11-29?10:46??HXTest\.settings\org.eclipse.core.resources.prefs
?????文件?????????395??2017-10-31?18:38??HXTest\.settings\org.eclipse.jdt.core.prefs
?????文件?????????450??2017-10-31?18:38??HXTest\.settings\org.eclipse.wst.common.component
?????文件?????????252??2017-10-31?18:38??HXTest\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2017-10-31?18:38??HXTest\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2017-10-31?18:38??HXTest\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2017-11-29?10:46??HXTest\src\
?????目錄???????????0??2017-11-29?10:46??HXTest\src\com\
?????目錄???????????0??2017-11-29?10:35??HXTest\src\com\lianqu\
?????目錄???????????0??2017-11-29?10:36??HXTest\src\com\lianqu\huanxin\
?????目錄???????????0??2017-11-29?10:35??HXTest\src\com\lianqu\huanxin\core\
?????目錄???????????0??2017-11-29?10:35??HXTest\src\com\lianqu\huanxin\core\model\
?????文件????????2473??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\Authentic.java
?????文件????????1703??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkChat.java
?????文件????????1055??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkChatBody.java
?????文件?????????285??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkChatPayload.java
?????文件????????1356??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkGroup.java
?????文件?????????840??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkGroupFriend.java
?????文件????????1045??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkGroupMember.java
?????文件????????2591??2017-11-21?17:29??HXTest\src\com\lianqu\huanxin\core\model\TalkGroupNew.java
?????文件????????3675??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkMsg.java
?????文件????????8301??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkNode.java
?????文件????????1860??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkRoom.java
?????文件?????????371??2017-11-21?09:23??HXTest\src\com\lianqu\huanxin\core\model\TalkRoomMember.java
............此處省略64個文件信息

評論

共有 條評論