Compare commits
No commits in common. "b282de0a2f0df87b7d7a3a80efc90199fde0b18d" and "7e664f3f29b723b8e5c855c1ed65e99a1dd210ba" have entirely different histories.
b282de0a2f
...
7e664f3f29
@ -1,36 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
VERSION = "2025-06-10"
|
|
||||||
)
|
|
||||||
|
|
||||||
var HOST = requests.Host{
|
|
||||||
Default: "cs",
|
|
||||||
}
|
|
||||||
|
|
||||||
type Client struct {
|
|
||||||
sdk.Client
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewClient() (client *Client, err error) {
|
|
||||||
client = new(Client)
|
|
||||||
err = client.Init()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetFaq(req *GetFaqRequest) (resp *GetFaqResponse, err error) {
|
|
||||||
resp = CreateGetFaqResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetUserInfo(req *GetUserInfoRequest) (resp *GetUserInfoResponse, err error) {
|
|
||||||
resp = CreateGetUserInfoResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客服工单服务,单元测试
|
|
||||||
*/
|
|
||||||
|
|
||||||
// 获取faq树状数据
|
|
||||||
func TestGetFaq(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
|
|
||||||
req := CreateGetFaqRequest()
|
|
||||||
faq, err := client.GetFaq(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf(fmt.Sprintf("%#+v", faq))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取玩家基本信息
|
|
||||||
func TestGetUserInfo(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetUserInfoRequest("ws45265737")
|
|
||||||
info, err := client.GetUserInfo(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Faq 树状结构
|
|
||||||
type Faq struct {
|
|
||||||
Id int64 `json:"id"`
|
|
||||||
ParentId int64 `json:"parent_id"`
|
|
||||||
Title string `json:"title"`
|
|
||||||
Answer string `json:"answer"`
|
|
||||||
Type int64 `json:"type"`
|
|
||||||
WorkOrderTemplateId int64 `json:"work_order_template_id"`
|
|
||||||
CreatedAt string `json:"created_at"`
|
|
||||||
UpdatedAt string `json:"updated_at"`
|
|
||||||
ProcessFlow string `json:"process_flow"`
|
|
||||||
Children []*Faq `json:"children"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetFaqRequest struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetFaqResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data Faq `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetFaqRequest() (req *GetFaqRequest) {
|
|
||||||
req = &GetFaqRequest{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/faq/list")
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetFaqResponse() (response *GetFaqResponse) {
|
|
||||||
response = &GetFaqResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取玩家(用户)相关信息
|
|
||||||
*/
|
|
||||||
|
|
||||||
// UserInfo 用户信息
|
|
||||||
type UserInfo struct {
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
Uid int64 `json:"uid"`
|
|
||||||
Telephone string `json:"telephone"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserInfoRequest struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserInfoResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data UserInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserInfoRequest(userName string) (req *GetUserInfoRequest) {
|
|
||||||
req = &GetUserInfoRequest{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/info")
|
|
||||||
|
|
||||||
req.FormParams = map[string]string{
|
|
||||||
"user_name": userName,
|
|
||||||
}
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserInfoResponse() (response *GetUserInfoResponse) {
|
|
||||||
response = &GetUserInfoResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user