6
0

【cs服务】

1、新增热门faq获取
This commit is contained in:
liguanjie 2025-06-20 11:41:24 +08:00
parent 92868ce4a0
commit eb25c8f20a
3 changed files with 55 additions and 0 deletions

View File

@ -126,3 +126,9 @@ func (client *Client) GetFaqDetail(req *GetFaqDetailRequest) (resp *GetFaqDetail
err = client.DoAction(req, resp)
return
}
func (client *Client) GetHotFaqList(req *GetHotFaqRequest) (resp *GetHotFaqResponse, err error) {
resp = CreateGetHotFaqResponse()
err = client.DoAction(req, resp)
return
}

View File

@ -386,3 +386,21 @@ func TestGetFaqDetail(t *testing.T) {
}
fmt.Printf(fmt.Sprintf("%v", res))
}
// 获取热门faq
func TestGetFaqHotList(t *testing.T) {
client, newErr := NewClient()
if newErr != nil {
panic(newErr)
}
req := CreateGetHotFaqRequest()
res, err := client.GetHotFaqList(req)
if err != nil {
t.Error(err)
return
}
if res.Code != 0 || len(res.Data) == 0 {
t.Error("获取热门faq失败")
}
fmt.Printf(fmt.Sprintf("%v", res))
}

View File

@ -87,3 +87,34 @@ func CreateGetFaqDetailResponse() (response *GetFaqDetailResponse) {
}
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
}