MSDev.PddOpenSdk.AspNetCore
0.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MSDev.PddOpenSdk.AspNetCore --version 0.1.1
NuGet\Install-Package MSDev.PddOpenSdk.AspNetCore -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MSDev.PddOpenSdk.AspNetCore" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MSDev.PddOpenSdk.AspNetCore" Version="0.1.1" />
<PackageReference Include="MSDev.PddOpenSdk.AspNetCore" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MSDev.PddOpenSdk.AspNetCore --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MSDev.PddOpenSdk.AspNetCore, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MSDev.PddOpenSdk.AspNetCore@0.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MSDev.PddOpenSdk.AspNetCore&version=0.1.1
#tool nuget:?package=MSDev.PddOpenSdk.AspNetCore&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
说明文档
V0.1beta
open-pdd-net-sdk,拼多多开放平台DotNet SDK。
遇到任何问题可通过底部联系方式反馈,作者会第一时间进行处理!
更新说明
V0.1beta
- 添加了仓储API
- 添加PddService相关接口字段属性的中文注释。
类库说明
支持基于NETStandardv2.0的项目。
ASP.NET Core项目请使用Nuget包 MSDev.PddOpenSdk.AspNetCore,可直接通过注入服务的方式使用。
其他类型使用Nuget包 MSDev.PddOpenSdk。
使用说明
ASP.NET Core 项目使用
可参考示例代码
- 在Startup.cs中注入服务
services.AddPdd(options =>
{
// 使用appsettings 配置你的ClientId等参数
options.ClientId = Configuration.GetSection("Pdd")["ClientId"];
options.CallbackUrl = Configuration.GetSection("Pdd")["RedirectUri"];
options.ClientSecret = Configuration.GetSection("Pdd")["ClientSecret"];
});
- 然后在控制器使用注入服务
readonly PddService _pdd;
public YourController(PddService pdd)
{
_pdd = pdd;
}
- 获取AccessToken
/// <summary>
/// 测试获取token
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
public async Task<IActionResult> Callback(string code)
{
var token = await _pdd.AuthApi.GetAccessTokenAsync(code);
// 自行维护Token过期时间
return Content(token.AccessToken);
}
调用其他接口
获取AccessToken之后才能正常调用其他接口。
public async Task<ActionResult> Test()
{
// 构造请求模型
var requestModel = new SearchDdkGoodsRequestModel
{
SortType = 0,
WithCoupon = false
};
// 调用相应接口方法
var result = await _pdd.DdkApi.SearchDdkGoodsAsync(requestModel);
return Content(JsonConvert.SerializeObject(result));
}
所有方法名与官方文档保持一致,并有中文注释提醒,只是更改了命名规范,非常容易查找使用。
已知问题
由于拼多多官方文档中存在一些问题,可能会有一些返回模型是有问题的,无法正确解析到类型,导致没有正确返回数据!遇到这类问题,可直接修改源代码,提交代码合并申请;或者直接找作者反馈。
问题反馈
欢迎通过以下方式反馈问题:
- 提交GitHub Issues(优先处理)
- Email: zpty@outlook.com
- QQ群:737822525
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.1
- Microsoft.Extensions.Configuration.FileExtensions (>= 2.1.1)
- Microsoft.Extensions.Configuration.Json (>= 2.1.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.1.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.1.1)
- MSDev.PddOpenSdk (>= 0.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 8.1.2 | 238 | 2/26/2025 | |
| 8.1.1 | 199 | 2/26/2025 | |
| 8.0.11 | 167 | 2/13/2025 | |
| 8.0.10 | 218 | 10/12/2024 | |
| 8.0.5 | 245 | 5/9/2024 | |
| 8.0.4 | 240 | 4/16/2024 | |
| 8.0.3 | 191 | 4/12/2024 | |
| 8.0.2 | 184 | 4/10/2024 | |
| 8.0.1 | 201 | 4/10/2024 | |
| 8.0.0 | 281 | 1/9/2024 | |
| 7.0.2 | 357 | 6/20/2023 | |
| 7.0.1 | 267 | 6/16/2023 | |
| 7.0.0 | 480 | 3/17/2023 | |
| 7.0.0-rc | 274 | 2/6/2023 | |
| 6.0.3 | 990 | 7/9/2022 | |
| 6.0.2 | 603 | 5/12/2022 | |
| 6.0.1 | 550 | 5/8/2022 | |
| 6.0.0 | 613 | 2/27/2022 | |
| 6.0.0-rc | 362 | 12/10/2021 | |
| 2.4.4 | 831 | 9/26/2021 | |
| 2.4.3 | 488 | 8/11/2021 | |
| 2.4.2 | 517 | 7/19/2021 | |
| 2.4.1 | 548 | 7/19/2021 | |
| 2.4.0 | 835 | 7/19/2021 | |
| 2.3.5 | 826 | 7/15/2021 | |
| 2.3.4 | 754 | 7/12/2021 | |
| 2.3.3 | 575 | 6/21/2021 | |
| 2.3.2 | 719 | 6/21/2021 | |
| 2.3.1 | 556 | 6/9/2021 | |
| 2.3.0 | 596 | 4/26/2021 | |
| 2.3.0-beta | 433 | 2/25/2021 | |
| 2.2.0-beta | 464 | 12/14/2020 | |
| 2.1.0 | 649 | 10/15/2020 | |
| 2.0.0 | 891 | 9/14/2020 | |
| 1.1.9 | 815 | 10/8/2019 | |
| 1.1.7 | 729 | 7/15/2019 | |
| 1.1.6 | 771 | 5/29/2019 | |
| 1.1.5 | 763 | 5/12/2019 | |
| 1.1.4 | 777 | 4/7/2019 | |
| 1.0.4 | 789 | 3/12/2019 | |
| 1.0.2 | 794 | 2/25/2019 | |
| 1.0.0 | 867 | 1/10/2019 | |
| 0.2.0 | 954 | 11/12/2018 | |
| 0.1.1 | 5,386 | 9/30/2018 | |
| 0.1.0-CI-20180929-054251 | 826 | 9/29/2018 | |
| 0.0.1 | 966 | 9/27/2018 |
拼多多SDK ASP.NET Core依赖包