【cs服务】
1、新增faq详情
This commit is contained in:
		
							parent
							
								
									f3a11907ee
								
							
						
					
					
						commit
						92868ce4a0
					
				@ -120,3 +120,9 @@ 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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -366,3 +366,23 @@ 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))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -46,3 +46,44 @@ 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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user