【cs服务】
1、新增热门faq获取
This commit is contained in:
parent
92868ce4a0
commit
eb25c8f20a
@ -126,3 +126,9 @@ func (client *Client) GetFaqDetail(req *GetFaqDetailRequest) (resp *GetFaqDetail
|
|||||||
err = client.DoAction(req, resp)
|
err = client.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *Client) GetHotFaqList(req *GetHotFaqRequest) (resp *GetHotFaqResponse, err error) {
|
||||||
|
resp = CreateGetHotFaqResponse()
|
||||||
|
err = client.DoAction(req, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -386,3 +386,21 @@ func TestGetFaqDetail(t *testing.T) {
|
|||||||
}
|
}
|
||||||
fmt.Printf(fmt.Sprintf("%v", res))
|
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))
|
||||||
|
}
|
||||||
|
@ -87,3 +87,34 @@ func CreateGetFaqDetailResponse() (response *GetFaqDetailResponse) {
|
|||||||
}
|
}
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user