in progress
This commit is contained in:
24
sms.go
Normal file
24
sms.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package smsc
|
||||
|
||||
const (
|
||||
UrlSMS = "https://smsc.ru/rest/send/"
|
||||
)
|
||||
|
||||
type RequestSMS struct {
|
||||
ApiKey string `json:"apikey"`
|
||||
Phone string `json:"phones"`
|
||||
Message string `json:"mes"`
|
||||
}
|
||||
|
||||
type ResponseSMS struct {
|
||||
Response
|
||||
ID int `json:"id"`
|
||||
Cnt int `json:"cnt"`
|
||||
}
|
||||
|
||||
func SendSMS(req RequestSMS) (resp ResponseSMS) {
|
||||
if err := requestPost(UrlSMS, req, &resp); err != nil {
|
||||
resp.Error = err.Error()
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user