knowledge.api 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. type AddKnowledgeReq {
  2. Question string `json:"question"`
  3. Answer string `json:"answer"`
  4. EntId int64 `header:"entId"`
  5. AppId string `header:"appId"`
  6. EntUserId int64 `header:"entUserId"`
  7. }
  8. type FindAnswerReq {
  9. Question string `json:"question"`
  10. RobotEntId string `json:"robotEntId"`
  11. Type int64 `json:"type"` //1 文字 2 语音
  12. }
  13. type RecommendAnswerReq {
  14. Question string `json:"question"`
  15. RobotEntId string `header:"entId"`
  16. Type int64 `json:"type"` //1 文字 2 语音
  17. }
  18. type GuessToAskReq {
  19. Question string `json:"question"`
  20. EntId string `json:"entId"`
  21. Type int64 `json:"type"` //1 文字 2 语音
  22. ReqSource int64 `json:"reqSource"` // 1
  23. }
  24. type ListReq {
  25. PageSize int64 `json:"pageSize"`
  26. PageIndex int64 `json:"pageIndex"`
  27. EntId int64 `header:"entId"`
  28. }
  29. type InfoReq {
  30. AnswerId int64 `json:"answerId"`
  31. }
  32. type EditReq {
  33. Question string `json:"question"`
  34. Answer string `json:"answer"`
  35. EntUserId int64 `header:"entUserId"`
  36. AnswerId int64 `json:"answerId"`
  37. EntId int64 `header:"entId"`
  38. KnowledgeId int64 `json:"knowledgeId"`
  39. AppId string `header:"appId"`
  40. }
  41. type DeleteReq {
  42. AnswerId int64 `json:"answerId"`
  43. }
  44. type CommonRes {
  45. Error_code int `json:"error_code"`
  46. Error_msg string `json:"error_msg"`
  47. Data interface{} `json:"data"`
  48. }
  49. type CommonPhrasesAddReq {
  50. Id int64 `json:"id"`
  51. Classify string `json:"classify"`
  52. Content string `json:"content"`
  53. EntId int64 `header:"entId"`
  54. AppId string `header:"appId"`
  55. EntUserId int64 `header:"entUserId"`
  56. }
  57. type CommonPhrasesInfoOrDelReq {
  58. Id int64 `json:"id"`
  59. }
  60. type CommonPhrasesListReq {
  61. PageSize int64 `json:"pageSize"`
  62. PageIndex int64 `json:"pageIndex"`
  63. EntId int64 `header:"entId"`
  64. AppId string `header:"appId"`
  65. }
  66. type CommonPhrasesClassListReq {
  67. Query string `json:"query"`
  68. EntId int64 `header:"entId"` //企业id
  69. AppId string `header:"appId"`
  70. }
  71. type CommonPhrasesQueryReq {
  72. Query string `json:"query"`
  73. EntId int64 `header:"entId"` //企业id
  74. AppId string `header:"appId"`
  75. }
  76. service knowledge-api {
  77. @handler knowledgeAdd
  78. post /knowledge/knowledgeAdd (AddKnowledgeReq) returns (CommonRes);
  79. @handler knowledgeList
  80. post /knowledge/knowledgeList (ListReq) returns (CommonRes);
  81. @handler knowledgeInfo
  82. post /knowledge/knowledgeInfo (InfoReq) returns (CommonRes);
  83. @handler knowledgeEdit
  84. post /knowledge/knowledgeEdit (EditReq) returns (CommonRes);
  85. @handler knowledgeDel
  86. post /knowledge/knowledgeDel (DeleteReq) returns (CommonRes);
  87. @handler findAnswer
  88. post /knowledge/findAnswer (FindAnswerReq) returns (CommonRes);
  89. @handler recommendAnswer
  90. post /knowledge/recommendAnswer (RecommendAnswerReq) returns (CommonRes);
  91. @handler guessToAsk
  92. post /knowledge/guessToAsk (GuessToAskReq) returns (CommonRes);
  93. @handler commonPhrasesAddOrUpdate
  94. post /knowledge/commonPhrase/commonPhrasesAddOrUpdate (CommonPhrasesAddReq) returns (CommonRes);
  95. @handler commonPhrasesInfo
  96. post /knowledge/commonPhrase/commonPhrasesInfo (CommonPhrasesInfoOrDelReq) returns (CommonRes);
  97. @handler commonPhrasesDel
  98. post /knowledge/commonPhrase/commonPhrasesDel (CommonPhrasesInfoOrDelReq) returns (CommonRes);
  99. @handler commonPhrasesList
  100. post /knowledge/commonPhrase/commonPhrasesList (CommonPhrasesListReq) returns (CommonRes);
  101. @handler commonPhrasesClassList
  102. post /knowledge/commonPhrase/commonPhrasesClassList (CommonPhrasesClassListReq) returns (CommonRes);
  103. @handler commonPhrasesQuery
  104. post /knowledge/commonPhrase/commonPhrasesQuery (CommonPhrasesQueryReq) returns (CommonRes);
  105. @handler keywordList
  106. post /knowledge/keywordList (CommonPhrasesQueryReq) returns (CommonRes);
  107. }