From 743883792d36d42a594f9f8d1d3f618226ef3692 Mon Sep 17 00:00:00 2001 From: liguanjie Date: Thu, 11 Sep 2025 11:49:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(cs):=20=E6=B7=BB=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=BA=BA=E5=B7=A5=E5=AE=A2=E6=9C=8D=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 GetLinkGameConfig 方法用于获取人工客服链接和游戏配置 --- services/cs/client.go | 6 +++++ services/cs/client_test.go | 20 +++++++++++++++++ services/cs/config.go | 45 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 services/cs/config.go diff --git a/services/cs/client.go b/services/cs/client.go index 6f38f3a..40e0d74 100644 --- a/services/cs/client.go +++ b/services/cs/client.go @@ -154,3 +154,9 @@ func (client *Client) ClearHotFaqCache(req *ClearHotFaqCacheRequest) (resp *Clea err = client.DoAction(req, resp) return } + +func (client *Client) GetLinkGameConfig(req *GetLinkGameConfigRequest) (resp *GetLinkGameConfigResponse, err error) { + resp = CreateGetLinkGameConfigResponse() + err = client.DoAction(req, resp) + return +} diff --git a/services/cs/client_test.go b/services/cs/client_test.go index 1ba4e16..1e5aca5 100644 --- a/services/cs/client_test.go +++ b/services/cs/client_test.go @@ -456,3 +456,23 @@ func TestClearHotFaqCache(t *testing.T) { } fmt.Printf(fmt.Sprintf("%v", res)) } + +// 获取人工客服链接,主体与游戏参数配置详情 +func TestGetLinkGameConfigDetail(t *testing.T) { + client, newErr := NewClient() + if newErr != nil { + panic(newErr) + } + req := CreateGetLinkGameConfigRequest(LinkGameConfigRequest{ + Company: "JJW", + }) + res, err := client.GetLinkGameConfig(req) + if err != nil { + t.Error(err) + return + } + if res.Code != 0 || res.Data.SubjectSign == "" { + t.Error("获取人工客服链接,主体与游戏参数配置详情失败") + } + fmt.Printf(fmt.Sprintf("%v", res.Data)) +} diff --git a/services/cs/config.go b/services/cs/config.go new file mode 100644 index 0000000..bb4764e --- /dev/null +++ b/services/cs/config.go @@ -0,0 +1,45 @@ +package cs + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +// 中旭人工客服链接,主体与游戏配置 + +type LinkGameConfig struct { + SubjectSign string `json:"subject_sign"` + SubjectName string `json:"subject_name"` + LinkGameId int64 `json:"link_game_id"` + CreatedAt string `json:"created_at"` +} +type GetLinkGameConfigRequest struct { + *requests.JsonRequest + Company string `position:"Json" field:"company"` +} +type GetLinkGameConfigResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data *LinkGameConfig `json:"data"` +} +type LinkGameConfigRequest struct { + Company string `json:"company"` +} + +func CreateGetLinkGameConfigRequest(param LinkGameConfigRequest) (req *GetLinkGameConfigRequest) { + req = &GetLinkGameConfigRequest{ + JsonRequest: &requests.JsonRequest{}, + Company: param.Company, + } + req.InitWithApiInfo(HOST, VERSION, "/v1/config/get_link_game_config") + + req.Method = requests.POST + return +} +func CreateGetLinkGameConfigResponse() (response *GetLinkGameConfigResponse) { + response = &GetLinkGameConfigResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}