|
@@ -0,0 +1,68 @@
|
|
|
+// Code generated by goctl. DO NOT EDIT!
|
|
|
+// Source: knowledge.proto
|
|
|
+
|
|
|
+//go:generate mockgen -destination ./knowledge_mock.go -package knowledge -source $GOFILE
|
|
|
+
|
|
|
+package knowledge
|
|
|
+
|
|
|
+import (
|
|
|
+ "context"
|
|
|
+
|
|
|
+ "knowledgeBase/rpc/knowledge/knowledge"
|
|
|
+
|
|
|
+ "github.com/tal-tech/go-zero/zrpc"
|
|
|
+)
|
|
|
+
|
|
|
+type (
|
|
|
+ AddRequest = knowledge.AddRequest
|
|
|
+ AddResponse = knowledge.AddResponse
|
|
|
+ ListRequest = knowledge.ListRequest
|
|
|
+ ListResponse = knowledge.ListResponse
|
|
|
+ KnowledgeEntity = knowledge.KnowledgeEntity
|
|
|
+ InfoResponse = knowledge.InfoResponse
|
|
|
+
|
|
|
+ Knowledge interface {
|
|
|
+ // 知识新增
|
|
|
+ KnowledgeAdd(ctx context.Context, in *AddRequest) (*AddResponse, error)
|
|
|
+ // 知识列表
|
|
|
+ KnowledgeList(ctx context.Context, in *ListRequest) (*ListResponse, error)
|
|
|
+ // 知识编辑
|
|
|
+ KnowledgEdit(ctx context.Context, in *KnowledgeEntity) (*AddResponse, error)
|
|
|
+ // 知识详情
|
|
|
+ KnowledgeInfo(ctx context.Context, in *KnowledgeEntity) (*InfoResponse, error)
|
|
|
+ }
|
|
|
+
|
|
|
+ defaultKnowledge struct {
|
|
|
+ cli zrpc.Client
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
+func NewKnowledge(cli zrpc.Client) Knowledge {
|
|
|
+ return &defaultKnowledge{
|
|
|
+ cli: cli,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 知识新增
|
|
|
+func (m *defaultKnowledge) KnowledgeAdd(ctx context.Context, in *AddRequest) (*AddResponse, error) {
|
|
|
+ client := knowledge.NewKnowledgeClient(m.cli.Conn())
|
|
|
+ return client.KnowledgeAdd(ctx, in)
|
|
|
+}
|
|
|
+
|
|
|
+// 知识列表
|
|
|
+func (m *defaultKnowledge) KnowledgeList(ctx context.Context, in *ListRequest) (*ListResponse, error) {
|
|
|
+ client := knowledge.NewKnowledgeClient(m.cli.Conn())
|
|
|
+ return client.KnowledgeList(ctx, in)
|
|
|
+}
|
|
|
+
|
|
|
+// 知识编辑
|
|
|
+func (m *defaultKnowledge) KnowledgEdit(ctx context.Context, in *KnowledgeEntity) (*AddResponse, error) {
|
|
|
+ client := knowledge.NewKnowledgeClient(m.cli.Conn())
|
|
|
+ return client.KnowledgEdit(ctx, in)
|
|
|
+}
|
|
|
+
|
|
|
+// 知识详情
|
|
|
+func (m *defaultKnowledge) KnowledgeInfo(ctx context.Context, in *KnowledgeEntity) (*InfoResponse, error) {
|
|
|
+ client := knowledge.NewKnowledgeClient(m.cli.Conn())
|
|
|
+ return client.KnowledgeInfo(ctx, in)
|
|
|
+}
|