1 Star 0 Fork 191

984141790/hm-tools-wxmp-adapter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
IQrcodeApisTest.java 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
JHybo 提交于 2020-06-01 22:09 . 生成带参数的二维码 测试OK
package top.hmtools.wxmp.account.apis;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import top.hmtools.wxmp.account.BaseTest;
import top.hmtools.wxmp.account.enums.EQRActionName;
import top.hmtools.wxmp.account.models.ActionInfo;
import top.hmtools.wxmp.account.models.QRCodeParam;
import top.hmtools.wxmp.account.models.QRCodeResult;
import top.hmtools.wxmp.account.models.Scene;
import top.hmtools.wxmp.account.models.TicketParam;
public class IQrcodeApisTest extends BaseTest {
private IQrcodeApis qrcodeApis ;
@Test
public void testCreate() {
QRCodeParam codeParam = new QRCodeParam();
ActionInfo action_info = new ActionInfo();
Scene scene = new Scene();
scene.setScene_str("aaaabbbbcccc");
action_info.setScene(scene);
codeParam.setAction_info(action_info);
codeParam.setAction_name(EQRActionName.QR_STR_SCENE);
codeParam.setExpire_seconds(20*60*60*60L);
QRCodeResult create = this.qrcodeApis.create(codeParam);
this.printFormatedJson("创建二维码ticket", create);
}
@Test
public void testShowQrCode() throws IOException {
TicketParam ticketParam = new TicketParam();
ticketParam.setTicket("gQF78DwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyaV9LNVo3VUM5UV8xVi1qWWh1YzIAAgR_BtVeAwQAjScA");
InputStream showQrCode = this.qrcodeApis.showQrCode(ticketParam);
this.printFormatedJson("通过ticket换取二维码", IOUtils.toByteArray(showQrCode));
}
@Override
public void initSub() {
this.qrcodeApis = this.wxmpSession.getMapper(IQrcodeApis.class);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/qj153291/hm-tools-wxmp-adapter.git
git@gitee.com:qj153291/hm-tools-wxmp-adapter.git
qj153291
hm-tools-wxmp-adapter
hm-tools-wxmp-adapter
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385