7
0
gaore-common-sdk-go/services/jedi/client.go

43 lines
991 B
Go
Raw Normal View History

2020-08-03 20:48:58 +08:00
package jedi
2020-08-11 18:16:37 +08:00
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
"strings"
)
2020-08-03 20:48:58 +08:00
2020-08-04 12:23:34 +08:00
const (
HOST = "jedi.oapi.gaore.com"
2020-08-04 12:23:34 +08:00
VERSION = "2020-08-04"
)
2020-08-03 20:48:58 +08:00
type Client struct {
sdk.Client
}
2020-08-04 12:23:34 +08:00
func (c *Client) SendSms(req *SendSmsRequest) (response *SendSmsResponse, err error) {
2020-08-11 18:16:37 +08:00
if req.ParamsArray != nil && len(req.ParamsArray) > 0 {
req.Params = strings.Join(req.ParamsArray, ",,,")
}
2020-08-04 12:23:34 +08:00
response = CreateSendSmsResponse()
err = c.DoAction(req, response)
return
}
2020-08-06 16:04:44 +08:00
func (c *Client) Test(req *DemoTestRequest) (response *DemoTestResponse, err error) {
response = CreateDemoTestResponse()
err = c.DoAction(req, response)
return
}
2020-08-04 12:23:34 +08:00
func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) {
client = &Client{}
2020-08-04 21:14:06 +08:00
err = client.InitWithAccessKey(accesskey, secrect, source)
2020-08-04 12:23:34 +08:00
return
2020-08-03 20:48:58 +08:00
}
func NewClientWithAliAppcode(accesskey, secrect string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAliAppcode(accesskey, secrect)
return
}