コード例 #1
0
ファイル: main.go プロジェクト: gogap/luosimao
func sms_status() {
	sender := luosimao.NewSMSSender(smsAuth, luosimao.JSON)
	resp, err := sender.Status(1000)
	if err != nil {
		fmt.Println(err.Error())
	} else {
		b, _ := json.Marshal(resp)
		fmt.Println(string(b))
		fmt.Println(resp.ErrorDescription())
	}
}
コード例 #2
0
ファイル: main.go プロジェクト: gogap/luosimao
func send_sms_batch(mobiles string, message string) {
	sender := luosimao.NewSMSSender(smsAuth, luosimao.JSON)
	resp, err := sender.BatchSend(luosimao.BatchSMSRequest{MobileList: mobiles, Message: message, Time: ""}, 1000)
	if err != nil {
		fmt.Println(err.Error())
	} else {
		b, _ := json.Marshal(resp)
		fmt.Println(string(b))
		fmt.Println(resp.ErrorDescription())
	}
}
コード例 #3
0
ファイル: main.go プロジェクト: gogap/luosimao
func send_sms(mobile, message string) {
	sender := luosimao.NewSMSSender(smsAuth, luosimao.JSON)
	resp, err := sender.Send(luosimao.SMSRequest{Mobile: mobile, Message: message}, 1000)
	if err != nil {
		fmt.Println(err.Error())
	} else {
		b, _ := json.Marshal(resp)
		fmt.Println(string(b))
		fmt.Println(resp.ErrorDescription())
	}
}