7
0

Merge remote-tracking branch 'origin/master'

This commit is contained in:
liaokaishan 2022-04-18 10:46:58 +08:00
commit 5f942571eb
4 changed files with 97 additions and 43 deletions

View File

@ -0,0 +1,48 @@
package callback
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
)
const (
VERSION = "2021-11-30"
)
var HOST requests.Host = requests.Host{
Default: "callback.api.gaore.com",
Func: func(s string) string {
var a = map[string]string{
requests.RELEASE: "callback.api.gaore.com",
requests.PRE: "callback.api.gaore.com",
requests.TEST: "callback.api.gaore.com",
}
return a[s]
},
}
type Client struct {
sdk.Client
}
func NewClient() (client *Client) {
client = &Client{}
client.InitWithAccessKey("", "", "")
return
}
//上报关键行为
func (c *Client) SendAction(req *SendActionRequest) (response *SendActionResponse, err error) {
response = CreateSendActionResponse()
err = c.DoAction(req, response)
return
}
// 上报激活
func (c *Client) SendActive() {
}
// 上报付费
// 上报注册

View File

@ -0,0 +1,49 @@
package callback
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
const OS_ANDROID = 2
const OS_IOS = 1
type SendActionRequest struct {
*requests.RpcRequest
GameId int64 `position:"Query" field:"game_id" default:"" `
AgentId int64 `position:"Query" field:"agent_id" default:"" `
SiteId int64 `position:"Query" field:"site_id" default:"" `
Imei string `position:"Query" field:"imei" default:"" `
Oaid string `position:"Query" field:"oaid" default:"" `
Ip string `position:"Query" field:"ip" default:"" `
Ua string `position:"Query" field:"ua" default:"" `
Os int `position:"Query" field:"os" default:"" `
ParamsArray []string
}
type SendActionResponseData struct {
Account string `json:"account"`
Total int `json:"total"`
}
type SendActionResponse struct {
*responses.BaseResponse
Data SendActionResponseData `json:"data"`
}
func CreateSendActionRequest() (req *SendActionRequest) {
req = &SendActionRequest{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/callback/ads_callback/sendAction")
req.Method = requests.GET
return
}
func CreateSendActionResponse() (response *SendActionResponse) {
response = &SendActionResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}

View File

@ -35,12 +35,6 @@ func (c *Client) SendSms(req *SendSmsRequest) (response *SendSmsResponse, err er
return
}
func (c *Client) Test(req *DemoTestRequest) (response *DemoTestResponse, err error) {
response = CreateDemoTestResponse()
err = c.DoAction(req, response)
return
}
func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAccessKey(accesskey, secrect, source)

View File

@ -1,37 +0,0 @@
package jedi
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type DemoTestRequest struct {
*requests.RpcRequest
Param1 string `position:"Query" field:"param_1" default:"" `
Param2 int `position:"Query" field:"param_2" default:"10086" `
Param3 bool `position:"Query" field:"param_3" default:"false" `
ParamBody string `position:"Body" field:"param_body" default:"foobar" `
}
func CreateDemoTestRequest() (req *DemoTestRequest) {
req = &DemoTestRequest{RpcRequest: &requests.RpcRequest{}}
req.InitWithApiInfo(HOST, VERSION, "/api/sms/Index")
req.Method = requests.POST
return
}
type DemoTestResponse struct {
*responses.BaseResponse
Data DemoTestResponseData `json:"data"`
}
type DemoTestResponseData struct {
Account string `json:"account"`
Total int `json:"total"`
}
func CreateDemoTestResponse() *DemoTestResponse {
return &DemoTestResponse{
BaseResponse: &responses.BaseResponse{},
}
}