Commit 39f68292 authored by xianjun's avatar xianjun

添加入参验证

parent 9a2a56df
package com.yanzuoguang.wxxcx.base;
/**
* access_token字段
*
* @author 李贤军
*/
public class WxXcxAccessTokenField {
public static final String FIELD_ACCESS_TOKEN = "access_token";
}
package com.yanzuoguang.wxxcx.codeorlink.urllink;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxUrlLinkGenerateRequest implements WxXcxRequestUrl, WxXcxReques
}
public WxXcxUrlLinkGenerateRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlLinkGenerateRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlLinkGenerateRes>() {
});
......@@ -50,4 +50,8 @@ public class WxXcxUrlLinkGenerateRequest implements WxXcxRequestUrl, WxXcxReques
return ret;
});
}
private void checkParam(WxXcxUrlLinkGenerateReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token()).checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.codeorlink.urllink;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxUrlLinkQueryRequest implements WxXcxRequestUrl, WxXcxRequestUr
}
public WxXcxUrlLinkQueryRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlLinkQueryRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlLinkQueryRes>() {
});
......@@ -49,4 +49,8 @@ public class WxXcxUrlLinkQueryRequest implements WxXcxRequestUrl, WxXcxRequestUr
return ret;
});
}
private void checkParam(WxXcxUrlLinkQueryReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token()).checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.codeorlink.urlscheme;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxUrlSchemeGenerateNfcRequest implements WxXcxRequestUrl, WxXcxR
}
public WxXcxUrlSchemeGenerateNfcRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlSchemeGenerateNfcRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlSchemeGenerateNfcRes>() {
});
......@@ -50,4 +50,8 @@ public class WxXcxUrlSchemeGenerateNfcRequest implements WxXcxRequestUrl, WxXcxR
return ret;
});
}
private void checkParam(WxXcxUrlSchemeGenerateNfcReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token()).checkException();
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.codeorlink.urlscheme;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -42,8 +43,7 @@ public class WxXcxUrlSchemeGenerateRequest implements WxXcxRequestUrl, WxXcxRequ
}
public WxXcxUrlSchemeGenerateRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlSchemeGenerateRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlSchemeGenerateRes>() {
});
......@@ -51,4 +51,8 @@ public class WxXcxUrlSchemeGenerateRequest implements WxXcxRequestUrl, WxXcxRequ
return ret;
});
}
private void checkParam(WxXcxUrlSchemeGenerateReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token()).checkException();
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.codeorlink.urlscheme;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxUrlSchemeQueryRequest implements WxXcxRequestUrl, WxXcxRequest
}
public WxXcxUrlSchemeQueryRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUrlSchemeQueryRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUrlSchemeQueryRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxUrlSchemeQueryRequest implements WxXcxRequestUrl, WxXcxRequest
return ret;
});
}
private void checkParam(WxXcxUrlSchemeQueryReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("scheme", req.getScheme())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.codeorlink.wxacode;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxWxaCodeCreateQrCodeRequest implements WxXcxRequestUrl, WxXcxRe
}
public WxXcxWxaCodeCreateQrCodeRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxWxaCodeCreateQrCodeRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxWxaCodeCreateQrCodeRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxWxaCodeCreateQrCodeRequest implements WxXcxRequestUrl, WxXcxRe
return ret;
});
}
private void checkParam(WxXcxWxaCodeCreateQrCodeReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("path", req.getPath())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.codeorlink.wxacode;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxWxaCodeGetRequest implements WxXcxRequestUrl, WxXcxRequestUrlP
}
public WxXcxWxaCodeGetRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxWxaCodeGetRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxWxaCodeGetRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxWxaCodeGetRequest implements WxXcxRequestUrl, WxXcxRequestUrlP
return ret;
});
}
private void checkParam(WxXcxWxaCodeGetReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("path", req.getPath())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.codeorlink.wxacode;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxWxaCodeGetUnlimitedRequest implements WxXcxRequestUrl, WxXcxRe
}
public WxXcxWxaCodeGetUnlimitedRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxWxaCodeGetUnlimitedRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxWxaCodeGetUnlimitedRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxWxaCodeGetUnlimitedRequest implements WxXcxRequestUrl, WxXcxRe
return ret;
});
}
private void checkParam(WxXcxWxaCodeGetUnlimitedReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("scene", req.getScene())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.dataanalysis.data;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxAnalysisGetPerformanceDataRequest implements WxXcxRequestUrl,
}
public WxXcxAnalysisGetPerformanceDataRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetPerformanceDataRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetPerformanceDataRes>() {
});
......@@ -49,4 +49,12 @@ public class WxXcxAnalysisGetPerformanceDataRequest implements WxXcxRequestUrl,
return ret;
});
}
private void checkParam(WxXcxAnalysisGetPerformanceDataReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("module", req.getModule())
.notNull("time", req.getTime())
.notNull("params", req.getParams())
.checkException();
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.dataanalysis.distribution;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxAnalysisGetVisitDistributionRequest implements WxXcxRequestUrl
}
public WxXcxAnalysisGetVisitDistributionRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetVisitDistributionRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetVisitDistributionRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxAnalysisGetVisitDistributionRequest implements WxXcxRequestUrl
return ret;
});
}
private void checkParam(WxXcxAnalysisGetVisitDistributionReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.dataanalysis.page;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -42,8 +43,7 @@ public class WxXcxAnalysisGetVisitPageRequest implements WxXcxRequestUrl, WxXcxR
}
public WxXcxAnalysisGetVisitPageRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetVisitPageRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetVisitPageRes>() {
});
......@@ -51,5 +51,12 @@ public class WxXcxAnalysisGetVisitPageRequest implements WxXcxRequestUrl, WxXcxR
return ret;
});
}
private void checkParam(WxXcxAnalysisGetVisitPageReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
package com.yanzuoguang.wxxcx.dataanalysis.portrait;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxAnalysisGetUserPortraitRequest implements WxXcxRequestUrl, WxX
}
public WxXcxAnalysisGetUserPortraitRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetUserPortraitRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetUserPortraitRes>() {
});
......@@ -50,5 +50,12 @@ public class WxXcxAnalysisGetUserPortraitRequest implements WxXcxRequestUrl, WxX
return ret;
});
}
private void checkParam(WxXcxAnalysisGetUserPortraitReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.dataanalysis.retain;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxAnalysisGetDailyRetainRequest implements WxXcxRequestUrl, WxXc
}
public WxXcxAnalysisGetDailyRetainRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetDailyRetainRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetDailyRetainRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxAnalysisGetDailyRetainRequest implements WxXcxRequestUrl, WxXc
return ret;
});
}
private void checkParam(WxXcxAnalysisGetDailyRetainReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
package com.yanzuoguang.wxxcx.dataanalysis.retain;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxAnalysisGetMonthlyRetainRequest implements WxXcxRequestUrl, Wx
}
public WxXcxAnalysisGetMonthlyRetainRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetMonthlyRetainRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetMonthlyRetainRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxAnalysisGetMonthlyRetainRequest implements WxXcxRequestUrl, Wx
return ret;
});
}
private void checkParam(WxXcxAnalysisGetMonthlyRetainReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.dataanalysis.retain;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxAnalysisGetWeeklyRetainRequest implements WxXcxRequestUrl, WxX
}
public WxXcxAnalysisGetWeeklyRetainRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetWeeklyRetainRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetWeeklyRetainRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxAnalysisGetWeeklyRetainRequest implements WxXcxRequestUrl, WxX
return ret;
});
}
private void checkParam(WxXcxAnalysisGetWeeklyRetainReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
package com.yanzuoguang.wxxcx.dataanalysis.summary;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
import com.yanzuoguang.wxxcx.dataanalysis.retain.WxXcxAnalysisGetWeeklyRetainReq;
/**
* 获取用户访问小程序数据概况 转换
......@@ -40,8 +42,7 @@ public class WxXcxAnalysisGetDailySummaryRequest implements WxXcxRequestUrl, WxX
}
public WxXcxAnalysisGetDailySummaryRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetDailySummaryRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetDailySummaryRes>() {
});
......@@ -49,4 +50,11 @@ public class WxXcxAnalysisGetDailySummaryRequest implements WxXcxRequestUrl, WxX
return ret;
});
}
private void checkParam(WxXcxAnalysisGetDailySummaryReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.dataanalysis.trend;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxAnalysisGetDailyVisitTrendRequest implements WxXcxRequestUrl,
}
public WxXcxAnalysisGetDailyVisitTrendRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetDailyVisitTrendRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetDailyVisitTrendRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxAnalysisGetDailyVisitTrendRequest implements WxXcxRequestUrl,
return ret;
});
}
private void checkParam(WxXcxAnalysisGetDailyVisitTrendReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.dataanalysis.trend;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxAnalysisGetMonthlyVisitTrendRequest implements WxXcxRequestUrl
}
public WxXcxAnalysisGetMonthlyVisitTrendRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetMonthlyVisitTrendRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetMonthlyVisitTrendRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxAnalysisGetMonthlyVisitTrendRequest implements WxXcxRequestUrl
return ret;
});
}
private void checkParam(WxXcxAnalysisGetMonthlyVisitTrendReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
\ No newline at end of file
......@@ -6,4 +6,40 @@ package com.yanzuoguang.wxxcx.dataanalysis.trend;
* @author 李贤军
*/
public class WxXcxAnalysisGetWeeklyVisitTrendReq {
/**
* 接口调用凭证
*/
private String access_token;
/**
* 开始日期。格式为 yyyymmdd
*/
private String begin_date;
/**
* 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd
*/
private String end_date;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getBegin_date() {
return begin_date;
}
public void setBegin_date(String begin_date) {
this.begin_date = begin_date;
}
public String getEnd_date() {
return end_date;
}
public void setEnd_date(String end_date) {
this.end_date = end_date;
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.dataanalysis.trend;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxAnalysisGetWeeklyVisitTrendRequest implements WxXcxRequestUrl,
}
public WxXcxAnalysisGetWeeklyVisitTrendRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAnalysisGetWeeklyVisitTrendRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAnalysisGetWeeklyVisitTrendRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxAnalysisGetWeeklyVisitTrendRequest implements WxXcxRequestUrl,
return ret;
});
}
private void checkParam(WxXcxAnalysisGetWeeklyVisitTrendReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("begin_date", req.getBegin_date())
.notBlankCheck("end_date", req.getEnd_date())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.login;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -33,8 +34,7 @@ public class WxXcxAuthCode2SessionRequest implements WxXcxRequestUrl, WxXcxReque
}
public WxXcxAuthCode2SessionRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthCode2SessionRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthCode2SessionRes>() {
});
......@@ -42,4 +42,12 @@ public class WxXcxAuthCode2SessionRequest implements WxXcxRequestUrl, WxXcxReque
return ret;
});
}
private void checkParam(WxXcxAuthCode2SessionReq req) {
CheckerHelper.newInstance().notBlankCheck("appid", req.getAppid())
.notBlankCheck("secret", req.getSecret())
.notBlankCheck("js_code", req.getJs_code())
.notBlankCheck("grant_type", req.getGrant_type())
.checkException();
}
}
package com.yanzuoguang.wxxcx.messagemanage.uniformmessage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
import com.yanzuoguang.wxxcx.login.WxXcxAuthCode2SessionReq;
/**
* 下发小程序和公众号统一的服务消息 转换
......@@ -40,8 +42,7 @@ public class WxXcxUniformMessageSendRequest implements WxXcxRequestUrl, WxXcxReq
}
public WxXcxUniformMessageSendRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUniformMessageSendRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUniformMessageSendRes>() {
});
......@@ -49,4 +50,12 @@ public class WxXcxUniformMessageSendRequest implements WxXcxRequestUrl, WxXcxReq
return ret;
});
}
private void checkParam(WxXcxUniformMessageSendReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("touser", req.getTouser())
.notNull("weapp_template_msg", req.getWeapp_template_msg())
.notBlankCheck("mp_template_msg", req.getMp_template_msg())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.messagemanage.updatablemessage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -35,8 +36,7 @@ public class WxXcxUpdatableMessageCreateActivityIdRequest implements WxXcxReques
}
public WxXcxUpdatableMessageCreateActivityIdRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUpdatableMessageCreateActivityIdRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUpdatableMessageCreateActivityIdRes>() {
});
......@@ -44,4 +44,9 @@ public class WxXcxUpdatableMessageCreateActivityIdRequest implements WxXcxReques
return ret;
});
}
private void checkParam(WxXcxUpdatableMessageCreateActivityIdReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.checkException();
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.messagemanage.updatablemessage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxUpdatableMessageSetUpdatableMsgRequest implements WxXcxRequest
}
public WxXcxUpdatableMessageSetUpdatableMsgRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxUpdatableMessageSetUpdatableMsgRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxUpdatableMessageSetUpdatableMsgRes>() {
});
......@@ -50,4 +50,9 @@ public class WxXcxUpdatableMessageSetUpdatableMsgRequest implements WxXcxRequest
return ret;
});
}
private void checkParam(WxXcxUpdatableMessageSetUpdatableMsgReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.checkException();
}
}
package com.yanzuoguang.wxxcx.nearbypoi;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxNearbyPoiAddRequest implements WxXcxRequestUrl, WxXcxRequestUr
}
public WxXcxNearbyPoiAddRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxNearbyPoiAddRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxNearbyPoiAddRes>() {
});
......@@ -49,4 +49,21 @@ public class WxXcxNearbyPoiAddRequest implements WxXcxRequestUrl, WxXcxRequestUr
return ret;
});
}
private void checkParam(WxXcxNearbyPoiAddReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("kf_info", req.getKf_info())
.notBlankCheck("pic_list", req.getPic_list())
.notBlankCheck("service_infos", req.getService_infos())
.notBlankCheck("store_name", req.getStore_name())
.notBlankCheck("contract_phone", req.getContract_phone())
.notBlankCheck("company_name", req.getCompany_name())
.notBlankCheck("credential", req.getCredential())
.notBlankCheck("address", req.getAddress())
.notBlankCheck("qualification_list", req.getQualification_list())
.notBlankCheck("is_comm_nearby", req.getIs_comm_nearby())
.notBlankCheck("poi_id", req.getPoi_id())
.notBlankCheck("map_poi_id", req.getMap_poi_id())
.checkException();
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.nearbypoi;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxNearbyPoiDeleteRequest implements WxXcxRequestUrl, WxXcxReques
}
public WxXcxNearbyPoiDeleteRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxNearbyPoiDeleteRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxNearbyPoiDeleteRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxNearbyPoiDeleteRequest implements WxXcxRequestUrl, WxXcxReques
return ret;
});
}
private void checkParam(WxXcxNearbyPoiDeleteReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("poi_id", req.getPoi_id())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.nearbypoi;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxNearbyPoiGetListRequest implements WxXcxRequestUrl, WxXcxReque
}
public WxXcxNearbyPoiGetListRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxNearbyPoiGetListRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxNearbyPoiGetListRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxNearbyPoiGetListRequest implements WxXcxRequestUrl, WxXcxReque
return ret;
});
}
private void checkParam(WxXcxNearbyPoiGetListReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("page", req.getPage())
.notBlankCheck("page_rows", req.getPage_rows())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.nearbypoi;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxNearbyPoiSetShowStatusRequest implements WxXcxRequestUrl, WxXc
}
public WxXcxNearbyPoiSetShowStatusRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxNearbyPoiSetShowStatusRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxNearbyPoiSetShowStatusRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxNearbyPoiSetShowStatusRequest implements WxXcxRequestUrl, WxXc
return ret;
});
}
private void checkParam(WxXcxNearbyPoiSetShowStatusReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("poi_id", req.getPoi_id())
.notBlankCheck("status", req.getStatus())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.openapimanage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
import com.yanzuoguang.wxxcx.nearbypoi.WxXcxNearbyPoiAddReq;
import com.yanzuoguang.wxxcx.nearbypoi.WxXcxNearbyPoiAddRes;
/**
* 重置 API 调用次数 转换
......@@ -42,8 +41,7 @@ public class WxXcxOpenApiManageClearQuotaRequest implements WxXcxRequestUrl, WxX
}
public WxXcxOpenApiManageClearQuotaRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxOpenApiManageClearQuotaRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxOpenApiManageClearQuotaRes>() {
});
......@@ -51,4 +49,10 @@ public class WxXcxOpenApiManageClearQuotaRequest implements WxXcxRequestUrl, WxX
return ret;
});
}
private void checkParam(WxXcxOpenApiManageClearQuotaReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("appid", req.getAppid())
.checkException();
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.openapimanage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxOpenApiManageGetApiQuotaRequest implements WxXcxRequestUrl, Wx
}
public WxXcxOpenApiManageGetApiQuotaRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxOpenApiManageGetApiQuotaRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxOpenApiManageGetApiQuotaRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxOpenApiManageGetApiQuotaRequest implements WxXcxRequestUrl, Wx
return ret;
});
}
private void checkParam(WxXcxOpenApiManageGetApiQuotaReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("cgi_path", req.getCgi_path())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.openapimanage;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxOpenApiManageGetRidInfoRequest implements WxXcxRequestUrl, WxX
}
public WxXcxOpenApiManageGetRidInfoRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxOpenApiManageGetRidInfoRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxOpenApiManageGetRidInfoRes>() {
});
......@@ -49,4 +49,10 @@ public class WxXcxOpenApiManageGetRidInfoRequest implements WxXcxRequestUrl, WxX
return ret;
});
}
private void checkParam(WxXcxOpenApiManageGetRidInfoReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("rid", req.getRid())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.pluginmanager.all;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXxcPluginManagerGetPluginDevApplyListRequest implements WxXcxRequ
}
public WxXxcPluginManagerGetPluginDevApplyListRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXxcPluginManagerGetPluginDevApplyListRes ret = JsonHelper.deserialize(response, new TypeReference<WxXxcPluginManagerGetPluginDevApplyListRes>() {
});
......@@ -49,4 +49,12 @@ public class WxXxcPluginManagerGetPluginDevApplyListRequest implements WxXcxRequ
return ret;
});
}
private void checkParam(WxXxcPluginManagerGetPluginDevApplyListReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("action", req.getAction())
.notBlankCheck("page", req.getPage())
.notBlankCheck("num", req.getNum())
.checkException();
}
}
package com.yanzuoguang.wxxcx.pluginmanager.apply;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxPluginManagerApplyPluginRequest implements WxXcxRequestUrl, Wx
}
public WxXcxPluginManagerApplyPluginRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxPluginManagerApplyPluginRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxPluginManagerApplyPluginRes>() {
});
......@@ -49,4 +49,12 @@ public class WxXcxPluginManagerApplyPluginRequest implements WxXcxRequestUrl, Wx
return ret;
});
}
private void checkParam(WxXcxPluginManagerApplyPluginReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("action", req.getAction())
.notBlankCheck("plugin_appid", req.getPlugin_appid())
.notBlankCheck("reason", req.getReason())
.checkException();
}
}
package com.yanzuoguang.wxxcx.pluginmanager.get;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxPluginManagerGetPluginListRequest implements WxXcxRequestUrl,
}
public WxXcxPluginManagerGetPluginListRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxPluginManagerGetPluginListRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxPluginManagerGetPluginListRes>() {
});
......@@ -50,4 +50,10 @@ public class WxXcxPluginManagerGetPluginListRequest implements WxXcxRequestUrl,
return ret;
});
}
private void checkParam(WxXcxPluginManagerGetPluginListReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("action", req.getAction())
.checkException();
}
}
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.pluginmanager.status;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxPluginManagerSetDevPluginApplyStatusRequest implements WxXcxRe
}
public WxXcxPluginManagerSetDevPluginApplyStatusRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxPluginManagerSetDevPluginApplyStatusRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxPluginManagerSetDevPluginApplyStatusRes>() {
});
......@@ -50,4 +50,12 @@ public class WxXcxPluginManagerSetDevPluginApplyStatusRequest implements WxXcxRe
return ret;
});
}
private void checkParam(WxXcxPluginManagerSetDevPluginApplyStatusReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("action", req.getAction())
.notBlankCheck("appid", req.getAppid())
.notBlankCheck("reason", req.getReason())
.checkException();
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yanzuoguang.wxxcx.pluginmanager.unbind;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxPluginManagerUnbindPluginRequest implements WxXcxRequestUrl, W
}
public WxXcxPluginManagerUnbindPluginRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxPluginManagerUnbindPluginRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxPluginManagerUnbindPluginRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxPluginManagerUnbindPluginRequest implements WxXcxRequestUrl, W
return ret;
});
}
private void checkParam(WxXcxPluginManagerUnbindPluginReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("action", req.getAction())
.notBlankCheck("plugin_appid", req.getPlugin_appid())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.redpacketcover;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -41,8 +42,7 @@ public class WxXcxRedPacketCoverGetAuthenticationUrlRequest implements WxXcxRequ
}
public WxXcxRedPacketCoverGetAuthenticationUrlRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxRedPacketCoverGetAuthenticationUrlRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxRedPacketCoverGetAuthenticationUrlRes>() {
});
......@@ -50,4 +50,11 @@ public class WxXcxRedPacketCoverGetAuthenticationUrlRequest implements WxXcxRequ
return ret;
});
}
private void checkParam(WxXcxRedPacketCoverGetAuthenticationUrlReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("openid", req.getOpenid())
.notBlankCheck("ctoken", req.getCtoken())
.checkException();
}
}
package com.yanzuoguang.wxxcx.security;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -46,8 +47,7 @@ public class WxXcxSecurityMediaCheckAsyncRequest implements WxXcxRequestUrl, WxX
}
public WxXcxSecurityMediaCheckAsyncRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxSecurityMediaCheckAsyncRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxSecurityMediaCheckAsyncRes>() {
});
......@@ -55,4 +55,14 @@ public class WxXcxSecurityMediaCheckAsyncRequest implements WxXcxRequestUrl, WxX
return ret;
});
}
private void checkParam(WxXcxSecurityMediaCheckAsyncReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("media_url", req.getMedia_url())
.notBlankCheck("media_type", req.getMedia_type())
.notBlankCheck("version", req.getVersion())
.notBlankCheck("openid", req.getOpenid())
.notBlankCheck("scene", req.getScene())
.checkException();
}
}
package com.yanzuoguang.wxxcx.security;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -47,8 +48,7 @@ public class WxXcxSecurityMsgSecCheckRequest implements WxXcxRequestUrl, WxXcxRe
}
public WxXcxSecurityMsgSecCheckRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxSecurityMsgSecCheckRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxSecurityMsgSecCheckRes>() {
});
......@@ -56,4 +56,13 @@ public class WxXcxSecurityMsgSecCheckRequest implements WxXcxRequestUrl, WxXcxRe
return ret;
});
}
private void checkParam(WxXcxSecurityMsgSecCheckReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("content", req.getContent())
.notBlankCheck("version", req.getVersion())
.notBlankCheck("openid", req.getOpenid())
.notBlankCheck("scene", req.getScene())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.servicecustomer.gettempmedia;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -36,8 +37,7 @@ public class WxXcxCustomerServiceMessageGetTempMediaRequest implements WxXcxRequ
}
public WxXcxCustomerServiceMessageGetTempMediaRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxCustomerServiceMessageGetTempMediaRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxCustomerServiceMessageGetTempMediaRes>() {
});
......@@ -45,4 +45,10 @@ public class WxXcxCustomerServiceMessageGetTempMediaRequest implements WxXcxRequ
return ret;
});
}
private void checkParam(WxXcxCustomerServiceMessageGetTempMediaReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("media_id", req.getMedia_id())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.servicecustomer.send;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxCustomerServiceMessageSendRequest implements WxXcxRequestUrl,
}
public WxXcxCustomerServiceMessageSendRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxCustomerServiceMessageSendRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxCustomerServiceMessageSendRes>() {
});
......@@ -49,4 +49,15 @@ public class WxXcxCustomerServiceMessageSendRequest implements WxXcxRequestUrl,
return ret;
});
}
private void checkParam(WxXcxCustomerServiceMessageSendReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("touser", req.getTouser())
.notBlankCheck("msgtype", req.getMsgtype())
.notNull("text", req.getText())
.notNull("image", req.getImage())
.notNull("link", req.getLink())
.notNull("miniprogrampage", req.getMiniprogrampage())
.checkException();
}
}
package com.yanzuoguang.wxxcx.servicecustomer.settyping;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxCustomerServiceMessageSetTypingRequest implements WxXcxRequest
}
public WxXcxCustomerServiceMessageSetTypingRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxCustomerServiceMessageSetTypingRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxCustomerServiceMessageSetTypingRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxCustomerServiceMessageSetTypingRequest implements WxXcxRequest
return ret;
});
}
private void checkParam(WxXcxCustomerServiceMessageSetTypingReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("touser", req.getTouser())
.notBlankCheck("command", req.getCommand())
.checkException();
}
}
......@@ -23,7 +23,7 @@ public class WxXcxCustomerServiceMessageUploadTempMediaReq {
/**
* form-data 中媒体文件标识,有filename、filelength、content-type等信息
*/
private String media;
private Object media;
public String getAccess_token() {
return access_token;
......@@ -49,11 +49,11 @@ public class WxXcxCustomerServiceMessageUploadTempMediaReq {
this.type = type;
}
public String getMedia() {
public Object getMedia() {
return media;
}
public void setMedia(String media) {
public void setMedia(Object media) {
this.media = media;
}
}
package com.yanzuoguang.wxxcx.servicecustomer.uploadtempmedia;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxCustomerServiceMessageUploadTempMediaRequest implements WxXcxR
}
public WxXcxCustomerServiceMessageUploadTempMediaRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxCustomerServiceMessageUploadTempMediaRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxCustomerServiceMessageUploadTempMediaRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxCustomerServiceMessageUploadTempMediaRequest implements WxXcxR
return ret;
});
}
private void checkParam(WxXcxCustomerServiceMessageUploadTempMediaReq req) {
CheckerHelper.newInstance().notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("type", req.getType())
.notBlankCheck("media", req.getMedia())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.token;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -24,7 +25,7 @@ public class WxXcxAuthGetAccessTokenRequest implements WxXcxRequestUrl, WxXcxReq
@Override
public String getUrl() {
return "https://api.weixin.qq.com/cgi-bin/token"+ "?" + this.getUrlPara();
return "https://api.weixin.qq.com/cgi-bin/token" + "?" + this.getUrlPara();
// return wxXcxConfig.getBaseUrl() + wxXcxConfig.getAuthGetAccessTokenUrl() + "?" + this.getUrlPara();
}
......@@ -34,8 +35,7 @@ public class WxXcxAuthGetAccessTokenRequest implements WxXcxRequestUrl, WxXcxReq
}
public WxXcxAuthGetAccessTokenRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthGetAccessTokenRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthGetAccessTokenRes>() {
});
......@@ -43,4 +43,12 @@ public class WxXcxAuthGetAccessTokenRequest implements WxXcxRequestUrl, WxXcxReq
return ret;
});
}
private void checkParam(WxXcxAuthGetAccessTokenReq req) {
CheckerHelper.newInstance()
.notBlankCheck("grant_type", req.getGrant_type())
.notBlankCheck("appid", req.getAppid())
.notBlankCheck("secret", req.getSecret())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.user.checkencrypted;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxAuthCheckEncryptedDataRequest implements WxXcxRequestUrl, WxXc
}
public WxXcxAuthCheckEncryptedDataRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthCheckEncryptedDataRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthCheckEncryptedDataRes>() {
});
......@@ -49,4 +49,10 @@ public class WxXcxAuthCheckEncryptedDataRequest implements WxXcxRequestUrl, WxXc
return ret;
});
}
private void checkParam(WxXcxAuthCheckEncryptedDataReq req) {
CheckerHelper.newInstance()
.notBlankCheck("encrypted_msg_hash", req.getEncrypted_msg_hash())
.checkException();
}
}
package com.yanzuoguang.wxxcx.user.getphone;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxGetPhoneNumberRequest implements WxXcxRequestUrl, WxXcxRequest
}
public WxXcxGetPhoneNumberRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxGetPhoneNumberRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxGetPhoneNumberRes>() {
});
......@@ -49,4 +49,10 @@ public class WxXcxGetPhoneNumberRequest implements WxXcxRequestUrl, WxXcxRequest
return ret;
});
}
private void checkParam(WxXcxGetPhoneNumberReq req) {
CheckerHelper.newInstance()
.notBlankCheck("code", req.getCode())
.checkException();
}
}
\ No newline at end of file
package com.yanzuoguang.wxxcx.user.getpluginpid;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxAuthGetPluginOpenPidRequest implements WxXcxRequestUrl, WxXcxR
}
public WxXcxAuthGetPluginOpenPidRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthGetPluginOpenPidRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthGetPluginOpenPidRes>() {
});
......@@ -49,4 +49,11 @@ public class WxXcxAuthGetPluginOpenPidRequest implements WxXcxRequestUrl, WxXcxR
return ret;
});
}
private void checkParam(WxXcxAuthGetPluginOpenPidReq req) {
CheckerHelper.newInstance()
.notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("code", req.getCode())
.checkException();
}
}
package com.yanzuoguang.wxxcx.user.getunionid;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -36,8 +37,7 @@ public class WxXcxAuthGetPaidUnionIdRequest implements WxXcxRequestUrl, WxXcxReq
}
public WxXcxAuthGetPaidUnionIdRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxAuthGetPaidUnionIdRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxAuthGetPaidUnionIdRes>() {
});
......@@ -45,4 +45,11 @@ public class WxXcxAuthGetPaidUnionIdRequest implements WxXcxRequestUrl, WxXcxReq
return ret;
});
}
private void checkParam(WxXcxAuthGetPaidUnionIdReq req) {
CheckerHelper.newInstance()
.notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("openid", req.getOpenid())
.checkException();
}
}
package com.yanzuoguang.wxxcx.user.getuserencryptkey;
import com.alibaba.fastjson.TypeReference;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.HttpHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.wxxcx.base.*;
......@@ -40,8 +41,7 @@ public class WxXcxGetUserEncryptKeyRequest implements WxXcxRequestUrl, WxXcxRequ
}
public WxXcxGetUserEncryptKeyRes getResponse() {
// todo: 检测参数是否合法
// Assert.assertEquals();
checkParam(req);
return this.wxXcxRequest.request(this, response -> {
WxXcxGetUserEncryptKeyRes ret = JsonHelper.deserialize(response, new TypeReference<WxXcxGetUserEncryptKeyRes>() {
});
......@@ -49,4 +49,13 @@ public class WxXcxGetUserEncryptKeyRequest implements WxXcxRequestUrl, WxXcxRequ
return ret;
});
}
private void checkParam(WxXcxGetUserEncryptKeyReq req) {
CheckerHelper.newInstance()
.notBlankCheck(WxXcxAccessTokenField.FIELD_ACCESS_TOKEN, req.getAccess_token())
.notBlankCheck("openid", req.getOpenid())
.notBlankCheck("signature", req.getSignature())
.notBlankCheck("sig_method", req.getSig_method())
.checkException();
}
}
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