type AddKnowledgeReq { Question string `json:"question"` Answer string `json:"answer"` EntId int64 `header:"entId"` AppId string `header:"appId"` EntUserId int64 `header:"entUserId"` } type FindAnswerReq { Question string `json:"question"` RobotEntId string `json:"robotEntId"` Type int64 `json:"type"` //1 文字 2 语音 } type RecommendAnswerReq { Question string `json:"question"` RobotEntId string `header:"entId"` Type int64 `json:"type"` //1 文字 2 语音 } type ListReq { PageSize int64 `json:"pageSize"` PageIndex int64 `json:"pageIndex"` EntId int64 `header:"entId"` } type InfoReq { AnswerId int64 `json:"answerId"` } type EditReq { Question string `json:"question"` Answer string `json:"answer"` EntUserId int64 `header:"entUserId"` AnswerId int64 `json:"answerId"` EntId int64 `header:"entId"` KnowledgeId int64 `json:"knowledgeId"` AppId string `header:"appId"` } type DeleteReq { AnswerId int64 `json:"answerId"` } type CommonRes { Error_code int `json:"error_code"` Error_msg string `json:"error_msg"` Data interface{} `json:"data"` } type CommonPhrasesAddReq { Id int64 `json:"id"` Classify string `json:"classify"` Content string `json:"content"` EntId int64 `header:"entId"` AppId string `header:"appId"` EntUserId int64 `header:"entUserId"` } type CommonPhrasesInfoOrDelReq { Id int64 `json:"id"` } type CommonPhrasesListReq { PageSize int64 `json:"pageSize"` PageIndex int64 `json:"pageIndex"` EntId int64 `header:"entId"` AppId string `header:"appId"` } service knowledge-api { @handler knowledgeAdd post /knowledge/knowledgeAdd (AddKnowledgeReq) returns (CommonRes); @handler knowledgeList post /knowledge/knowledgeList (ListReq) returns (CommonRes); @handler knowledgeInfo post /knowledge/knowledgeInfo (InfoReq) returns (CommonRes); @handler knowledgeEdit post /knowledge/knowledgeEdit (EditReq) returns (CommonRes); @handler knowledgeDel post /knowledge/knowledgeDel (DeleteReq) returns (CommonRes); @handler findAnswer post /knowledge/findAnswer (FindAnswerReq) returns (CommonRes); @handler recommendAnswer post /knowledge/recommendAnswer (RecommendAnswerReq) returns (CommonRes); @handler commonPhrasesAddOrUpdate post /knowledge/commonPhrase/commonPhrasesAddOrUpdate (CommonPhrasesAddReq) returns (CommonRes); @handler commonPhrasesInfo post /knowledge/commonPhrase/commonPhrasesInfo (CommonPhrasesInfoOrDelReq) returns (CommonRes); @handler commonPhrasesDel post /knowledge/commonPhrase/commonPhrasesDel (CommonPhrasesInfoOrDelReq) returns (CommonRes); @handler commonPhrasesList post /knowledge/commonPhrase/commonPhrasesList (CommonPhrasesListReq) returns (CommonRes); }