6
0
gaore-common-sdk-go/services/cs/faq.go
liguanjie eb25c8f20a 【cs服务】
1、新增热门faq获取
2025-06-20 11:41:24 +08:00

121 lines
2.9 KiB
Go

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
}
// FaqDetail Faq详情
type FaqDetail 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"`
ProcessFlow string `json:"process_flow"`
}
type GetFaqDetailRequest struct {
*requests.JsonRequest
Id int64 `position:"Json" field:"id"`
}
type GetFaqDetailResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data FaqDetail `json:"data"`
}
type FaqDetailRequest struct {
Id int64 `json:"id"`
}
func CreateGetFaqDetailRequest(param FaqDetailRequest) (req *GetFaqDetailRequest) {
req = &GetFaqDetailRequest{
JsonRequest: &requests.JsonRequest{},
Id: param.Id,
}
req.InitWithApiInfo(HOST, VERSION, "/v1/faq/detail")
req.Method = requests.POST
return
}
func CreateGetFaqDetailResponse() (response *GetFaqDetailResponse) {
response = &GetFaqDetailResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}
// 热门faq列表
type HotFaq struct {
Id int64 `json:"id"`
Title string `json:"title"`
}
type GetHotFaqRequest struct {
*requests.JsonRequest
}
type GetHotFaqResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data []HotFaq `json:"data"`
}
func CreateGetHotFaqRequest() (req *GetHotFaqRequest) {
req = &GetHotFaqRequest{
JsonRequest: &requests.JsonRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/v1/faq/hot_list")
req.Method = requests.POST
return
}
func CreateGetHotFaqResponse() (response *GetHotFaqResponse) {
response = &GetHotFaqResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}