You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
552 B
Go

package http
import (
"bytes"
)
const (
smsSendUrl = "/api/sendUrl"
)
type MsgRes struct {
State int `json:"state"`
Msg string `json:"msg"`
}
type MsgReq struct {
Code string `json:"code"`
Msg string `json:"msg"`
}
func (c *Client) SubmitPhoneCodeRequest(req *MsgReq) (*MsgRes, error) {
body, err := json2.Marshal(req)
if err != nil {
return nil, err
}
resp := &MsgRes{}
logger.Info("request " + smsSendUrl + "\t:" + string(body))
return resp, c.getParsedResponse("POST", smsSendUrl, jsonHeader, bytes.NewReader(body), resp)
}