getui_sms2
This commit is contained in:
parent
272f7889b2
commit
62c6809a93
|
@ -78,7 +78,7 @@ func (g *GetuiSms) Token() string {
|
||||||
return g.token
|
return g.token
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GetuiSms) Send(phone string, data map[string]string) error {
|
func (g *GetuiSms) Send(phone string, data map[string]string) (interface{}, error) {
|
||||||
|
|
||||||
reqUrl := "https://openapi-smsp.getui.com/v1/sps/push_sms_list"
|
reqUrl := "https://openapi-smsp.getui.com/v1/sps/push_sms_list"
|
||||||
params := make(map[string]interface{})
|
params := make(map[string]interface{})
|
||||||
|
@ -91,14 +91,14 @@ func (g *GetuiSms) Send(phone string, data map[string]string) error {
|
||||||
rspBody, err := HttpPostJson(reqUrl, nil, reqBody)
|
rspBody, err := HttpPostJson(reqUrl, nil, reqBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("http post [%s] error :%s", string(reqBody), err.Error())
|
log.Errorf("http post [%s] error :%s", string(reqBody), err.Error())
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
fmt.Println(string(reqBody), string(rspBody))
|
fmt.Println(string(reqBody), string(rspBody))
|
||||||
_, err = g.getResult(rspBody)
|
_, err = g.getResult(rspBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("get Result error :%s", err.Error())
|
log.Errorf("get Result error :%s", err.Error())
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue