feat(cs): 添加获取人工客服链接游戏配置功能
- 新增 GetLinkGameConfig 方法用于获取人工客服链接和游戏配置
This commit is contained in:
		
							parent
							
								
									ab3c9f33d0
								
							
						
					
					
						commit
						743883792d
					
				@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										45
									
								
								services/cs/config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								services/cs/config.go
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user