🆕 #4029 【视频号】增加微信小店店铺链接与收藏管理相关接口
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import me.chanjar.weixin.channel.api.WxChannelFavoriteService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelService;
|
||||
import me.chanjar.weixin.channel.bean.favorite.FavoriteCountResponse;
|
||||
import me.chanjar.weixin.channel.test.ApiTestModule;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* 收藏管理接口 测试
|
||||
*
|
||||
* @author <a href="https://github.com/copilot">GitHub Copilot</a>
|
||||
*/
|
||||
@Guice(modules = ApiTestModule.class)
|
||||
public class WxChannelFavoriteServiceImplTest {
|
||||
|
||||
@Inject
|
||||
private WxChannelService channelService;
|
||||
|
||||
@Test
|
||||
public void testGetFavoriteCount() throws WxErrorException {
|
||||
WxChannelFavoriteService favoriteService = channelService.getFavoriteService();
|
||||
FavoriteCountResponse response = favoriteService.getFavoriteCount();
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
System.out.println(JsonUtils.encode(response));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import me.chanjar.weixin.channel.api.WxChannelBasicService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelService;
|
||||
import me.chanjar.weixin.channel.bean.shop.ShopH5UrlResponse;
|
||||
import me.chanjar.weixin.channel.bean.shop.ShopQrCodeResponse;
|
||||
import me.chanjar.weixin.channel.bean.shop.ShopTagLinkResponse;
|
||||
import me.chanjar.weixin.channel.test.ApiTestModule;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* 店铺链接接口 测试
|
||||
*
|
||||
* @author <a href="https://github.com/copilot">GitHub Copilot</a>
|
||||
*/
|
||||
@Guice(modules = ApiTestModule.class)
|
||||
public class WxChannelShopLinkServiceImplTest {
|
||||
|
||||
@Inject
|
||||
private WxChannelService channelService;
|
||||
|
||||
@Test
|
||||
public void testGetShopH5Url() throws WxErrorException {
|
||||
WxChannelBasicService basicService = channelService.getBasicService();
|
||||
ShopH5UrlResponse response = basicService.getShopH5Url();
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
System.out.println(JsonUtils.encode(response));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetShopQrCode() throws WxErrorException {
|
||||
WxChannelBasicService basicService = channelService.getBasicService();
|
||||
// qrcodeType: 1=二维码, 2=标准物料, 3=送礼物物料
|
||||
ShopQrCodeResponse response = basicService.getShopQrCode(1);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
System.out.println(JsonUtils.encode(response));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetShopTagLink() throws WxErrorException {
|
||||
WxChannelBasicService basicService = channelService.getBasicService();
|
||||
ShopTagLinkResponse response = basicService.getShopTagLink();
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
System.out.println(JsonUtils.encode(response));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user