Compare commits
No commits in common. "master" and "v1.2.70" have entirely different histories.
@ -164,10 +164,3 @@ func (c *Client) GetGamePayAmount(req *GetGamePayAmountReq) (resp *GetGamePayAmo
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
// KafkaEvent 通用推入kafka数据
|
||||
func (c *Client) KafkaEvent(req *KafkaEventReq) (resp *KafkaEventResp, err error) {
|
||||
resp = CreateKafkaEventResp()
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
@ -378,27 +378,3 @@ func TestGetGamePayAmount(t *testing.T) {
|
||||
t.Errorf("GetGamePayAmount failed: code=%d msg=%s", resp.Code, resp.Msg)
|
||||
}
|
||||
}
|
||||
|
||||
func TestKafkaEvent(t *testing.T) {
|
||||
client, err := NewClient()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req := CreateKafkaEventReq(map[string]any{
|
||||
"topic": "test_lebian_sop_event",
|
||||
"event_name": "测试数据",
|
||||
"event_data": map[string]any{},
|
||||
})
|
||||
|
||||
resp, err := client.KafkaEvent(req)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Println(resp.Code, resp.Msg)
|
||||
|
||||
// 成功码为 1
|
||||
if resp.Code != 1 {
|
||||
t.Errorf("TestKafkaEvent failed: code=%d msg=%s", resp.Code, resp.Msg)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
package stat
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type KafkaEventReq = requests.JsonRequest
|
||||
|
||||
type KafkaEventResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
||||
func CreateKafkaEventReq(param map[string]any) *KafkaEventReq {
|
||||
req := &requests.JsonRequest{}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/event_track/kafka")
|
||||
req.Method = requests.POST
|
||||
req.JsonParams = param
|
||||
return req
|
||||
}
|
||||
|
||||
func CreateKafkaEventResp() *KafkaEventResp {
|
||||
return &KafkaEventResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user