luksdk 0.0.13

dotnet add package luksdk --version 0.0.13
                    
NuGet\Install-Package luksdk -Version 0.0.13
                    
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="luksdk" Version="0.0.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="luksdk" Version="0.0.13" />
                    
Directory.Packages.props
<PackageReference Include="luksdk" />
                    
Project file
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 luksdk --version 0.0.13
                    
#r "nuget: luksdk, 0.0.13"
                    
#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.
#addin nuget:?package=luksdk&version=0.0.13
                    
Install as a Cake Addin
#tool nuget:?package=luksdk&version=0.0.13
                    
Install as a Cake Tool

介绍

本项目为 .Net 版本的 LukSDK,可直接引入使用,其中提供了需接入接口的通用实现,仅需结合业务逻辑将其返回即可。

仅需将 HTTP 请求转换为对应结构体后调用相关函数并填充返回值即可,关于参数的校验等行为交由 SDK 内部处理。

安装

.Net Core 4.8.1

dotnet add package luksdk

.Net Core Standard 2.0

dotnet add package luksdk-standard-2

示例代码

如果使用 .Net Core Standard 2.0,需要将引用 project_luksdk_dotnet 调整为 project_luksdk_dotnet_standard_2`

using System;
using System.Text.Json;
using project_luksdk_dotnet;

namespace ConsoleApplication1
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            // 初始化 SDK
            SDK sdk = new SDK("123456", "https://www.example.com");

            // 来自 SDK 请求的参数结构
            GetChannelTokenRequest request = new GetChannelTokenRequest();
            request.CId = 1000;
            request.CUid = "123456789";
            request.Timestamp = 167456789;
            request.Sign = sdk.GenerateSignature(request);

            // 处理请求
            Response<GetChannelTokenResponse> resp = sdk.GetChannelToken(request, r =>
            {
                GetChannelTokenResponse response = new GetChannelTokenResponse();
                response.Token = "token"; // 生成 Token
                response.LeftTime = 7200; // 设置 Token 过期时间

                return (response, null);
            });

            // 将 resp 作为 JSON 写入 HTTP 响应
            Console.WriteLine(JsonSerializer.Serialize(resp));
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET Framework net481 is compatible. 
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
0.0.13 77 12/2/2024
0.0.12 75 11/14/2024
0.0.11 74 10/31/2024
0.0.10 73 10/30/2024
0.0.9 71 10/30/2024
0.0.8 73 10/30/2024
0.0.7 72 10/30/2024
0.0.6 69 10/30/2024
0.0.5 76 10/30/2024
0.0.4 73 10/29/2024
0.0.3 74 10/29/2024
0.0.2 106 10/29/2024
0.0.1 104 10/29/2024

LUKSDK 是面向 LUKSDK 后台接入的 SDK 集成,用于帮助开发者快速接入 LUKSDK。