Compare commits
No commits in common. "6bfb0c851c99387491ae4c5f04553546522e1b64" and "fd416818994bda83dee9abb65611fe832f8b6c1f" have entirely different histories.
6bfb0c851c
...
fd41681899
@ -1,29 +0,0 @@
|
||||
|
||||
|
||||
### 发送短信调用示例
|
||||
```go
|
||||
import (
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/services/jedi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c, err := jedi.NewClientWithAccessKey("accessKeyId", "accessKeySecret", "xxx.xxx.com")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
req := jedi.CreateSendSmsRequest()
|
||||
// sso统一用户名uid, 多个用户用逗句隔开
|
||||
req.User = "liangzy,liaoks"
|
||||
// 公共模板的代码模板
|
||||
req.Code = "d7kt5IwP"
|
||||
// 模板参数,模板里有多少个模板参数就传入几个替换字符串,
|
||||
req.ParamsArray = []string{"www", "线上", "好人"}
|
||||
if resp, err := c.SendSms(req); err == nil {
|
||||
grlogs.Informational(fmt.Sprintf("%+v", resp.GetHttpContentString()))
|
||||
} else {
|
||||
grlogs.Error(err)
|
||||
}
|
||||
}
|
||||
```
|
@ -1,9 +1,6 @@
|
||||
package jedi
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"strings"
|
||||
)
|
||||
import "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
|
||||
const (
|
||||
HOST = "jedi"
|
||||
@ -15,9 +12,6 @@ type Client struct {
|
||||
}
|
||||
|
||||
func (c *Client) SendSms(req *SendSmsRequest) (response *SendSmsResponse, err error) {
|
||||
if req.ParamsArray != nil && len(req.ParamsArray) > 0 {
|
||||
req.Params = strings.Join(req.ParamsArray, ",,,")
|
||||
}
|
||||
response = CreateSendSmsResponse()
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
|
@ -10,7 +10,6 @@ type SendSmsRequest struct {
|
||||
User string `position:"Query" field:"user" default:"" `
|
||||
Code string `position:"Query" field:"code" default:"" `
|
||||
Params string `position:"Query" field:"params" default:"" `
|
||||
ParamsArray []string
|
||||
}
|
||||
|
||||
type SendSmsResponseData struct {
|
||||
|
Loading…
Reference in New Issue
Block a user