haiwai-common-sdk-go/services/www/client.go

57 lines
1.3 KiB
Go
Raw Permalink Normal View History

2023-02-21 20:46:05 +08:00
package www
import (
2023-02-21 20:58:53 +08:00
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
2023-02-21 20:46:05 +08:00
)
const (
2023-03-16 20:15:17 +08:00
VERSION = "2023-03-16"
KEY = "gaore!@#apisdk"
2023-02-21 20:46:05 +08:00
)
var HOST requests.Host = requests.Host{
2023-03-16 20:15:17 +08:00
Default: "apisdk.gaore.com.hk",
Func: func(s string, area string) string {
defHost := "apisdk.gaore.com"
if area != "" {
return defHost + "." + area
2023-02-21 20:46:05 +08:00
}
2023-03-16 20:15:17 +08:00
return ""
2023-02-21 20:46:05 +08:00
},
}
type Client struct {
sdk.Client
}
func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAccessKey(accesskey, secrect, source)
return
}
func NewClientWithAliAppcode(accesskey, secrect string, env ...string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAliAppcode(accesskey, secrect, env...)
return
}
func (c *Client) GetUserInfo(req *GetPwdRequest) (response *GetPwdResponse, err error) {
response = CreateGetPwdResponse()
err = c.DoAction(req, response)
return
}
2023-03-16 20:15:17 +08:00
func (c *Client) UpdateAdjustId(req *UpdateAdjustIdRequest) (resp *UpdateAdjustIdResponse, err error) {
resp = CreateUpdateAdjustIdResponse()
err = c.DoAction(req, resp)
return
}
func NewClient(area string, env ...string) (client *Client, err error) {
client = new(Client)
err = client.InitWithArea(area, env...)
return
}