Skip to content

Developer #1023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ packages/
/src/Senparc.Weixin.MP.BuildOutPut/Senparc.Weixin.WxOpen.1.6.0.nupkg
/src/Senparc.Weixin.MP.BuildOutPut/Senparc.Weixin.Work.1.0.0.nupkg
/src/Senparc.Weixin.MP.Sample.vs2017/Senparc.Weixin.MP.CoreSample/App_Data/Document/Files
/Samples/Senparc.Weixin.MP.Sample/UpgradeLog2.htm
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@
@if (!IsSectionDefined("catalog"))
{
<div class="catalog">
<a href="@Url.Action("Index", "Menu")">自定义菜单设置工具</a>
<a href="@Url.Action("Index", "Menu")">@*自定义*@菜单设置工具</a>
<a href="@Url.Action("Index", "SimulateTool")">消息模拟工具</a>
<a href="@Url.Action("Test", "Cache")">缓存测试</a>
<a href="@Url.Action("Index", "AsyncMethods")">异步方法</a>
<a href="https://sdk.weixin.senparc.com@(Url.Action("Index", "Document"))">帮助文档</a>
<a href="https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index" target="_blank">测试号入口</a>
</div>
}
@RenderBody()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@
<Compile Include="WxaAPIs\Sns\SnsApi.cs" />
<Compile Include="WxaAPIs\Sns\SnsJson\JsCode2JsonResult.cs" />
<Compile Include="WxaAPIs\Template\TemplateApi.cs" />
<Compile Include="WxaAPIs\Template\TemplateJson\LibraryGetJsonResult.cs" />
<Compile Include="WxaAPIs\Template\TemplateJson\AddJsonResult.cs" />
<Compile Include="WxaAPIs\Template\TemplateJson\ListJsonResult.cs" />
<Compile Include="WxaAPIs\Template\TemplateJson\LibraryListJsonResult.cs" />
<Compile Include="WxaAPIs\Tester\TesterApi.cs" />
<Compile Include="WxaAPIs\Tester\TesterJson\CreateJsonResult.cs" />
<Compile Include="WxaAPIs\Tester\TesterJson\GetJsonResult.cs" />
Expand All @@ -144,4 +140,5 @@
<Target Name="AfterBuild">
</Target>
-->

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net35;net40;net45;netstandard1.6;netstandard2.0</TargetFrameworks>
<Version>2.8.4</Version>
<Version>2.8.5</Version>
<AssemblyName>Senparc.Weixin.Open</AssemblyName>
<RootNamespace>Senparc.Weixin.Open</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down Expand Up @@ -104,6 +104,7 @@
v2.8.2 新增:小程序代码模版库管理
v2.8.3 修复 AuthorizerBag 使用外部缓存不会自动更新的问题
v2.8.4 GetAuthorizerInfoResult 添加 principal_name 属性(公众号的主体名称)
v2.8.5 原小程序模板消息接口迁移至小程序(Senparc.Weixin.WxOpen)模块,Open中的方法已标记为过期。
</PackageReleaseNotes>
<RepositoryUrl>https://github.com/JeffreySu/WeiXinMPSDK</RepositoryUrl>
</PropertyGroup>
Expand Down Expand Up @@ -186,6 +187,7 @@

<ItemGroup>
<Folder Include="Properties\" />
<Folder Include="WxaAPIs\Template\TemplateJson\" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ and limitations under the License.
/*----------------------------------------------------------------
Copyright (C) 2018 Senparc

文件名:SnsApi.cs
文件名:TemplateApi.cs
文件功能描述:小程序模板消息

创建标识:Senparc - 20170827
创建标识:Senparc - 20171215

修改标识:Senparc - 20180107
修改描述:v2.8.5 将接口迁移至 WxOpen 中

----------------------------------------------------------------*/

Expand All @@ -33,8 +36,8 @@ and limitations under the License.
using System.Threading.Tasks;
using Senparc.Weixin.CommonAPIs;
using Senparc.Weixin.Entities;
using Senparc.Weixin.Exceptions;
using Senparc.Weixin.HttpUtility;
using Senparc.Weixin.Open.WxaAPIs.Template.TemplateJson;

namespace Senparc.Weixin.Open.WxaAPIs.Template
{
Expand All @@ -56,15 +59,10 @@ public static class TemplateApi
/// <param name="count">offset和count用于分页,表示从offset开始,拉取count条记录,offset从0开始,count最大为20。</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static LibraryListJsonResult LibraryList(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static WxJsonResult LibraryList(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/library/list?access_token={0}";
var data = new
{
offset = offset,
count = count
};
return CommonJsonSend.Send<LibraryListJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}

/// <summary>
Expand All @@ -74,14 +72,10 @@ public static LibraryListJsonResult LibraryList(string accessToken, int offset,
/// <param name="id">模板标题id,可通过接口获取,也可登录小程序后台查看获取</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static LibraryGetJsonResult LibraryGet(string accessToken, string id, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static WxJsonResult LibraryGet(string accessToken, string id, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/library/list?access_token={0}";
var data = new
{
id = id
};
return CommonJsonSend.Send<LibraryGetJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}


Expand All @@ -93,15 +87,10 @@ public static LibraryGetJsonResult LibraryGet(string accessToken, string id, int
/// <param name="keywordIdList">开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如[3,5,4]或[4,5,3]),最多支持10个关键词组合</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static LibraryGetJsonResult Add(string accessToken, string id, int[] keywordIdList, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static WxJsonResult Add(string accessToken, string id, int[] keywordIdList, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/add?access_token={0}";
var data = new
{
id = id,
keyword_id_list = keywordIdList
};
return CommonJsonSend.Send<LibraryGetJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}

#endregion
Expand All @@ -117,15 +106,10 @@ public static LibraryGetJsonResult Add(string accessToken, string id, int[] keyw
/// <param name="count">offset和count用于分页,表示从offset开始,拉取count条记录,offset从0开始,count最大为20。最后一页的list长度可能小于请求的count</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static ListJsonResult List(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static WxJsonResult List(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/list?access_token={0}";
var data = new
{
offset = offset,
count = count
};
return CommonJsonSend.Send<ListJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}

/// <summary>
Expand All @@ -135,14 +119,10 @@ public static ListJsonResult List(string accessToken, int offset, int count, int
/// <param name="templateId">要删除的模板id</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static WxJsonResult Del(string accessToken, string templateId, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/del?access_token={0}";
var data = new
{
template_id = templateId
};
return CommonJsonSend.Send<WxJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}


Expand All @@ -164,15 +144,10 @@ public static WxJsonResult Del(string accessToken, string templateId, int timeOu
/// <param name="count">offset和count用于分页,表示从offset开始,拉取count条记录,offset从0开始,count最大为20。</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static async Task<LibraryListJsonResult> LibraryListAsync(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static async Task<WxJsonResult> LibraryListAsync(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/library/list?access_token={0}";
var data = new
{
offset = offset,
count = count
};
return await CommonJsonSend.SendAsync<LibraryListJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}

/// <summary>
Expand All @@ -182,14 +157,10 @@ public static async Task<LibraryListJsonResult> LibraryListAsync(string accessTo
/// <param name="id">模板标题id,可通过接口获取,也可登录小程序后台查看获取</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static async Task<LibraryGetJsonResult> LibraryGetAsync(string accessToken, string id, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static async Task<WxJsonResult> LibraryGetAsync(string accessToken, string id, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/library/list?access_token={0}";
var data = new
{
id = id
};
return await CommonJsonSend.SendAsync<LibraryGetJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}


Expand All @@ -201,15 +172,10 @@ public static async Task<LibraryGetJsonResult> LibraryGetAsync(string accessToke
/// <param name="keywordIdList">开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如[3,5,4]或[4,5,3]),最多支持10个关键词组合</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static async Task<LibraryGetJsonResult> AddAsync(string accessToken, string id, int[] keywordIdList, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static async Task<WxJsonResult> AddAsync(string accessToken, string id, int[] keywordIdList, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/add?access_token={0}";
var data = new
{
id = id,
keyword_id_list = keywordIdList
};
return await CommonJsonSend.SendAsync<LibraryGetJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}

#endregion
Expand All @@ -225,15 +191,10 @@ public static async Task<LibraryGetJsonResult> AddAsync(string accessToken, stri
/// <param name="count">offset和count用于分页,表示从offset开始,拉取count条记录,offset从0开始,count最大为20。最后一页的list长度可能小于请求的count</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
public static async Task<ListJsonResult> ListAsync(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static async Task<WxJsonResult> ListAsync(string accessToken, int offset, int count, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/list?access_token={0}";
var data = new
{
offset = offset,
count = count
};
return await CommonJsonSend.SendAsync<ListJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}

/// <summary>
Expand All @@ -243,17 +204,12 @@ public static async Task<ListJsonResult> ListAsync(string accessToken, int offse
/// <param name="templateId">要删除的模板id</param>
/// <param name="timeOut">请求超时时间</param>
/// <returns></returns>
[Obsolete("请在小程序模块Senparc.Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!")]
public static async Task<WxJsonResult> DelAsync(string accessToken, string templateId, int timeOut = Config.TIME_OUT)
{
string urlFormat = Config.ApiMpHost + "/cgi-bin/wxopen/template/del?access_token={0}";
var data = new
{
template_id = templateId
};
return await CommonJsonSend.SendAsync<WxJsonResult>(accessToken, urlFormat, data, timeOut: timeOut);
throw new WeixinObsoleteException("Weixin.WxOpen.AdvancedAPIs.TemplateApi下调用同名接口!");
}


#endregion


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ and limitations under the License.
using System.Threading.Tasks;
using Senparc.Weixin.Entities;
using Senparc.Weixin.HttpUtility;
using Senparc.Weixin.WxOpen.AdvancedAPIs.Template.TemplateJson;

namespace Senparc.Weixin.WxOpen.AdvancedAPIs.Sns
{
Expand Down
Loading