【cs服务】
1、初始化 2、新增faq获取
This commit is contained in:
parent
7e664f3f29
commit
abb6cc61fb
30
services/cs/client.go
Normal file
30
services/cs/client.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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
|
||||||
|
}
|
26
services/cs/client_test.go
Normal file
26
services/cs/client_test.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package cs
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客服工单服务,单元测试
|
||||||
|
*/
|
||||||
|
|
||||||
|
func TestGetFaq(t *testing.T) {
|
||||||
|
client, newErr := NewClient()
|
||||||
|
if newErr != nil {
|
||||||
|
panic(newErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
req := CreateGetFaqRequest()
|
||||||
|
info, err := client.GetFaq(req)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("%+v", info)
|
||||||
|
}
|
48
services/cs/faq.go
Normal file
48
services/cs/faq.go
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user