Git Product home page Git Product logo

alidayu's Introduction

阿里大于 golang-SDK

无意间看大阿里大于被整合进了阿里云
然后就去看了眼文档,惊呆了!最新的阿里大于API版本是2017-05-25
旧的SDK虽然没停但我感觉也差不多了,最近又在学习golang,就用golang照着官方的示例写了一个新版的SDK

功能列表

  • 短信发送

下载

go get github.com/holdno/alidayu

快速使用

短信发送示例

package main

import (
	dayu "github.com/holdno/alidayu"
	"fmt"
)

func main() {
	userInput := &dayu.UserParams{
		AccessKeyId:   "阿里云的AccessKeyId",
		AppSecret:     "阿里云的AppSecret",
		PhoneNumbers:  "接收短信的手机号码",
		SignName:      "审核通过的签名,直接写名称",
		TemplateCode:  "审核通过的模板号",
		 // 模板变量赋值,一定是json格式,注意转义
		TemplateParam: "{\"code\": \"123456\"}",
	}
	ok, msg, err := dayu.SendMessage(userInput)
	if ok {
		fmt.Println("短信发送成功")
	} else {
	    // 根据业务进行错误处理
		fmt.Println(msg, err)
	}
}

alidayu's People

Contributors

holdno avatar

Stargazers

young_zkc avatar AaronZz avatar  avatar  avatar

Watchers

James Cloos avatar

Forkers

noxue

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.