Giter VIP home page Giter VIP logo

chuanglan253.net's Introduction

创蓝短信API文档

.NET Standard 2.0 框架

  • 面向接口,对依赖注入友好
  • 同步,异步方法

入门

安装nuget包

Install-Package ChuangLanSms

简单使用

var smsManager = new ChuangLanSmsManager(new ChuangLanOptions()
{
    Account = "Account",
    Password = "Password",
    SignName = "【SignName】",
    Host = "Host"
} );

await smsManager.SendAsync(new SingleSms()
{
    Msg = "验证码{$var},您正在注册成为新用户,感谢您的支持!",
    Params = "18611223344,123456"
});

依赖注入

//依赖注入
var services = new ServiceCollection()
        .AddSingleton(new ChuangLanOptions()
        {
            Account = "Account",
            Password = "Password",
            SignName = "SignName",
            Host = "Host"
        })
        .AddTransient<IChuangLanSmsManager, ChuangLanSmsManager>()
        .BuildServiceProvider();

var sms = services.GetService<IChuangLanSmsManager>();

var res = await sms.SendAsync(new SingleSms()
{
    Msg = "验证码{$var},您正在注册成为新用户,感谢您的支持!",
    Params = "18611223344,123456",
    Phone = "18611223344"
});
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);
}

具体参数介绍可参考创蓝文档

chuanglan253.net's People

Contributors

realliangshiwei avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

chuanglan253.net's Issues

子账户管理

  • 子账号添加
  • 子账号激活
  • 子账号查询
  • 子账号调拨
  • 子账号account_id查询
  • 子账号状态查询

短信接口

  • 发送普通短信
  • 发送变量短信
  • 批量发送普通短信
  • 批量发送变量短信
  • 余额查询接口
  • 拉取上行明细
  • 拉取状态报告

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.