DNS.OpenSDK 1.0.0

dotnet add package DNS.OpenSDK --version 1.0.0                
NuGet\Install-Package DNS.OpenSDK -Version 1.0.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="DNS.OpenSDK" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DNS.OpenSDK --version 1.0.0                
#r "nuget: DNS.OpenSDK, 1.0.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 DNS.OpenSDK as a Cake Addin
#addin nuget:?package=DNS.OpenSDK&version=1.0.0

// Install DNS.OpenSDK as a Cake Tool
#tool nuget:?package=DNS.OpenSDK&version=1.0.0                

DotNetStar.OpenSDK

是一个开源的、轻便型、易扩展并集成各大开放平台的 SDK,不仅可以直接使用,还可以根据自己的需要快速定制符合自己需求的 SDK。

特点

  • 完全即可使用,无须任何配置;
  • 独创路径导航法,无须查阅文档就可以知道在哪使用;
  • 采用强类型参数和返回值,无须思考就可以知道有哪些内容;
  • 扩展自己的 SDK 只需要2步,上手难度几乎为零;
  • 支持异步,提升性能,支持并发;
  • 支持 .NET Framework 4.6.1+/.NET Core 2.0+/.NET Standard 2.0+
必须使用 VS2017 打开项目,并装好 .NET Core 2.0 的 SDK。

在线安装(v1.0)

Install-Package DNS.OpenSDK -version 1.0

路径导航

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

示例

  • QQ 互联

      OAuthConfig config = new OAuthConfig("appId", "appKey", "回调地址 url");
    
      //生成 qq 登录的链接
      var link = SDK.Use.QQConnect().GenerateAuthorizeCodeUrl(new QQAuthorizeCodeApiRequest(config));
    
      var code = "获得的 code";
      var response = await SDK.Use.QQConnect().GetAccessTokenAsync(config, code);
      //直接使用属性即可获得 access_token
      // response.Access_Token 
      // response.Expires_In
      // response.Refresh_Token
    
  • 微信登录

      OAuthConfig config = new OAuthConfig("appId", "appKey", "授权回调地址");
      //生成微信登录的二维码 url
      SDK.Use.WeChat().GenerateWeChatQrCodeAuthorizeLink(new WeChatQrCodeAuthorizeCodeApiRequest(config));
    
      //生成在微信客户端进行登录的链接 url
      SDK.Use.WeChat().GenerateWeChatAuthorizeLink(new WeChatAuthorizeCodeApiRequest(config))
    
  • 微信公众号

      //获取微信公众号的用户信息
      SDK.Use.WeChat().MP().GetUserInfoAsync(new UserInfoApiRequest(accessToken, openId))
    
  • 微信支付

      PaymentConfig config = new PaymentConfig("appId", "商户号", "密钥");
      SDK.Use.WeChat().Pay().UnifiedOrderAsync(new UnifiedOrderApiRequest(config)
    {
        Out_Trade_No = orderNo,
        Spbill_Create_Ip = "1.2.3.4",
        Body = "test",
        Total_Fee = 15000,
        Notify_Url = "http://abc",
        Trade_Type = TradeTypes.NATIVE
    })
    

如何开始?

用的不爽的点这里!!

SDK 已集成的开放平台和 api 列表(v1.0)

  • QQ互联(QQConnect)官网
    • 生成 QQ 登录的 url(GenerateAuthorizeCodeUrl)
    • 获取 access_token (GetAccessTokenAsync)
    • 获取 OpenId (GetOpenIdAsync)
    • 获取用户在QQ空间的个人信息(GetUserInfoAsync)
    • 获取QQ会员的基本信息(GetVipInfoAsync)
    • 获取QQ会员的高级信息(GetVipRichInfoAsync)
    • 获取QQ空间的相册列表(GetAlbumListAsync)
    • 获取QQ空间指定的相册照片列表(GetAlbumPhotoListAsync)
  • 微信(WeChat)
    • 开放平台(Open)官网
      • 生成可以再网页端进行微信登录的二维码链接(GenerateWeChatQrCodeAuthorizeLink)
      • 生成可在微信客户端进行登录授权的 url 链接(GenerateWeChatAuthorizeLink)
      • 获取微信应用的 access_token(GetClientAccessTokenAsync)
      • 获取微信的 access_token (GetAccessTokenAsync)
      • 刷新 access token 令牌(RefreshAccessTokenAsync)
    • 公众号(MP)官网
      • 获取微信服务器的 Ip 列表(GetIpListAsync)
      • 获取指定用户的信息(GetUserInfoAsync)
      • 获取关注公众号的用户列表(GetUserListAsync)
      • 生成带参数的二维码(GenerateQrCodeAsync)
      • 将指定的长链接转换成短链接(ToShortUrlAsync)
    • 支付(Pay)官网
      • 统一下单(UnifiedOrderAsync)
      • 订单查询(OrderQueryAsync)
      • 关闭订单(CloseOrderAsync)
      • 申请退款(RefundAsync)
      • 退款查询(RefundQueryAsync)

MIT

  • 请符合 MIT 协议并保留原作者版权;
  • 你必须在你的发行版里包含原许可协议的声明;

Copyright © 周大侠 2017-2018

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

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
1.0.0 1,098 12/12/2017
1.0.0-preview 839 12/8/2017

* 微信公众号
   * 【新增】 GenerateQrCodeAsync 方法
   * 【新增】 ToShortUrlAsync 方法
* SDK
   * 【新增】UrlEncode 对 url 编码
   * 【新增】UrlDecode 对 url 解码
   * 【新增】Serialize 对象序列化成 json 字符串
   * 【新增】Deserialize json 反序列化成对象
* 其他
   * 【更正】AppConfig -> ClientConfig
   * 【更正】FormUrlEncodedHttpContentTypeAttribute -> FormUrlEncodedAttribute
   * 【更正】ApplicationJsonHttpContentTypeAttribute -> ApplicationJsonAttribute
   * 【新增】Singleton 类型