knowledge.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: knowledge.proto
  3. //go:generate mockgen -destination ./knowledge_mock.go -package knowledge -source $GOFILE
  4. package knowledgeclient
  5. import (
  6. "context"
  7. "github.com/zeromicro/go-zero/zrpc"
  8. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
  9. )
  10. type (
  11. ListRequest = knowledge.ListRequest
  12. KnowledgeEntity = knowledge.KnowledgeEntity
  13. KnowledgeDelReq = knowledge.KnowledgeDelReq
  14. InfoResponse = knowledge.InfoResponse
  15. CommonPhrasesAddReq = knowledge.CommonPhrasesAddReq
  16. CommonPhrasesInfoReq = knowledge.CommonPhrasesInfoReq
  17. CommonPhrasesListReq = knowledge.CommonPhrasesListReq
  18. FindAnswerReq = knowledge.FindAnswerReq
  19. FindAnswerResp = knowledge.FindAnswerResp
  20. ListResponse = knowledge.ListResponse
  21. KnowledgeEditReq = knowledge.KnowledgeEditReq
  22. CommonPhrases = knowledge.CommonPhrases
  23. CommonPhrasesList = knowledge.CommonPhrasesList
  24. CommonPhrasesListResp = knowledge.CommonPhrasesListResp
  25. ListData = knowledge.ListData
  26. CommonPhrasesInfoResp = knowledge.CommonPhrasesInfoResp
  27. Question = knowledge.Question
  28. AddRequest = knowledge.AddRequest
  29. AddResponse = knowledge.AddResponse
  30. RecommendAnswerResp = knowledge.RecommendAnswerResp
  31. Knowledge interface {
  32. // 知识新增
  33. KnowledgeAdd(ctx context.Context, in *AddRequest) (*AddResponse, error)
  34. // 知识列表
  35. KnowledgeList(ctx context.Context, in *ListRequest) (*ListResponse, error)
  36. // 知识编辑
  37. KnowledgeEdit(ctx context.Context, in *KnowledgeEditReq) (*AddResponse, error)
  38. // 知识详情
  39. KnowledgeInfo(ctx context.Context, in *KnowledgeEntity) (*InfoResponse, error)
  40. // 知识删除
  41. KnowledgeDel(ctx context.Context, in *KnowledgeDelReq) (*AddResponse, error)
  42. // 根据问题匹配答案
  43. FindAnswer(ctx context.Context, in *FindAnswerReq) (*FindAnswerResp, error)
  44. // 推荐答案
  45. RecommendAnswer(ctx context.Context, in *FindAnswerReq) (*RecommendAnswerResp, error)
  46. // 客服话术添加、编辑
  47. CommonPhrasesAdd(ctx context.Context, in *CommonPhrasesAddReq) (*AddResponse, error)
  48. // 客服话术详情
  49. CommonPhrasesInfo(ctx context.Context, in *CommonPhrasesInfoReq) (*CommonPhrasesInfoResp, error)
  50. // 客服话术列表
  51. CommonPhrasesList(ctx context.Context, in *CommonPhrasesListReq) (*CommonPhrasesListResp, error)
  52. // 客服话术删除
  53. CommonPhrasesDel(ctx context.Context, in *CommonPhrasesInfoReq) (*AddResponse, error)
  54. }
  55. defaultKnowledge struct {
  56. cli zrpc.Client
  57. }
  58. )
  59. func NewKnowledge(cli zrpc.Client) Knowledge {
  60. return &defaultKnowledge{
  61. cli: cli,
  62. }
  63. }
  64. // 知识新增
  65. func (m *defaultKnowledge) KnowledgeAdd(ctx context.Context, in *AddRequest) (*AddResponse, error) {
  66. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  67. return client.KnowledgeAdd(ctx, in)
  68. }
  69. // 知识列表
  70. func (m *defaultKnowledge) KnowledgeList(ctx context.Context, in *ListRequest) (*ListResponse, error) {
  71. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  72. return client.KnowledgeList(ctx, in)
  73. }
  74. // 知识编辑
  75. func (m *defaultKnowledge) KnowledgeEdit(ctx context.Context, in *KnowledgeEditReq) (*AddResponse, error) {
  76. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  77. return client.KnowledgeEdit(ctx, in)
  78. }
  79. // 知识详情
  80. func (m *defaultKnowledge) KnowledgeInfo(ctx context.Context, in *KnowledgeEntity) (*InfoResponse, error) {
  81. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  82. return client.KnowledgeInfo(ctx, in)
  83. }
  84. // 知识删除
  85. func (m *defaultKnowledge) KnowledgeDel(ctx context.Context, in *KnowledgeDelReq) (*AddResponse, error) {
  86. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  87. return client.KnowledgeDel(ctx, in)
  88. }
  89. // 根据问题匹配答案
  90. func (m *defaultKnowledge) FindAnswer(ctx context.Context, in *FindAnswerReq) (*FindAnswerResp, error) {
  91. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  92. return client.FindAnswer(ctx, in)
  93. }
  94. // 推荐答案
  95. func (m *defaultKnowledge) RecommendAnswer(ctx context.Context, in *FindAnswerReq) (*RecommendAnswerResp, error) {
  96. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  97. return client.RecommendAnswer(ctx, in)
  98. }
  99. // 客服话术添加、编辑
  100. func (m *defaultKnowledge) CommonPhrasesAdd(ctx context.Context, in *CommonPhrasesAddReq) (*AddResponse, error) {
  101. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  102. return client.CommonPhrasesAdd(ctx, in)
  103. }
  104. // 客服话术详情
  105. func (m *defaultKnowledge) CommonPhrasesInfo(ctx context.Context, in *CommonPhrasesInfoReq) (*CommonPhrasesInfoResp, error) {
  106. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  107. return client.CommonPhrasesInfo(ctx, in)
  108. }
  109. // 客服话术列表
  110. func (m *defaultKnowledge) CommonPhrasesList(ctx context.Context, in *CommonPhrasesListReq) (*CommonPhrasesListResp, error) {
  111. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  112. return client.CommonPhrasesList(ctx, in)
  113. }
  114. // 客服话术删除
  115. func (m *defaultKnowledge) CommonPhrasesDel(ctx context.Context, in *CommonPhrasesInfoReq) (*AddResponse, error) {
  116. client := knowledge.NewKnowledgeClient(m.cli.Conn())
  117. return client.CommonPhrasesDel(ctx, in)
  118. }