https://github.com/qinxin0720/alisms-go
阿里云短信平台SDK Go语言实现
https://github.com/qinxin0720/alisms-go
dysms
Last synced: 30 days ago
JSON representation
阿里云短信平台SDK Go语言实现
- Host: GitHub
- URL: https://github.com/qinxin0720/alisms-go
- Owner: qinxin0720
- License: mit
- Created: 2018-04-27T06:47:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-01T03:56:47.000Z (over 6 years ago)
- Last Synced: 2024-06-20T18:22:55.307Z (12 months ago)
- Topics: dysms
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 11
- Watchers: 0
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 阿里云短信平台SDK Go语言实现
## DEMO
```go
package mainimport (
"github.com/qinxin0720/alisms-go/SmsClient"
"net/http"
"log"
)const (
accessKeyId = "yourAccessKeyId"
secretAccessKey = "yourAccessKeySecret"
)func main() {
sc, err := SmsClient.NewSMSClient(accessKeyId, secretAccessKey)
if err != nil {
return
}
statusCode, _, _ := sc.SendSMS(SmsClient.Params{"1500000000", "阿里云短信", "SMS_000000", `{"code":"12345"}`})
if statusCode == http.StatusOK {
log.Println("发送成功")
} else {
log.Println("发送失败")
}
}
```