mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
test(wxapi): 适配新的接口模型
This commit is contained in:
parent
3f4bd40d5f
commit
45e90ca353
@ -0,0 +1,21 @@
|
||||
{
|
||||
"touser": "OPENID",
|
||||
"template_id": "TEMPLATE_ID",
|
||||
"page": "index",
|
||||
"miniprogram_state": "developer",
|
||||
"lang": "zh_CN",
|
||||
"data": {
|
||||
"number01": {
|
||||
"value": "339208499"
|
||||
},
|
||||
"date01": {
|
||||
"value": "2015年01月05日"
|
||||
},
|
||||
"site01": {
|
||||
"value": "TIT创意园"
|
||||
},
|
||||
"site02": {
|
||||
"value": "广州市新港中路397号"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -490,16 +490,19 @@ namespace SKIT.FlurlHttpClient.Wechat
|
||||
// 如果是 GET 请求,检查是否包含 JSON 序列化字段
|
||||
if ("GET".Equals(expectedRequestMethod, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (new Regex("\\[Newtonsoft.Json.JsonProperty\\(\"[a-zA-Z0-9_]*\"\\)\\]").IsMatch(reqCodeSourceCode))
|
||||
if (!reqCodeSourceCode.Contains("/* @codestyle-disable") || !reqCodeSourceCode.Contains("no-jsonable-property-in-get"))
|
||||
{
|
||||
lstError.Add(new Exception($"源代码 \"{reqCodeFileName}\" 下文档代码有误,请求模型为简单请求、不应包含可 JSON 序列化字段。"));
|
||||
return false;
|
||||
}
|
||||
if (new Regex("\\[Newtonsoft.Json.JsonProperty\\(\"[a-zA-Z0-9_]*\"\\)\\]").IsMatch(reqCodeSourceCode))
|
||||
{
|
||||
lstError.Add(new Exception($"源代码 \"{reqCodeFileName}\" 下文档代码有误,请求模型为简单请求、不应包含可 JSON 序列化字段。"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (new Regex("\\[System.Text.Json.Serialization.JsonPropertyName\\(\"[a-zA-Z0-9_]*\"\\)\\]").IsMatch(reqCodeSourceCode))
|
||||
{
|
||||
lstError.Add(new Exception($"源代码 \"{reqCodeFileName}\" 下文档代码有误,请求模型为简单请求、不应包含可 JSON 序列化字段。"));
|
||||
return false;
|
||||
if (new Regex("\\[System.Text.Json.Serialization.JsonPropertyName\\(\"[a-zA-Z0-9_]*\"\\)\\]").IsMatch(reqCodeSourceCode))
|
||||
{
|
||||
lstError.Add(new Exception($"源代码 \"{reqCodeFileName}\" 下文档代码有误,请求模型为简单请求、不应包含可 JSON 序列化字段。"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user