ChuangLanSms 1.1.0
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 ChuangLanSms --version 1.1.0
NuGet\Install-Package ChuangLanSms -Version 1.1.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="ChuangLanSms" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChuangLanSms --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ChuangLanSms, 1.1.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 ChuangLanSms as a Cake Addin #addin nuget:?package=ChuangLanSms&version=1.1.0 // Install ChuangLanSms as a Cake Tool #tool nuget:?package=ChuangLanSms&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
创蓝短信API文档
.NET Standard 2.0 框架
- 面向接口,对依赖注入友好
- 同步,异步方法
入门
安装nuget包
Install-Package ChuangLanSms
简单使用
var smsManager = new ChuangLanSmsManager(new ChuangLanOptions()
{
Account = "Account",
Password = "Password",
SignName = "【SignName】"
} );
await smsManager.SendAsync(new SingleSms()
{
Msg = "验证码{$var},您正在注册成为新用户,感谢您的支持!",
Params = "18611223344,123456"
});
依赖注入
//依赖注入
var services = new ServiceCollection()
.AddSingleton(new ChuangLanOptions()
{
Account = "Account",
Password = "Password",
SignName = "【SignName】"
})
.AddTransient<IChuangLanSmsManager, ChuangLanSmsManager>()
.BuildServiceProvider();
var sms = services.GetService<IChuangLanSmsManager>();
var res = await sms.SendAsync(new SingleSms()
{
Msg = "验证码{$var},您正在注册成为新用户,感谢您的支持!",
Params = "18611223344,123456"
});
Console.WriteLine("Hello World!");
短信Api
public interface IChuangLanSmsManager
{
/// <summary>
/// 单条发送
/// </summary>
/// <param name="sms"></param>
/// <returns></returns>
ApiSendSmsResultBase Send(SingleSms sms);
/// <summary>
/// 单条发送
/// </summary>
/// <param name="sms"></param>
/// <returns></returns>
Task<ApiSendSmsResultBase> SendAsync(SingleSms sms);
/// <summary>
/// 批量发送
/// </summary>
/// <param name="sms"></param>
/// <returns></returns>
ApiBatchSmsResult BatchSend(BatchSms sms);
/// <summary>
/// 批量发送
/// </summary>
/// <param name="sms"></param>
/// <returns></returns>
Task<ApiBatchSmsResult> BatchSendAsync(BatchSms sms);
/// <summary>
/// 余额查询
/// </summary>
/// <returns></returns>
ApiBalanceResult Balance();
/// <summary>
/// 余额查询
/// </summary>
/// <returns></returns>
/// <returns></returns>
Task<ApiBalanceResult> BalanceAsync();
/// <summary>
/// 拉取上行明细接口
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
ApiPullMoResult PullMo(ApiPullMo input);
/// <summary>
/// 拉取上行明细接口
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<ApiPullMoResult> PullMoAsync(ApiPullMo input);
/// <summary>
/// 拉取状态报告
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
ApiPullReportResult PullReport(ApiPullReport input);
/// <summary>
/// 拉取状态报告
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<ApiPullReportResult> PullReportAsync(ApiPullReport input);
}
具体参数介绍可参考创蓝文档
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. |
.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.
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.2)
- Nito.AsyncEx.Context (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.