YouzanYunOpenSDK 1.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 YouzanYunOpenSDK --version 1.1.1
NuGet\Install-Package YouzanYunOpenSDK -Version 1.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="YouzanYunOpenSDK" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YouzanYunOpenSDK --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: YouzanYunOpenSDK, 1.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.
// Install YouzanYunOpenSDK as a Cake Addin
#addin nuget:?package=YouzanYunOpenSDK&version=1.1.1
// Install YouzanYunOpenSDK as a Cake Tool
#tool nuget:?package=YouzanYunOpenSDK&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
YouZanYunOpenSDK(持续更新中...)
基于有赞云开放平台SDK源码封装的有赞云SDK
平台版本
.NET Standard 2.0+
1.正常调用
ApiHelper apiHelper = new ApiHelper("clientId", "clientSecret", grantId);
UsersAccountCheckRequest request = new UsersAccountCheckRequest();
request.AccountType = "Mobile";
request.AccountId = "13333333333";
YouZanResponse<bool> result = apiHelper.UsersAccountCheck(request);
2.数据库日志记录(支持Sql Server、Oracle、MySql)
需提前在数据库中创建日志表,表名自定义,默认为YouZanApiLogs,以SqlServer为例:
CREATE TABLE [dbo].[YouZanApiLogs] (
[Guid] varchar(50) NOT NULL,
[LogTime] datetime NOT NULL,
[ApiName] varchar(255) NOT NULL,
[ApiVersion] varchar(255) NOT NULL,
[ApiMethod] varchar(10) NOT NULL,
[AuthType] varchar(255) NOT NULL,
[RequestUrl] varchar(1000) NOT NULL,
[Header] varchar(1000) NOT NULL,
[PostData] ntext NOT NULL,
[ResponseData] ntext NOT NULL,
PRIMARY KEY CLUSTERED ([Guid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'Guid'
GO
EXEC sp_addextendedproperty
'MS_Description', N'日志时间',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'LogTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'Api名称',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'ApiName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'Api版本',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'ApiVersion'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求方式',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'ApiMethod'
GO
EXEC sp_addextendedproperty
'MS_Description', N'认证类型',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'AuthType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求地址',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'RequestUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求头',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'Header'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求参数',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'PostData'
GO
EXEC sp_addextendedproperty
'MS_Description', N'返回值',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs',
'COLUMN', N'ResponseData'
GO
EXEC sp_addextendedproperty
'MS_Description', N'有赞云API日志表',
'SCHEMA', N'dbo',
'TABLE', N'YouZanApiLogs'
GO
在程序启动的位置添加以下代码
YouZanLogConfig.IsDBLog = true; // 默认为false
YouZanLogConfig.DBConnectionString = "xxxxxxx"; // 默认为空
YouZanLogConfig.LogTableName = "YouZanApiLogs"; // 默认
YouZanLogConfig.DBType = YouZanLogDBType.SqlServer; // 默认
//YouZanLogConfig.DBType = YouZanLogDBType.Oracle;
//YouZanLogConfig.DBType = YouZanLogDBType.MySql;
3.Api调用凭证AccessToken记录(支持Sql Server、Oracle、MySql)
需提前在数据库中创建日志表,表名自定义,默认为YouZanAccessToken,以SqlServer为例:
CREATE TABLE [dbo].[YouZanAccessToken] (
[Key] varchar(255) COLLATE Chinese_PRC_CI_AS NOT NULL,
[TokenData] text COLLATE Chinese_PRC_CI_AS NOT NULL
)
GO
ALTER TABLE [dbo].[YouZanAccessToken] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'YouZanAccessToken',
'COLUMN', N'Key'
GO
EXEC sp_addextendedproperty
'MS_Description', N'AccessToken数据',
'SCHEMA', N'dbo',
'TABLE', N'YouZanAccessToken',
'COLUMN', N'TokenData'
GO
EXEC sp_addextendedproperty
'MS_Description', N'有赞AccessToken信息表',
'SCHEMA', N'dbo',
'TABLE', N'YouZanAccessToken'
GO
在程序启动的位置添加以下代码
YouZanTokenConfig.SaveToDb = true; // 默认为false
YouZanTokenConfig.DBConnectionString = "xxxxxxx"; // 默认为空
YouZanTokenConfig.TableName = "YouZanAccessToken"; // 默认
YouZanTokenConfig.DBType = DBType.SqlServer; // 默认
//YouZanTokenConfig.DBType = DBType.Oracle;
//YouZanTokenConfig.DBType = DBType.MySql;
请求参数
调用不同接口,使用不同的Request类,所有Request类都继承自YouZanRequest
响应参数
YouZanResponse<T>
NuGet程序包安装
PM> Install-Package YouzanYunOpenSDK -Version 1.1.1
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. |
.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.
-
- MySql.Data (>= 8.0.18)
- Newtonsoft.Json (>= 11.0.1)
- Oracle.ManagedDataAccess.Core (>= 2.19.50)
- System.Data.SqlClient (>= 4.7.0)
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.1.16 | 1,407 | 1/21/2022 |
1.1.15 | 1,157 | 1/20/2022 |
1.1.14 | 1,045 | 9/7/2021 |
1.1.13 | 988 | 9/6/2021 |
1.1.12 | 1,010 | 7/1/2021 |
1.1.11 | 963 | 6/28/2021 |
1.1.10 | 951 | 6/24/2021 |
1.1.9 | 1,027 | 6/18/2021 |
1.1.6 | 1,059 | 11/16/2020 |
1.1.5 | 1,085 | 11/13/2020 |
1.1.4 | 1,076 | 11/4/2020 |
1.1.3 | 1,098 | 11/4/2020 |
1.1.2 | 1,139 | 11/3/2020 |
1.1.1 | 1,141 | 11/3/2020 |
1.1.0 | 1,329 | 12/2/2019 |
1.0.9 | 989 | 11/13/2019 |
1.0.8 | 1,097 | 9/17/2019 |
Summary of changes made in this release of the package.