MSDev.PddOpenSdk 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MSDev.PddOpenSdk --version 0.2.0                
NuGet\Install-Package MSDev.PddOpenSdk -Version 0.2.0                
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" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MSDev.PddOpenSdk --version 0.2.0                
#r "nuget: MSDev.PddOpenSdk, 0.2.0"                
#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.
// Install MSDev.PddOpenSdk as a Cake Addin
#addin nuget:?package=MSDev.PddOpenSdk&version=0.2.0

// Install MSDev.PddOpenSdk as a Cake Tool
#tool nuget:?package=MSDev.PddOpenSdk&version=0.2.0                

说明文档

Build status NuGet NuGet Join the chat at https://gitter.im/open-pdd-net-sdk/Lobby

open-pdd-net-sdk,拼多多开放平台 DotNet SDK。

特别说明

当前拼多多文档已较完善,本SDK版本对应的nuget包还未更新,1.0版本会同步最新改动。当前版本建议直接拉取源代码进行使用。

遇到任何问题可通过底部联系方式反馈,作者会第一时间进行处理!

更新说明

V0.2.0

  • 添加完善新接口,同步到官方最新。
  • 完善所有请求和返回类,新增新接口所需类型。
  • 处理某种情况下签名错误的问题。

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));
}

所有方法名与官方文档保持一致,并有中文注释提醒,只是更改了命名规范,非常容易查找使用。

已知问题

由于拼多多官方文档中存在一些问题,可能会有一些返回模型是有问题的,无法正确解析到类型,导致没有正确返回数据!遇到这类问题,可直接修改源代码,提交代码合并申请;或者直接找作者反馈。

问题反馈

欢迎通过以下方式反馈问题:

Product 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MSDev.PddOpenSdk:

Package Downloads
MSDev.PddOpenSdk.AspNetCore

拼多多SDK ASP.NET Core依赖包

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.10 104 10/12/2024
8.0.5 182 5/9/2024
8.0.4 153 4/16/2024
8.0.3 144 4/12/2024
8.0.2 139 4/10/2024
8.0.1 120 4/10/2024
8.0.0 234 1/9/2024
7.0.2 311 6/20/2023
7.0.1 175 6/16/2023
7.0.0 412 3/17/2023
7.0.0-rc 175 2/6/2023
6.0.3 989 7/9/2022
6.0.2 597 5/12/2022
6.0.1 556 5/8/2022
6.0.0 639 2/27/2022
6.0.0-rc 260 12/10/2021
2.4.4 751 9/26/2021
2.4.3 512 8/11/2021
2.4.2 507 7/19/2021
2.4.1 494 7/19/2021
2.4.0 583 7/19/2021 2.4.0 is deprecated because it has critical bugs.
2.3.2 896 6/20/2021
2.3.1 479 6/9/2021
2.3.0 560 4/26/2021
2.3.0-beta 331 2/25/2021
2.2.0-beta 326 12/14/2020
2.1.0 773 10/15/2020
2.0.0 789 9/14/2020 2.0.0 is deprecated because it has critical bugs.
1.1.9 873 10/8/2019
1.1.8 562 7/17/2019
1.1.7 676 7/15/2019
1.1.6 764 5/29/2019
1.1.5 719 5/12/2019
1.1.4 767 4/7/2019
1.1.0 610 3/19/2019
1.0.4 750 3/12/2019
1.0.2 773 2/25/2019
1.0.0 828 1/10/2019
0.2.0 895 11/12/2018
0.1.1 5,342 9/30/2018
0.1.0-CI-20180929-054251 685 9/29/2018
0.0.1 908 9/27/2018

拼多多SDK核心类库
已更新同步到最新!