Commit fdb9020f authored by xianjun's avatar xianjun

创建微信小程序接口实体

parent 8d3aded2
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetPerformanceDataRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetPerformanceDataRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetVisitDistributionRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetVisitDistributionRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -16,4 +16,20 @@ public class WxXcxAnalysisGetVisitDistributionRes extends WxXcxResponseBaseError
* 数据列表
*/
private WxXcxAnalysisGetVisitDistributionListRes list;
public String getRef_date() {
return ref_date;
}
public void setRef_date(String ref_date) {
this.ref_date = ref_date;
}
public WxXcxAnalysisGetVisitDistributionListRes getList() {
return list;
}
public void setList(WxXcxAnalysisGetVisitDistributionListRes list) {
this.list = list;
}
}
......@@ -4,8 +4,6 @@ package com.yanzuoguang.wxxcx.analysis.page;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.analysis.portrait.WxXcxAnalysisGetUserPortraitReq;
import com.yanzuoguang.wxxcx.analysis.portrait.WxXcxAnalysisGetUserPortraitRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -14,7 +12,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetVisitPageRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetVisitPageRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -3,8 +3,6 @@ package com.yanzuoguang.wxxcx.analysis.portrait;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.analysis.data.WxXcxAnalysisGetPerformanceDataReq;
import com.yanzuoguang.wxxcx.analysis.data.WxXcxAnalysisGetPerformanceDataRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -13,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetUserPortraitRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetUserPortraitRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -4,8 +4,6 @@ package com.yanzuoguang.wxxcx.analysis.retain;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataReq;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -13,14 +11,14 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetDailyRetainRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetDailyRetainRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxAuthCheckEncryptedDataReq req;
private final WxXcxAnalysisGetDailyRetainReq req;
public WxXcxAnalysisGetDailyRetainRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAuthCheckEncryptedDataReq req) {
public WxXcxAnalysisGetDailyRetainRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAnalysisGetDailyRetainReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
......@@ -42,11 +40,11 @@ public class WxXcxAnalysisGetDailyRetainRequest implements WxXwxRequestUrl, WxXc
return HttpHelper.getUrlParameter(req);
}
public WxXcxAuthCheckEncryptedDataRes getResponse() {
public WxXcxAnalysisGetDailyRetainRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthCheckEncryptedDataRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthCheckEncryptedDataRes>() {
WxXcxAnalysisGetDailyRetainRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetDailyRetainRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
......
......@@ -3,8 +3,6 @@ package com.yanzuoguang.wxxcx.analysis.retain;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataReq;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -12,14 +10,14 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetMonthlyRetainRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetMonthlyRetainRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxAuthCheckEncryptedDataReq req;
private final WxXcxAnalysisGetMonthlyRetainReq req;
public WxXcxAnalysisGetMonthlyRetainRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAuthCheckEncryptedDataReq req) {
public WxXcxAnalysisGetMonthlyRetainRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAnalysisGetMonthlyRetainReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
......@@ -41,11 +39,11 @@ public class WxXcxAnalysisGetMonthlyRetainRequest implements WxXwxRequestUrl, Wx
return HttpHelper.getUrlParameter(req);
}
public WxXcxAuthCheckEncryptedDataRes getResponse() {
public WxXcxAnalysisGetMonthlyRetainRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthCheckEncryptedDataRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthCheckEncryptedDataRes>() {
WxXcxAnalysisGetMonthlyRetainRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetMonthlyRetainRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
......
......@@ -4,8 +4,6 @@ package com.yanzuoguang.wxxcx.analysis.retain;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataReq;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -13,14 +11,14 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetWeeklyRetainRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetWeeklyRetainRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxAuthCheckEncryptedDataReq req;
private final WxXcxAnalysisGetWeeklyRetainReq req;
public WxXcxAnalysisGetWeeklyRetainRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAuthCheckEncryptedDataReq req) {
public WxXcxAnalysisGetWeeklyRetainRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAnalysisGetWeeklyRetainReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
......@@ -42,11 +40,11 @@ public class WxXcxAnalysisGetWeeklyRetainRequest implements WxXwxRequestUrl, WxX
return HttpHelper.getUrlParameter(req);
}
public WxXcxAuthCheckEncryptedDataRes getResponse() {
public WxXcxAnalysisGetWeeklyRetainRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthCheckEncryptedDataRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthCheckEncryptedDataRes>() {
WxXcxAnalysisGetWeeklyRetainRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetWeeklyRetainRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
......
......@@ -3,7 +3,6 @@ package com.yanzuoguang.wxxcx.analysis.summary;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.user.WxXcxAuthCheckEncryptedDataReq;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -11,14 +10,14 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetDailySummaryRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetDailySummaryRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxAuthCheckEncryptedDataReq req;
private final WxXcxAnalysisGetDailySummaryReq req;
public WxXcxAnalysisGetDailySummaryRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAuthCheckEncryptedDataReq req) {
public WxXcxAnalysisGetDailySummaryRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAnalysisGetDailySummaryReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetDailyVisitTrendRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetDailyVisitTrendRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetMonthlyVisitTrendRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetMonthlyVisitTrendRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAnalysisGetWeeklyVisitTrendRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAnalysisGetWeeklyVisitTrendRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 颜佐光
*/
public class WxXcxAuthCode2SessionRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara {
public class WxXcxAuthCode2SessionRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
package com.yanzuoguang.wxxcx.auth.user;
package com.yanzuoguang.wxxcx.auth.token;
/**
* 获取小程序全局唯一后台接口调用凭据 请求
......
package com.yanzuoguang.wxxcx.auth.user;
package com.yanzuoguang.wxxcx.auth.token;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.login.WxXcxAuthCode2SessionReq;
import com.yanzuoguang.wxxcx.auth.login.WxXcxResponseAuthCode2SessionRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -12,13 +10,13 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAuthGetAccessTokenRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara {
public class WxXcxAuthGetAccessTokenRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAuthCode2SessionReq req;
private final WxXcxAuthGetAccessTokenReq req;
public WxXcxAuthGetAccessTokenRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAuthCode2SessionReq req) {
public WxXcxAuthGetAccessTokenRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAuthGetAccessTokenReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.req = req;
......@@ -34,11 +32,11 @@ public class WxXcxAuthGetAccessTokenRequest implements WxXwxRequestUrl, WxXcxReq
return HttpHelper.getUrlParameter(req);
}
public WxXcxResponseAuthCode2SessionRes getResponse() {
public WxXcxAuthGetAccessTokenRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxResponseAuthCode2SessionRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxResponseAuthCode2SessionRes>() {
WxXcxAuthGetAccessTokenRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthGetAccessTokenRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
......
package com.yanzuoguang.wxxcx.auth.user;
package com.yanzuoguang.wxxcx.auth.token;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
......
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 颜佐光
*/
public class WxXcxAuthCheckEncryptedDataRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxAuthCheckEncryptedDataRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,17 +11,17 @@ public class WxXcxAuthCheckEncryptedDataRes extends WxXcxResponseBaseError {
/**
* 用户唯一标识
*/
private String vaild;
private boolean vaild;
/**
* 用户唯一标识
*/
private double create_time;
public String getVaild() {
public boolean isVaild() {
return vaild;
}
public void setVaild(String vaild) {
public void setVaild(boolean vaild) {
this.vaild = vaild;
}
......
......@@ -11,14 +11,14 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAuthGetPaidUnionIdRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara {
public class WxXcxAuthGetPaidUnionIdRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxAuthCheckEncryptedDataReq req;
private final WxXcxAuthGetPaidUnionIdReq req;
public WxXcxAuthGetPaidUnionIdRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAuthCheckEncryptedDataReq req) {
public WxXcxAuthGetPaidUnionIdRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAuthGetPaidUnionIdReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
......@@ -35,11 +35,11 @@ public class WxXcxAuthGetPaidUnionIdRequest implements WxXwxRequestUrl, WxXcxReq
return HttpHelper.getUrlParameter(accessToken);
}
public WxXcxAuthCheckEncryptedDataRes getResponse() {
public WxXcxAuthGetPaidUnionIdRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthCheckEncryptedDataRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthCheckEncryptedDataRes>() {
WxXcxAuthGetPaidUnionIdRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthGetPaidUnionIdRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
......
package com.yanzuoguang.wxxcx.auth.user;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 用户支付完成后,获取该用户的 UnionId 响应
* 注意:调用前需要用户完成支付,且在支付后的五分钟内有效。
*
* @author 李贤军
*/
public class WxXcxAuthGetPaidUnionIdRes {
public class WxXcxAuthGetPaidUnionIdRes extends WxXcxResponseBaseError {
/**
* 用户唯一标识,调用成功后返回
......
......@@ -3,8 +3,6 @@ package com.yanzuoguang.wxxcx.auth.user;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.login.WxXcxAuthCode2SessionReq;
import com.yanzuoguang.wxxcx.auth.login.WxXcxResponseAuthCode2SessionRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -12,13 +10,13 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxAuthGetPluginOpenPidRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara {
public class WxXcxAuthGetPluginOpenPidRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAuthCode2SessionReq req;
private final WxXcxAuthGetPluginOpenPidReq req;
public WxXcxAuthGetPluginOpenPidRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAuthCode2SessionReq req) {
public WxXcxAuthGetPluginOpenPidRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAuthGetPluginOpenPidReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.req = req;
......@@ -34,11 +32,11 @@ public class WxXcxAuthGetPluginOpenPidRequest implements WxXwxRequestUrl, WxXcxR
return HttpHelper.getUrlParameter(req);
}
public WxXcxResponseAuthCode2SessionRes getResponse() {
public WxXcxAuthGetPluginOpenPidRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxResponseAuthCode2SessionRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxResponseAuthCode2SessionRes>() {
WxXcxAuthGetPluginOpenPidRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthGetPluginOpenPidRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
......
package com.yanzuoguang.wxxcx.auth.user;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 通过 wx.pluginLogin 接口获得插件用户标志凭证 code 后传到开发者服务器 响应
*
* @author 李贤军
*/
public class WxXcxAuthGetPluginOpenPidRes {
public class WxXcxAuthGetPluginOpenPidRes extends WxXcxResponseBaseError {
/**
* 插件用户的唯一标识
......
package com.yanzuoguang.wxxcx.base;
import com.yanzuoguang.wxxcx.pluginmanager.WxXcxPluginManagerSetDevPluginApplyStatusRes;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -19,7 +18,7 @@ public class WxXcxConfig {
private String baseUrl;
/**
* 公共URI
* 登录凭证校验
*/
@Value("${yzg.wx.xcx.authCode2SessionUrl:/sns/jscode2session}")
private String authCode2SessionUrl;
......@@ -205,6 +204,78 @@ public class WxXcxConfig {
@Value("${yzg.wx.xcx.nearbyPoiGetList:/wxa/getnearbypoilist}")
private String nearbyPoiGetList;
/**
* 展示/取消展示附近小程序
*/
@Value("${yzg.wx.xcx.nearbyPoiSetShowStatus:/wxa/setnearbypoishowstatus}")
private String nearbyPoiSetShowStatus;
/**
* 获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*/
@Value("${yzg.wx.xcx.wxaCodeCreateQRCode:/cgi-bin/wxaapp/createwxaqrcode}")
private String wxaCodeCreateQRCode;
/**
* 获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*/
@Value("${yzg.wx.xcx.wxaCodeGet:/wxa/getwxacode}")
private String wxaCodeGet;
/**
* 获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*/
@Value("${yzg.wx.xcx.wxaCodeGetUnlimited:/wxa/getwxacodeunlimit}")
private String wxaCodeGetUnlimited;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.urlSchemeGenerate:/wxa/generatescheme}")
private String urlSchemeGenerate;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.urlSchemeGenerateNFC:/wxa/generatenfcscheme}")
private String urlSchemeGenerateNFC;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.urlSchemeQuery:/wxa/queryscheme}")
private String urlSchemeQuery;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.urlLinkGenerate:/wxa/generate_urllink}")
private String urlLinkGenerate;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.urlLinkQuery:/wxa/query_urllink}")
private String urlLinkQuery;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.securityMediaCheckAsync:/wxa/media_check_async}")
private String securityMediaCheckAsync;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.securityMsgSecCheck:/wxa/msg_sec_check}")
private String securityMsgSecCheck;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*/
@Value("${yzg.wx.xcx.redPacketCoverGetAuthenticationUrl:/redpacketcover/wxapp/cover_url/get_by_token}")
private String redPacketCoverGetAuthenticationUrl;
public String getBaseUrl() {
return baseUrl;
}
......@@ -332,4 +403,52 @@ public class WxXcxConfig {
public String getNearbyPoiGetList() {
return nearbyPoiGetList;
}
public String getNearbyPoiSetShowStatus() {
return nearbyPoiSetShowStatus;
}
public String getWxaCodeCreateQRCode() {
return wxaCodeCreateQRCode;
}
public String getWxaCodeGet() {
return wxaCodeGet;
}
public String getWxaCodeGetUnlimited() {
return wxaCodeGetUnlimited;
}
public String getUrlSchemeGenerate() {
return urlSchemeGenerate;
}
public String getUrlSchemeGenerateNFC() {
return urlSchemeGenerateNFC;
}
public String getUrlSchemeQuery() {
return urlSchemeQuery;
}
public String getUrlLinkGenerate() {
return urlLinkGenerate;
}
public String getUrlLinkQuery() {
return urlLinkQuery;
}
public String getSecurityMediaCheckAsync() {
return securityMediaCheckAsync;
}
public String getSecurityMsgSecCheck() {
return securityMsgSecCheck;
}
public String getRedPacketCoverGetAuthenticationUrl() {
return redPacketCoverGetAuthenticationUrl;
}
}
......@@ -15,5 +15,5 @@ public interface WxXcxRequest {
* @param <T> 返回结果类型
* @return 返回请求结果
*/
<T> T request(WxXwxRequestUrl req, WxXcxResponseConvert<T> convert);
<T> T request(WxXcxRequestUrl req, WxXcxResponseConvert<T> convert);
}
......@@ -20,7 +20,7 @@ public class WxXcxRequestImpl implements WxXcxRequest {
private String defaultCharSet;
@Override
public <T> T request(WxXwxRequestUrl req, WxXcxResponseConvert<T> convert) {
public <T> T request(WxXcxRequestUrl req, WxXcxResponseConvert<T> convert) {
String url = req.getUrl();
String charSet = defaultCharSet;
Map<String, String> header;
......
......@@ -5,7 +5,7 @@ package com.yanzuoguang.wxxcx.base;
*
* @author 颜佐光
*/
public interface WxXwxRequestUrl {
public interface WxXcxRequestUrl {
/**
* 获取请求地址
......
package com.yanzuoguang.wxxcx.customer.gettempmedia;
package com.yanzuoguang.wxxcx.customerservicemessage.gettempmedia;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.login.WxXcxAuthCode2SessionReq;
import com.yanzuoguang.wxxcx.auth.login.WxXcxResponseAuthCode2SessionRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -13,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxCustomerServiceMessageGetTempMediaRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara {
public class WxXcxCustomerServiceMessageGetTempMediaRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
package com.yanzuoguang.wxxcx.customer.send;
package com.yanzuoguang.wxxcx.customerservicemessage.send;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.analysis.distribution.WxXcxAnalysisGetVisitDistributionReq;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -11,14 +10,14 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxCustomerServiceMessageSendRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxCustomerServiceMessageSendRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxAnalysisGetVisitDistributionReq req;
private final WxXcxCustomerServiceMessageSendReq req;
public WxXcxCustomerServiceMessageSendRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxAnalysisGetVisitDistributionReq req) {
public WxXcxCustomerServiceMessageSendRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxCustomerServiceMessageSendReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
......
package com.yanzuoguang.wxxcx.customer.send;
package com.yanzuoguang.wxxcx.customerservicemessage.send;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
......
package com.yanzuoguang.wxxcx.customer.settyping;
package com.yanzuoguang.wxxcx.customerservicemessage.settyping;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.analysis.distribution.WxXcxAnalysisGetVisitDistributionReq;
import com.yanzuoguang.wxxcx.base.*;
import com.yanzuoguang.wxxcx.customer.send.WxXcxCustomerServiceMessageSendRes;
/**
* 下发客服当前输入状态给用户 转换
*
* @author 李贤军
*/
public class WxXcxCustomerServiceMessageSetTypingRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxCustomerServiceMessageSetTypingRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
package com.yanzuoguang.wxxcx.customer.uploadtempmedia;
package com.yanzuoguang.wxxcx.customerservicemessage.uploadtempmedia;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
import com.yanzuoguang.wxxcx.customer.settyping.WxXcxCustomerServiceMessageSetTypingReq;
import com.yanzuoguang.wxxcx.customer.settyping.WxXcxCustomerServiceMessageSetTypingRes;
/**
* @author 李贤军
*/
public class WxXcxCustomerServiceMessageUploadTempMediaRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxCustomerServiceMessageUploadTempMediaRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -3,14 +3,12 @@ package com.yanzuoguang.wxxcx.nearbypoi;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.analysis.distribution.WxXcxAnalysisGetVisitDistributionReq;
import com.yanzuoguang.wxxcx.base.*;
import com.yanzuoguang.wxxcx.customer.send.WxXcxCustomerServiceMessageSendRes;
/**
* @author 李贤军
*/
public class WxXcxNearbyPoiAddRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxNearbyPoiAddRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxNearbyPoiDeleteRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxNearbyPoiDeleteRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxNearbyPoiGetListRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxNearbyPoiGetListRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
package com.yanzuoguang.wxxcx.nearbypoi;
/**
* 展示/取消展示附近小程序 请求
*
* @author 李贤军
*/
public class WxXcxNearbyPoiSetShowStatusReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 附近地点 ID
*/
private String poi_id;
/**
* 是否展示
* 0 不展示
* 1 展示
*/
private Integer status;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getPoi_id() {
return poi_id;
}
public void setPoi_id(String poi_id) {
this.poi_id = poi_id;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
package com.yanzuoguang.wxxcx.nearbypoi;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 展示/取消展示附近小程序 转换
*
* @author 李贤军
*/
public class WxXcxNearbyPoiSetShowStatusRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxNearbyPoiSetShowStatusReq req;
public WxXcxNearbyPoiSetShowStatusRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxNearbyPoiSetShowStatusReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getNearbyPoiSetShowStatus() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxNearbyPoiSetShowStatusRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxNearbyPoiSetShowStatusRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxNearbyPoiSetShowStatusRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.nearbypoi;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 展示/取消展示附近小程序 响应
*
* @author 李贤军
*/
public class WxXcxNearbyPoiSetShowStatusRes extends WxXcxResponseBaseError {
}
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxPluginManagerApplyPluginRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxPluginManagerApplyPluginRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxPluginManagerGetPluginListRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxPluginManagerGetPluginListRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxPluginManagerSetDevPluginApplyStatusRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxPluginManagerSetDevPluginApplyStatusRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxPluginManagerUnbindPluginRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxPluginManagerUnbindPluginRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -7,9 +7,10 @@ import com.yanzuoguang.wxxcx.base.*;
/**
* 获取当前所有插件使用方(供插件开发者调用) 转换
*
* @author 李贤军
*/
public class WxXxcPluginManagerGetPluginDevApplyListRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXxcPluginManagerGetPluginDevApplyListRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
package com.yanzuoguang.wxxcx.redpacketcover;
/**
* 指定用户可以领取的链接
*
* @author 李贤军
*/
public class WxXcxRedPacketCoverGetAuthenticationUrlDataRes {
/**
* 指定用户可以领取的链接(带鉴权的链接)
*/
private String url;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
package com.yanzuoguang.wxxcx.redpacketcover;
/**
* 本接口用于获得指定用户可以领取的红包封面链接 请求
* 获取参数 ctoken 参考微信红包封面开放平台。
*
* @author 李贤军
*/
public class WxXcxRedPacketCoverGetAuthenticationUrlReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 可领取用户的openid
*/
private String openid;
/**
* 在红包封面平台获取发放ctoken(需要指定可以发放的appid)
*/
private String ctoken;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getCtoken() {
return ctoken;
}
public void setCtoken(String ctoken) {
this.ctoken = ctoken;
}
}
package com.yanzuoguang.wxxcx.redpacketcover;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 本接口用于获得指定用户可以领取的红包封面链接 转换
* 获取参数 ctoken 参考微信红包封面开放平台。
*
* @author 李贤军
*/
public class WxXcxRedPacketCoverGetAuthenticationUrlRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxRedPacketCoverGetAuthenticationUrlReq req;
public WxXcxRedPacketCoverGetAuthenticationUrlRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxRedPacketCoverGetAuthenticationUrlReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getRedPacketCoverGetAuthenticationUrl() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxRedPacketCoverGetAuthenticationUrlRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxRedPacketCoverGetAuthenticationUrlRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxRedPacketCoverGetAuthenticationUrlRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
package com.yanzuoguang.wxxcx.redpacketcover;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 本接口用于获得指定用户可以领取的红包封面链接 响应
* 获取参数 ctoken 参考微信红包封面开放平台。
*
* @author 李贤军
*/
public class WxXcxRedPacketCoverGetAuthenticationUrlRes extends WxXcxResponseBaseError {
/**
* 指定用户可以领取的链接(带鉴权的链接)
*/
private WxXcxRedPacketCoverGetAuthenticationUrlDataRes data;
public WxXcxRedPacketCoverGetAuthenticationUrlDataRes getData() {
return data;
}
public void setData(WxXcxRedPacketCoverGetAuthenticationUrlDataRes data) {
this.data = data;
}
}
package com.yanzuoguang.wxxcx.security;
/**
* detail
*
* @author 李贤军
*/
public class WxXcxSecurityMediaCheckAsyncDetailRes {
/**
* strategy
*/
private String strategy;
/**
* errcode
*/
private String errcode;
/**
* suggest
*/
private String suggest;
/**
* label
*/
private String label;
/**
* prob
*/
private String prob;
public String getStrategy() {
return strategy;
}
public void setStrategy(String strategy) {
this.strategy = strategy;
}
public String getErrcode() {
return errcode;
}
public void setErrcode(String errcode) {
this.errcode = errcode;
}
public String getSuggest() {
return suggest;
}
public void setSuggest(String suggest) {
this.suggest = suggest;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getProb() {
return prob;
}
public void setProb(String prob) {
this.prob = prob;
}
}
package com.yanzuoguang.wxxcx.security;
/**
* 异步校验图片/音频是否含有违法违规内容 请求
* 1.0版本在2021年9月1日停止更新,请尽快更新至2.0
* 应用场景举例:
* 语音风险识别:社交类用户发表的语音内容检测;
* 图片智能鉴黄:涉及拍照的工具类应用(如美拍,识图类应用)用户拍照上传检测;电商类商品上架图片检测;媒体类用户文章里的图片检测等;
* 敏感人脸识别:用户头像;媒体类用户文章里的图片检测;社交类用户上传的图片检测等。 频率限制:单个 appId 调用上限为 2000 次/分钟,200,000 次/天;文件大小限制:单个文件大小不超过10M
*
* @author 李贤军
*/
public class WxXcxSecurityMediaCheckAsyncReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 要检测的图片或音频的url,支持图片格式包括 jpg , jepg, png, bmp, gif(取首帧),支持的音频格式包括mp3, aac, ac3, wma, flac, vorbis, opus, wav
*/
private String media_url;
/**
* 1:音频;2:图片
*/
private int media_type;
/**
* 接口版本号,2.0版本为固定值2
*/
private int version;
/**
* 用户的openid(用户需在近两小时访问过小程序)
*/
private String openid;
/**
* 场景枚举值(1 资料;2 评论;3 论坛;4 社交日志)
*/
private int scene;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getMedia_url() {
return media_url;
}
public void setMedia_url(String media_url) {
this.media_url = media_url;
}
public int getMedia_type() {
return media_type;
}
public void setMedia_type(int media_type) {
this.media_type = media_type;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public int getScene() {
return scene;
}
public void setScene(int scene) {
this.scene = scene;
}
}
package com.yanzuoguang.wxxcx.security;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 异步校验图片/音频是否含有违法违规内容 转换
* <p>
* 应用场景举例:
* 语音风险识别:社交类用户发表的语音内容检测;
* 图片智能鉴黄:涉及拍照的工具类应用(如美拍,识图类应用)用户拍照上传检测;电商类商品上架图片检测;媒体类用户文章里的图片检测等;
* 敏感人脸识别:用户头像;媒体类用户文章里的图片检测;社交类用户上传的图片检测等。 频率限制:单个 appId 调用上限为 2000 次/分钟,200,000 次/天;文件大小限制:单个文件大小不超过10M
*
* @author 李贤军
*/
public class WxXcxSecurityMediaCheckAsyncRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxSecurityMediaCheckAsyncReq req;
public WxXcxSecurityMediaCheckAsyncRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxSecurityMediaCheckAsyncReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getSecurityMediaCheckAsync() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxSecurityMediaCheckAsyncRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxSecurityMediaCheckAsyncRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxSecurityMediaCheckAsyncRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
package com.yanzuoguang.wxxcx.security;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 异步校验图片/音频是否含有违法违规内容 响应
*
* 应用场景举例:
* 语音风险识别:社交类用户发表的语音内容检测;
* 图片智能鉴黄:涉及拍照的工具类应用(如美拍,识图类应用)用户拍照上传检测;电商类商品上架图片检测;媒体类用户文章里的图片检测等;
* 敏感人脸识别:用户头像;媒体类用户文章里的图片检测;社交类用户上传的图片检测等。 频率限制:单个 appId 调用上限为 2000 次/分钟,200,000 次/天;文件大小限制:单个文件大小不超过10M
*
* @author 李贤军
*/
public class WxXcxSecurityMediaCheckAsyncRes extends WxXcxResponseBaseError {
/**
* 唯一请求标识,标记单次请求,用于匹配异步推送结果
*/
private String ToUserName;
/**
* 唯一请求标识
*/
private String FromUserName;
/**
* 唯一请求标识
*/
private double CreateTime;
/**
* 唯一请求标识
*/
private String MsgType;
/**
* 唯一请求标识
*/
private String Event;
/**
* 唯一请求标识
*/
private String appid;
/**
* 唯一请求标识
*/
private String trace_id;
/**
* 唯一请求标识
*/
private int version;
/**
* 唯一请求标识
*/
private WxXcxSecurityMediaCheckAsyncResultRes result;
/**
* 唯一请求标识
*/
private WxXcxSecurityMediaCheckAsyncDetailRes detail;
public String getToUserName() {
return ToUserName;
}
public void setToUserName(String toUserName) {
ToUserName = toUserName;
}
public String getFromUserName() {
return FromUserName;
}
public void setFromUserName(String fromUserName) {
FromUserName = fromUserName;
}
public double getCreateTime() {
return CreateTime;
}
public void setCreateTime(double createTime) {
CreateTime = createTime;
}
public String getMsgType() {
return MsgType;
}
public void setMsgType(String msgType) {
MsgType = msgType;
}
public String getEvent() {
return Event;
}
public void setEvent(String event) {
Event = event;
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getTrace_id() {
return trace_id;
}
public void setTrace_id(String trace_id) {
this.trace_id = trace_id;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public WxXcxSecurityMediaCheckAsyncResultRes getResult() {
return result;
}
public void setResult(WxXcxSecurityMediaCheckAsyncResultRes result) {
this.result = result;
}
public WxXcxSecurityMediaCheckAsyncDetailRes getDetail() {
return detail;
}
public void setDetail(WxXcxSecurityMediaCheckAsyncDetailRes detail) {
this.detail = detail;
}
}
package com.yanzuoguang.wxxcx.security;
/**
* result
*
* @author 李贤军
*/
public class WxXcxSecurityMediaCheckAsyncResultRes {
/**
* suggest
*/
private String suggest;
/**
* label
*/
private String label;
public String getSuggest() {
return suggest;
}
public void setSuggest(String suggest) {
this.suggest = suggest;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}
package com.yanzuoguang.wxxcx.security;
/**
* detail包含多个策略类型的检测结果,策略类型的检查结果可能存在的属性
*
* @author 李贤军
*/
public class WxXcxSecurityMsgSecCheckDetailRes {
/**
* 策略类型
*/
private String strategy;
/**
* 错误码,仅当该值为0时,该项结果有效
*/
private Integer errcode;
/**
* 建议,有risky、pass、review三种值
*/
private String suggest;
/**
* 命中标签枚举值,100 正常;10001 广告;20001 时政;20002 色情;20003 辱骂;20006 违法犯罪;20008 欺诈;20012 低俗;20013 版权;21000 其他
*/
private int label;
/**
* 0-100,代表置信度,越高代表越有可能属于当前返回的标签(label)
*/
private int prob;
/**
* 命中的自定义关键词
*/
private String keyword;
public String getStrategy() {
return strategy;
}
public void setStrategy(String strategy) {
this.strategy = strategy;
}
public Integer getErrcode() {
return errcode;
}
public void setErrcode(Integer errcode) {
this.errcode = errcode;
}
public String getSuggest() {
return suggest;
}
public void setSuggest(String suggest) {
this.suggest = suggest;
}
public int getLabel() {
return label;
}
public void setLabel(int label) {
this.label = label;
}
public int getProb() {
return prob;
}
public void setProb(int prob) {
this.prob = prob;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
}
package com.yanzuoguang.wxxcx.security;
/**
* 检查一段文本是否含有违法违规内容 请求
* <p>
* 1.0版本在2021年9月1日停止更新,请尽快更新至2.0
* 应用场景举例:
* 用户个人资料违规文字检测;
* 媒体新闻类用户发表文章,评论内容检测;
* 游戏类用户编辑上传的素材(如答题类小游戏用户上传的问题及答案)检测等。 频率限制:单个 appId 调用上限为 4000 次/分钟,2,000,000 次/天*
*
* @author 李贤军
*/
public class WxXcxSecurityMsgSecCheckReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 接口版本号,2.0版本为固定值2
*/
private int version;
/**
* 用户的openid(用户需在近两小时访问过小程序)
*/
private String openid;
/**
* 场景枚举值(1 资料;2 评论;3 论坛;4 社交日志
*/
private int scene;
/**
* 需检测的文本内容,文本字数的上限为2500字,需使用UTF-8编码
*/
private String content;
/**
* 用户昵称,需使用UTF-8编码
*/
private String nickname;
/**
* 文本标题,需使用UTF-8编码
*/
private String title;
/**
* 个性签名,该参数仅在资料类场景有效(scene=1),需使用UTF-8编码
*/
private String signature;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public int getScene() {
return scene;
}
public void setScene(int scene) {
this.scene = scene;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
}
package com.yanzuoguang.wxxcx.security;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 检查一段文本是否含有违法违规内容 转换
* <p>
* 1.0版本在2021年9月1日停止更新,请尽快更新至2.0
* 应用场景举例:
* 用户个人资料违规文字检测;
* 媒体新闻类用户发表文章,评论内容检测;
* 游戏类用户编辑上传的素材(如答题类小游戏用户上传的问题及答案)检测等。 频率限制:单个 appId 调用上限为 4000 次/分钟,2,000,000 次/天*
*
* @author 李贤军
*/
public class WxXcxSecurityMsgSecCheckRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxSecurityMsgSecCheckReq req;
public WxXcxSecurityMsgSecCheckRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxSecurityMsgSecCheckReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getSecurityMsgSecCheck() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxSecurityMsgSecCheckRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxSecurityMsgSecCheckRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxSecurityMsgSecCheckRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.security;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 检查一段文本是否含有违法违规内容 响应
* <p>
* 1.0版本在2021年9月1日停止更新,请尽快更新至2.0
* 应用场景举例:
* 用户个人资料违规文字检测;
* 媒体新闻类用户发表文章,评论内容检测;
* 游戏类用户编辑上传的素材(如答题类小游戏用户上传的问题及答案)检测等。 频率限制:单个 appId 调用上限为 4000 次/分钟,2,000,000 次/天*
*
* @author 李贤军
*/
public class WxXcxSecurityMsgSecCheckRes extends WxXcxResponseBaseError {
/**
* 唯一请求标识,标记单次请求
*/
private String trace_id;
/**
* 唯一请求标识,标记单次请求
*/
private WxXcxSecurityMsgSecCheckResultRes result;
/**
* 唯一请求标识,标记单次请求
*/
private WxXcxSecurityMsgSecCheckDetailRes detail;
public String getTrace_id() {
return trace_id;
}
public void setTrace_id(String trace_id) {
this.trace_id = trace_id;
}
public WxXcxSecurityMsgSecCheckResultRes getResult() {
return result;
}
public void setResult(WxXcxSecurityMsgSecCheckResultRes result) {
this.result = result;
}
public WxXcxSecurityMsgSecCheckDetailRes getDetail() {
return detail;
}
public void setDetail(WxXcxSecurityMsgSecCheckDetailRes detail) {
this.detail = detail;
}
}
package com.yanzuoguang.wxxcx.security;
/**
* result综合了多个策略的结果给出了建议,包含的属性
*
* @author 李贤军
*/
public class WxXcxSecurityMsgSecCheckResultRes {
/**
* 建议,有risky、pass、review三种值
*/
private String suggest;
/**
* 命中标签枚举值,100 正常;10001 广告;20001 时政;20002 色情;20003 辱骂;20006 违法犯罪;20008 欺诈;20012 低俗;20013 版权;21000 其他
*/
private String label;
public String getSuggest() {
return suggest;
}
public void setSuggest(String suggest) {
this.suggest = suggest;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
}
......@@ -10,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxUniformMessageSendRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxUniformMessageSendRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -3,8 +3,6 @@ package com.yanzuoguang.wxxcx.updatablemessage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.auth.login.WxXcxAuthCode2SessionReq;
import com.yanzuoguang.wxxcx.auth.login.WxXcxResponseAuthCode2SessionRes;
import com.yanzuoguang.wxxcx.base.*;
/**
......@@ -12,7 +10,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxUpdatableMessageCreateActivityIdRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara {
public class WxXcxUpdatableMessageCreateActivityIdRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
......@@ -16,4 +16,20 @@ public class WxXcxUpdatableMessageCreateActivityIdRes extends WxXcxResponseBaseE
* activity_id 的过期时间戳。默认24小时后过期
*/
private double expiration_time;
public String getActivity_id() {
return activity_id;
}
public void setActivity_id(String activity_id) {
this.activity_id = activity_id;
}
public double getExpiration_time() {
return expiration_time;
}
public void setExpiration_time(double expiration_time) {
this.expiration_time = expiration_time;
}
}
......@@ -11,7 +11,7 @@ import com.yanzuoguang.wxxcx.base.*;
*
* @author 李贤军
*/
public class WxXcxUpdatableMessageSetUpdatableMsgRequest implements WxXwxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
public class WxXcxUpdatableMessageSetUpdatableMsgRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
......
package com.yanzuoguang.wxxcx.urllink;
/**
* cloud_base 的结构
*
* @author 李贤军
*/
public class WxXcxUrlLinkGenerateCloudBaseReq {
/**
* 云开发环境
*/
private String env;
/**
* 静态网站自定义域名,不填则使用默认域名
*/
private String domain;
/**
* 云开发静态网站 H5 页面路径,不可携带 query
*/
private String path;
/**
* 云开发静态网站 H5 页面 query 参数,最大 1024 个字符,只支持数字,大小写英文以及部分特殊字符:`!#$&'()*+,/:;=?@-._~%``
*/
private String query;
/**
* 第三方批量代云开发时必填,表示创建该 env 的 appid (小程序/第三方平台)
*/
private String resource_appid;
public String getEnv() {
return env;
}
public void setEnv(String env) {
this.env = env;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public String getResource_appid() {
return resource_appid;
}
public void setResource_appid(String resource_appid) {
this.resource_appid = resource_appid;
}
}
package com.yanzuoguang.wxxcx.urllink;
/**
* 获取小程序 URL Link 请求
* 适用于短信、邮件、网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlLinkGenerateReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 通过 URL Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query 。path 为空时会跳转小程序主页
*/
private String path;
/**
* 通过 URL Link 进入小程序时的query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~%
*/
private String query;
/**
* 要打开的小程序版本。正式版为 "release",体验版为"trial",开发版为"develop",仅在微信外打开时生效。
*/
private String env_version;
/**
* 小程序 URL Link 失效类型,失效时间:0,失效间隔天数:1
*/
private int expire_type;
/**
* 到期失效的 URL Link 的失效时间,为 Unix 时间戳。生成的到期失效 URL Link 在该时间前有效。最长有效期为30天。expire_type 为 0 必填
*/
private int expire_time;
/**
* 到期失效的URL Link的失效间隔天数。生成的到期失效URL Link在该间隔时间到达前有效。最长间隔天数为30天。expire_type 为 1 必填
*/
private int expire_interval;
/**
* 云开发静态网站自定义 H5 配置参数,可配置中转的云开发 H5 页面。不填默认用官方 H5 页面
*/
private WxXcxUrlLinkGenerateCloudBaseReq cloud_base;
}
package com.yanzuoguang.wxxcx.urllink;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 获取小程序 URL Link 转换
* 适用于短信、邮件、网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlLinkGenerateRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxUrlLinkGenerateReq req;
public WxXcxUrlLinkGenerateRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxUrlLinkGenerateReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getUrlLinkGenerate() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxUrlLinkGenerateRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlLinkGenerateRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlLinkGenerateRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.urllink;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 获取小程序 URL Link 响应
* 适用于短信、邮件、网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlLinkGenerateRes extends WxXcxResponseBaseError {
/**
* 生成的小程序 URL Link
*/
private String url_link;
public String getUrl_link() {
return url_link;
}
public void setUrl_link(String url_link) {
this.url_link = url_link;
}
}
package com.yanzuoguang.wxxcx.urllink;
/**
* 查询小程序 url_link 配置 请求
*
* @author 李贤军
*/
public class WxXcxUrlLinkQueryReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 小程序 url_link
*/
private String url_link;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getUrl_link() {
return url_link;
}
public void setUrl_link(String url_link) {
this.url_link = url_link;
}
}
package com.yanzuoguang.wxxcx.urllink;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 查询小程序 url_link 配置 转换
*
* @author 李贤军
*/
public class WxXcxUrlLinkQueryRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxUrlLinkQueryReq req;
public WxXcxUrlLinkQueryRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxUrlLinkQueryReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getUrlLinkQuery() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxUrlLinkQueryRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlLinkQueryRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlLinkQueryRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.urllink;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 查询小程序 url_link 配置 响应
*
* @author 李贤军
*/
public class WxXcxUrlLinkQueryRes extends WxXcxResponseBaseError {
/**
* url_link 配置
*/
private WxXcxUrlLinkQueryUrlLinkInfoRes url_link_info;
/**
* 访问该链接的openid,没有用户访问过则为空字符串
*/
private String visit_openid;
public WxXcxUrlLinkQueryUrlLinkInfoRes getUrl_link_info() {
return url_link_info;
}
public void setUrl_link_info(WxXcxUrlLinkQueryUrlLinkInfoRes url_link_info) {
this.url_link_info = url_link_info;
}
public String getVisit_openid() {
return visit_openid;
}
public void setVisit_openid(String visit_openid) {
this.visit_openid = visit_openid;
}
}
package com.yanzuoguang.wxxcx.urllink;
/**
* url_link 配置
*
* @author 李贤军
*/
public class WxXcxUrlLinkQueryUrlLinkInfoRes {
/**
* 小程序 appid。
*/
private String appid;
/**
* 小程序页面路径。
*/
private String path;
/**
* 小程序页面query。
*/
private String query;
/**
* 创建时间,为 Unix 时间戳。
*/
private String create_time;
/**
* 到期失效时间,为 Unix 时间戳,0 表示永久生效
*/
private String expire_time;
/**
* 要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop"。
*/
private String env_version;
/**
* 云开发配置。
*/
private WxXcxUrlLinkGenerateCloudBaseReq cloud_base;
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
public String getExpire_time() {
return expire_time;
}
public void setExpire_time(String expire_time) {
this.expire_time = expire_time;
}
public String getEnv_version() {
return env_version;
}
public void setEnv_version(String env_version) {
this.env_version = env_version;
}
public WxXcxUrlLinkGenerateCloudBaseReq getCloud_base() {
return cloud_base;
}
public void setCloud_base(WxXcxUrlLinkGenerateCloudBaseReq cloud_base) {
this.cloud_base = cloud_base;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
/**
* 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateJumpWxaReq {
/**
* 通过 scheme 码进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query。path 为空时会跳转小程序主页
*/
private String path;
/**
* 通过 scheme 码进入小程序时的 query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:`!#$&'()*+,/:;=?@-._~%``
*/
private String query;
/**
* 要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop",仅在微信外打开时生效
*/
private String env_version;
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public String getEnv_version() {
return env_version;
}
public void setEnv_version(String env_version) {
this.env_version = env_version;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
/**
* 获取用于 NFC 的小程序 scheme 码 请求
* 适用于 NFC 拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见 NFC 标签打开小程序
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateNfcReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 跳转到的目标小程序信息。
*/
private WxXcxUrlSchemeGenerateJumpWxaReq jump_wxa;
/**
* scheme对应的设备sn,仅一机一码时填写
*/
private String sn;
/**
* scheme对应的设备model_id
*/
private String model_id;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public WxXcxUrlSchemeGenerateJumpWxaReq getJump_wxa() {
return jump_wxa;
}
public void setJump_wxa(WxXcxUrlSchemeGenerateJumpWxaReq jump_wxa) {
this.jump_wxa = jump_wxa;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public String getModel_id() {
return model_id;
}
public void setModel_id(String model_id) {
this.model_id = model_id;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 获取用于 NFC 的小程序 scheme 码 转换
* 适用于 NFC 拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见 NFC 标签打开小程序
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateNfcRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxUrlSchemeGenerateNfcReq req;
public WxXcxUrlSchemeGenerateNfcRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxUrlSchemeGenerateNfcReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getUrlSchemeGenerateNFC() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxUrlSchemeGenerateNfcRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlSchemeGenerateNfcRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlSchemeGenerateNfcRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.urlscheme;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 获取用于 NFC 的小程序 scheme 码 响应
* 适用于 NFC 拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见 NFC 标签打开小程序
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateNfcRes extends WxXcxResponseBaseError {
/**
* 生成的小程序 scheme 码
*/
private String openlink;
public String getOpenlink() {
return openlink;
}
public void setOpenlink(String openlink) {
this.openlink = openlink;
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.urlscheme;
/**
* 获取小程序 scheme 码 请求
* 适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 跳转到的目标小程序信息。
*/
private WxXcxUrlSchemeGenerateJumpWxaReq jump_wxa;
/**
* 到期失效的 scheme 码失效类型,失效时间:0,失效间隔天数:1
*/
private int expire_type;
/**
* 到期失效的 scheme 码的失效时间,为 Unix 时间戳。生成的到期失效 scheme 码在该时间前有效。最长有效期为30天。expire_type 为 0 时必填
*/
private int expire_time;
/**
* 到期失效的 scheme 码的失效间隔天数。生成的到期失效 scheme 码在该间隔时间到达前有效。最长间隔天数为30天。 expire_type 为 1 时必填
*/
private int expire_interval;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public WxXcxUrlSchemeGenerateJumpWxaReq getJump_wxa() {
return jump_wxa;
}
public void setJump_wxa(WxXcxUrlSchemeGenerateJumpWxaReq jump_wxa) {
this.jump_wxa = jump_wxa;
}
public int getExpire_type() {
return expire_type;
}
public void setExpire_type(int expire_type) {
this.expire_type = expire_type;
}
public int getExpire_time() {
return expire_time;
}
public void setExpire_time(int expire_time) {
this.expire_time = expire_time;
}
public int getExpire_interval() {
return expire_interval;
}
public void setExpire_interval(int expire_interval) {
this.expire_interval = expire_interval;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 获取小程序 scheme 码 转换
* 适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxUrlSchemeGenerateReq req;
public WxXcxUrlSchemeGenerateRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxUrlSchemeGenerateReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getUrlSchemeGenerate() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxUrlSchemeGenerateRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlSchemeGenerateRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlSchemeGenerateRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.urlscheme;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 获取小程序 scheme 码 响应
* 适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放
*
* @author 李贤军
*/
public class WxXcxUrlSchemeGenerateRes extends WxXcxResponseBaseError {
/**
* 生成的小程序 scheme 码
*/
private String openlink;
public String getOpenlink() {
return openlink;
}
public void setOpenlink(String openlink) {
this.openlink = openlink;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
/**
* 查询小程序 scheme 码 请求
*
* @author 李贤军
*/
public class WxXcxUrlSchemeQueryReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 小程序 scheme 码
*/
private String scheme;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getScheme() {
return scheme;
}
public void setScheme(String scheme) {
this.scheme = scheme;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 查询小程序 scheme 码 转换
*
* @author 李贤军
*/
public class WxXcxUrlSchemeQueryRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxUrlSchemeQueryReq req;
public WxXcxUrlSchemeQueryRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxUrlSchemeQueryReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getUrlSchemeQuery() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxUrlSchemeQueryRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlSchemeQueryRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlSchemeQueryRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.urlscheme;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
/**
* 查询小程序 scheme 码 响应
*
* @author 李贤军
*/
public class WxXcxUrlSchemeQueryRes extends WxXcxResponseBaseError {
/**
* scheme 配置
*/
private WxXcxUrlSchemeQuerySchemeInfoRes scheme_info;
/**
* 访问该链接的openid,没有用户访问过则为空字符串
*/
private String visit_openid;
public WxXcxUrlSchemeQuerySchemeInfoRes getScheme_info() {
return scheme_info;
}
public void setScheme_info(WxXcxUrlSchemeQuerySchemeInfoRes scheme_info) {
this.scheme_info = scheme_info;
}
public String getVisit_openid() {
return visit_openid;
}
public void setVisit_openid(String visit_openid) {
this.visit_openid = visit_openid;
}
}
package com.yanzuoguang.wxxcx.urlscheme;
/**
* scheme_info 的结构
*
* @author 李贤军
*/
public class WxXcxUrlSchemeQuerySchemeInfoRes {
/**
* 小程序 appid。
*/
private String appid;
/**
* 小程序页面路径。
*/
private String path;
/**
* 小程序页面query
*/
private String query;
/**
* 创建时间,为 Unix 时间戳。
*/
private String create_time;
/**
* 到期失效时间,为 Unix 时间戳,0 表示永久生效
*/
private String expire_time;
/**
* 要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop"。
*/
private String env_version;
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
public String getExpire_time() {
return expire_time;
}
public void setExpire_time(String expire_time) {
this.expire_time = expire_time;
}
public String getEnv_version() {
return env_version;
}
public void setEnv_version(String env_version) {
this.env_version = env_version;
}
}
package com.yanzuoguang.wxxcx.wxacode;
/**
* 获取小程序二维码 请求
* 适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeCreateQrCodeReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
*/
private String path;
/**
* 二维码的宽度,单位 px。最小 280px,最大 1280px
*/
private int width;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
}
package com.yanzuoguang.wxxcx.wxacode;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 获取小程序二维码 转换
* 适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeCreateQrCodeRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxWxaCodeCreateQrCodeReq req;
public WxXcxWxaCodeCreateQrCodeRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxWxaCodeCreateQrCodeReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getWxaCodeCreateQRCode() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxWxaCodeCreateQrCodeRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxWxaCodeCreateQrCodeRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxWxaCodeCreateQrCodeRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.wxacode;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
import java.nio.Buffer;
/**
* 获取小程序二维码 响应
* 适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeCreateQrCodeRes extends WxXcxResponseBaseError {
/**
* 数据类型 (MIME Type)
*/
private String contentType;
/**
* 数据 Buffer
*/
private Buffer buffer;
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public Buffer getBuffer() {
return buffer;
}
public void setBuffer(Buffer buffer) {
this.buffer = buffer;
}
}
package com.yanzuoguang.wxxcx.wxacode;
/**
* auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetLineColorReq {
/**
* auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
*/
private String r;
/**
* auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
*/
private String g;
/**
* auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
*/
private String b;
public String getR() {
return r;
}
public void setR(String r) {
this.r = r;
}
public String getG() {
return g;
}
public void setG(String g) {
this.g = g;
}
public String getB() {
return b;
}
public void setB(String b) {
this.b = b;
}
}
package com.yanzuoguang.wxxcx.wxacode;
/**
* 获取小程序码 请求
* 适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
*/
private String path;
/**
* 要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop
*/
private String env_version;
/**
* 二维码的宽度,单位 px。最小 280px,最大 1280px
*/
private String width;
/**
* 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
*/
private String auto_color;
/**
* auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
*/
private WxXcxWxaCodeGetLineColorReq line_color;
/**
* 是否需要透明底色,为 true 时,生成透明底色的小程序码
*/
private String is_hyaline;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getEnv_version() {
return env_version;
}
public void setEnv_version(String env_version) {
this.env_version = env_version;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getAuto_color() {
return auto_color;
}
public void setAuto_color(String auto_color) {
this.auto_color = auto_color;
}
public WxXcxWxaCodeGetLineColorReq getLine_color() {
return line_color;
}
public void setLine_color(WxXcxWxaCodeGetLineColorReq line_color) {
this.line_color = line_color;
}
public String getIs_hyaline() {
return is_hyaline;
}
public void setIs_hyaline(String is_hyaline) {
this.is_hyaline = is_hyaline;
}
}
package com.yanzuoguang.wxxcx.wxacode;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 获取小程序码 转换
* 适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxWxaCodeGetReq req;
public WxXcxWxaCodeGetRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxWxaCodeGetReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getWxaCodeGet() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxWxaCodeGetRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxWxaCodeGetRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxWxaCodeGetRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.wxacode;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
import java.nio.Buffer;
/**
* 获取小程序码 响应
* 适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetRes extends WxXcxResponseBaseError {
/**
* 数据类型 (MIME Type)
*/
private String contentType;
/**
* 数据 Buffer
*/
private Buffer buffer;
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public Buffer getBuffer() {
return buffer;
}
public void setBuffer(Buffer buffer) {
this.buffer = buffer;
}
}
package com.yanzuoguang.wxxcx.wxacode;
/**
* 获取小程序码 请求
* 适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetUnlimitedReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式
*/
private String scene;
/**
* 页面 page,例如 pages/index/index,根路径前不要填加 /,不能携带参数(参数请放在 scene 字段里),如果不填写这个字段,默认跳主页面
*/
private String page;
/**
* 检查 page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但 page 有数量上限(60000个)请勿滥用
*/
private boolean check_path;
/**
* 要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop
*/
private String env_version;
/**
* 二维码的宽度,单位 px,最小 280px,最大 1280px
*/
private int width;
/**
* 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
*/
private boolean auto_color;
/**
* auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
*/
private WxXcxWxaCodeGetLineColorReq line_color;
/**
* 是否需要透明底色,为 true 时,生成透明底色的小程序
*/
private boolean is_hyaline;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getScene() {
return scene;
}
public void setScene(String scene) {
this.scene = scene;
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}
public boolean isCheck_path() {
return check_path;
}
public void setCheck_path(boolean check_path) {
this.check_path = check_path;
}
public String getEnv_version() {
return env_version;
}
public void setEnv_version(String env_version) {
this.env_version = env_version;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public boolean isAuto_color() {
return auto_color;
}
public void setAuto_color(boolean auto_color) {
this.auto_color = auto_color;
}
public WxXcxWxaCodeGetLineColorReq getLine_color() {
return line_color;
}
public void setLine_color(WxXcxWxaCodeGetLineColorReq line_color) {
this.line_color = line_color;
}
public boolean isIs_hyaline() {
return is_hyaline;
}
public void setIs_hyaline(boolean is_hyaline) {
this.is_hyaline = is_hyaline;
}
}
package com.yanzuoguang.wxxcx.wxacode;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
/**
* 获取小程序码 转换
* 适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetUnlimitedRequest implements WxXcxRequestUrl, WxXcxRequestUrlPara, WxXcxRequestPostFormData {
private final WxXcxConfig wxXcxConfig;
private final WxXcxRequest wxXcxRequest;
private final WxXcxAccessToken accessToken;
private final WxXcxWxaCodeGetUnlimitedReq req;
public WxXcxWxaCodeGetUnlimitedRequest(WxXcxConfig wxXcxConfig, WxXcxRequest wxXcxRequest, WxXcxAccessToken accessToken, WxXcxWxaCodeGetUnlimitedReq req) {
this.wxXcxConfig = wxXcxConfig;
this.wxXcxRequest = wxXcxRequest;
this.accessToken = accessToken;
this.req = req;
}
@Override
public String getUrl() {
return wxXcxConfig.getBaseUrl() + wxXcxConfig.getWxaCodeGetUnlimited() + "?" + this.getUrlPara();
}
@Override
public String getUrlPara() {
return HttpHelper.getUrlParameter(accessToken);
}
@Override
public String getPost() {
return HttpHelper.getUrlParameter(req);
}
public WxXcxWxaCodeGetUnlimitedRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
return this.wxXcxRequest.request(this, response -> {
WxXcxWxaCodeGetUnlimitedRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxWxaCodeGetUnlimitedRes>() {
});
WxXcxAssert.assertBaseError(ret);
return ret;
});
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.wxacode;
import com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError;
import java.nio.Buffer;
/**
* 获取小程序码 响应
* 适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制
*
* @author 李贤军
*/
public class WxXcxWxaCodeGetUnlimitedRes extends WxXcxResponseBaseError {
/**
* 数据类型 (MIME Type)
*/
private String contentType;
/**
* 数据 Buffer
*/
private Buffer buffer;
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public Buffer getBuffer() {
return buffer;
}
public void setBuffer(Buffer buffer) {
this.buffer = buffer;
}
}
package com.yanzuoguang.wxxcx.auth.login;
import org.junit.Test;
/**
* @author 李贤军
*/
public class WxXcxAuthCode2SessionTest {
@Test
public void wxXcxAuthCode2Session() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment