close #36
This commit is contained in:
parent
f65c64cbeb
commit
c6a9854717
@ -316,4 +316,33 @@ public enum JSSDKAPI {
|
|||||||
* 企业号会话接口集合
|
* 企业号会话接口集合
|
||||||
*/
|
*/
|
||||||
public final static JSSDKAPI[] CHAT_APIS = { openEnterpriseChat };
|
public final static JSSDKAPI[] CHAT_APIS = { openEnterpriseChat };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众平台全部接口集合
|
||||||
|
*/
|
||||||
|
public final static JSSDKAPI[] MP_ALL_APIS = { onMenuShareTimeline,
|
||||||
|
onMenuShareAppMessage, onMenuShareQQ, onMenuShareWeibo,
|
||||||
|
onMenuShareQZone, chooseImage, previewImage, uploadImage,
|
||||||
|
downloadImage, startRecord, stopRecord, onVoiceRecordEnd,
|
||||||
|
playVoice, pauseVoice, stopVoice, onVoicePlayEnd, uploadVoice,
|
||||||
|
downloadVoice, translateVoice, getNetworkType, openLocation,
|
||||||
|
getLocation, startSearchBeacons, stopSearchBeacons,
|
||||||
|
onSearchBeacons, hideOptionMenu, showOptionMenu, closeWindow,
|
||||||
|
hideMenuItems, showMenuItems, hideAllNonBaseMenuItem,
|
||||||
|
showAllNonBaseMenuItem, scanQRCode, openProductSpecificView,
|
||||||
|
chooseCard, addCard, openCard, consumeAndShareCard, chooseWXPay };
|
||||||
|
/**
|
||||||
|
* 企业号全部接口集合
|
||||||
|
*/
|
||||||
|
public final static JSSDKAPI[] QY_ALL_APIS = { onMenuShareTimeline,
|
||||||
|
onMenuShareAppMessage, onMenuShareQQ, onMenuShareWeibo,
|
||||||
|
onMenuShareQZone, chooseImage, previewImage, uploadImage,
|
||||||
|
downloadImage, startRecord, stopRecord, onVoiceRecordEnd,
|
||||||
|
playVoice, pauseVoice, stopVoice, onVoicePlayEnd, uploadVoice,
|
||||||
|
downloadVoice, translateVoice, getNetworkType, openLocation,
|
||||||
|
getLocation, startSearchBeacons, stopSearchBeacons,
|
||||||
|
onSearchBeacons, hideOptionMenu, showOptionMenu, closeWindow,
|
||||||
|
hideMenuItems, showMenuItems, hideAllNonBaseMenuItem,
|
||||||
|
showAllNonBaseMenuItem, scanQRCode, openEnterpriseChat,
|
||||||
|
openEnterpriseContact };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,9 @@ public class Weixin4jConfigUtil {
|
|||||||
String value = defaultValue;
|
String value = defaultValue;
|
||||||
try {
|
try {
|
||||||
value = getValue(key);
|
value = getValue(key);
|
||||||
|
if (StringUtil.isBlank(value)) {
|
||||||
|
value = defaultValue;
|
||||||
|
}
|
||||||
} catch (MissingResourceException e) {
|
} catch (MissingResourceException e) {
|
||||||
;
|
;
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
|
|||||||
@ -5,11 +5,9 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.model.WeixinAccount;
|
|
||||||
import com.foxinmy.weixin4j.mp.token.WeixinTokenCreator;
|
import com.foxinmy.weixin4j.mp.token.WeixinTokenCreator;
|
||||||
import com.foxinmy.weixin4j.token.FileTokenStorager;
|
|
||||||
import com.foxinmy.weixin4j.token.TokenHolder;
|
import com.foxinmy.weixin4j.token.TokenHolder;
|
||||||
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
import com.foxinmy.weixin4j.util.Weixin4jSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* token测试
|
* token测试
|
||||||
@ -22,14 +20,14 @@ import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
|||||||
public class TokenTest {
|
public class TokenTest {
|
||||||
|
|
||||||
protected TokenHolder tokenHolder;
|
protected TokenHolder tokenHolder;
|
||||||
|
protected Weixin4jSettings settings;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
WeixinAccount weixinAccount = Weixin4jConfigUtil.getWeixinAccount();
|
this.settings = new Weixin4jSettings();
|
||||||
tokenHolder = new TokenHolder(new WeixinTokenCreator(
|
tokenHolder = new TokenHolder(new WeixinTokenCreator(settings
|
||||||
weixinAccount.getId(), weixinAccount.getSecret()),
|
.getWeixinAccount().getId(), settings.getWeixinAccount()
|
||||||
new FileTokenStorager(Weixin4jConfigUtil.getValue("token.path",
|
.getSecret()), settings.getTokenStorager0());
|
||||||
"/tmp/weixin4j/token")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -5,11 +5,9 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.model.WeixinAccount;
|
|
||||||
import com.foxinmy.weixin4j.qy.token.WeixinTokenCreator;
|
import com.foxinmy.weixin4j.qy.token.WeixinTokenCreator;
|
||||||
import com.foxinmy.weixin4j.token.FileTokenStorager;
|
|
||||||
import com.foxinmy.weixin4j.token.TokenHolder;
|
import com.foxinmy.weixin4j.token.TokenHolder;
|
||||||
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
import com.foxinmy.weixin4j.util.Weixin4jSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* token测试
|
* token测试
|
||||||
@ -22,14 +20,14 @@ import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
|||||||
public class TokenTest {
|
public class TokenTest {
|
||||||
|
|
||||||
protected TokenHolder tokenHolder;
|
protected TokenHolder tokenHolder;
|
||||||
|
protected Weixin4jSettings settings;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
WeixinAccount weixinAccount = Weixin4jConfigUtil.getWeixinAccount();
|
this.settings = new Weixin4jSettings();
|
||||||
tokenHolder = new TokenHolder(new WeixinTokenCreator(
|
tokenHolder = new TokenHolder(new WeixinTokenCreator(settings
|
||||||
weixinAccount.getId(), weixinAccount.getSecret()),
|
.getWeixinAccount().getId(), settings.getWeixinAccount()
|
||||||
new FileTokenStorager(Weixin4jConfigUtil.getValue("token.path",
|
.getSecret()), settings.getTokenStorager0());
|
||||||
"/tmp/weixin4j/token")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user