Compare commits
	
		
			2 Commits
		
	
	
		
			f3a11907ee
			...
			eb25c8f20a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					eb25c8f20a | ||
| 
						 | 
					92868ce4a0 | 
@ -120,3 +120,15 @@ func (client *Client) OrderRecordDetail(req *GetWorkOrderRecordDetailReq) (resp
 | 
			
		||||
	err = client.DoAction(req, resp)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (client *Client) GetFaqDetail(req *GetFaqDetailRequest) (resp *GetFaqDetailResponse, err error) {
 | 
			
		||||
	resp = CreateGetFaqDetailResponse()
 | 
			
		||||
	err = client.DoAction(req, resp)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (client *Client) GetHotFaqList(req *GetHotFaqRequest) (resp *GetHotFaqResponse, err error) {
 | 
			
		||||
	resp = CreateGetHotFaqResponse()
 | 
			
		||||
	err = client.DoAction(req, resp)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -366,3 +366,41 @@ func TestOrderRecordDetail(t *testing.T) {
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Printf(fmt.Sprintf("%v", res))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取faq详情
 | 
			
		||||
func TestGetFaqDetail(t *testing.T) {
 | 
			
		||||
	client, newErr := NewClient()
 | 
			
		||||
	if newErr != nil {
 | 
			
		||||
		panic(newErr)
 | 
			
		||||
	}
 | 
			
		||||
	req := CreateGetFaqDetailRequest(FaqDetailRequest{
 | 
			
		||||
		Id: int64(31),
 | 
			
		||||
	})
 | 
			
		||||
	res, err := client.GetFaqDetail(req)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Error(err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	if res.Code != 0 || res.Data.Id == 0 {
 | 
			
		||||
		t.Error("获取faq详情失败")
 | 
			
		||||
	}
 | 
			
		||||
	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))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -46,3 +46,75 @@ func CreateGetFaqResponse() (response *GetFaqResponse) {
 | 
			
		||||
	}
 | 
			
		||||
	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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user