renjiaojiao 2 лет назад
Родитель
Сommit
67f8eecc14

+ 28 - 0
api/knowledge/internal/handler/commonphrasesaddorupdatehandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+)
+
+func commonPhrasesAddOrUpdateHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.CommonPhrasesAddReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewCommonPhrasesAddOrUpdateLogic(r.Context(), ctx)
+		resp, err := l.CommonPhrasesAddOrUpdate(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/knowledge/internal/handler/commonphrasesclasslisthandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+)
+
+func commonPhrasesClassListHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.CommonPhrasesClassListReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewCommonPhrasesClassListLogic(r.Context(), ctx)
+		resp, err := l.CommonPhrasesClassList(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/knowledge/internal/handler/commonphrasesdelhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+)
+
+func commonPhrasesDelHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.CommonPhrasesInfoOrDelReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewCommonPhrasesDelLogic(r.Context(), ctx)
+		resp, err := l.CommonPhrasesDel(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/knowledge/internal/handler/commonphrasesinfohandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+)
+
+func commonPhrasesInfoHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.CommonPhrasesInfoOrDelReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewCommonPhrasesInfoLogic(r.Context(), ctx)
+		resp, err := l.CommonPhrasesInfo(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/knowledge/internal/handler/commonphraseslisthandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+)
+
+func commonPhrasesListHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.CommonPhrasesListReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewCommonPhrasesListLogic(r.Context(), ctx)
+		resp, err := l.CommonPhrasesList(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 29 - 0
api/knowledge/internal/handler/commonphrasesqueryhandler.go

@@ -0,0 +1,29 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/logic"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+
+	"github.com/tal-tech/go-zero/rest/httpx"
+)
+
+func commonPhrasesQueryHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.CommonPhrasesQueryReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewCommonPhrasesQueryLogic(r.Context(), ctx)
+		resp, err := l.CommonPhrasesQuery(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 7 - 1
api/knowledge/internal/handler/routes.go

@@ -2,10 +2,11 @@
 package handler
 
 import (
-	"github.com/zeromicro/go-zero/rest"
 	"net/http"
 
 	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+
+	"github.com/tal-tech/go-zero/rest"
 )
 
 func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
@@ -71,6 +72,11 @@ func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/knowledge/commonPhrase/commonPhrasesClassList",
 				Handler: commonPhrasesClassListHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/knowledge/commonPhrase/commonPhrasesQuery",
+				Handler: commonPhrasesQueryHandler(serverCtx),
+			},
 		},
 	)
 }

+ 41 - 0
api/knowledge/internal/logic/commonphrasesquerylogic.go

@@ -0,0 +1,41 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient"
+	"context"
+	"github.com/zeromicro/go-zero/core/logx"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
+)
+
+type CommonPhrasesQueryLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewCommonPhrasesQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) CommonPhrasesQueryLogic {
+	return CommonPhrasesQueryLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *CommonPhrasesQueryLogic) CommonPhrasesQuery(req types.CommonPhrasesQueryReq) (*types.CommonRes, error) {
+	// todo: add your logic here and delete this line
+	resp, err := l.svcCtx.Knowledge.CommonPhraseQuery(l.ctx, &knowledgeclient.CommonPhraseQueryReq{
+		Query: req.Query,
+		EntId: req.EntId,
+		AppId: req.AppId,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.CommonRes{
+		Error_code: int(resp.ErrorCode),
+		Error_msg:  resp.ErrorMsg,
+		Data:       resp.Data,
+	}, nil
+}

+ 6 - 0
api/knowledge/internal/types/types.go

@@ -76,3 +76,9 @@ type CommonPhrasesClassListReq struct {
 	EntId int64  `header:"entId"` //企业id
 	AppId string `header:"appId"`
 }
+
+type CommonPhrasesQueryReq struct {
+	Query string `json:"query"`
+	EntId int64  `header:"entId"` //企业id
+	AppId string `header:"appId"`
+}

+ 7 - 0
api/knowledge/knowledge.api

@@ -67,6 +67,11 @@ type CommonPhrasesClassListReq {
 	EntId int64  `header:"entId"` //企业id
 	AppId string `header:"appId"`
 }
+type CommonPhrasesQueryReq {
+	Query string `json:"query"`
+	EntId int64  `header:"entId"` //企业id
+	AppId string `header:"appId"`
+}
 
 service knowledge-api {
 	@handler knowledgeAdd
@@ -93,4 +98,6 @@ service knowledge-api {
 	post /knowledge/commonPhrase/commonPhrasesList (CommonPhrasesListReq) returns (CommonRes);
 	@handler commonPhrasesClassList
 	post /knowledge/commonPhrase/commonPhrasesClassList (CommonPhrasesClassListReq) returns (CommonRes);
+	@handler commonPhrasesQuery
+	post /knowledge/commonPhrase/commonPhrasesQuery (CommonPhrasesQueryReq) returns (CommonRes);
 }

+ 2 - 0
rpc/knowledge/etc/knowledge.yaml

@@ -1,5 +1,6 @@
 Name: knowledge.rpc
 ListenOn: 127.0.0.1:8080
+FindCount: 4
 Etcd:
   Hosts:
     - 127.0.0.1:2379
@@ -31,3 +32,4 @@ UserCenterConf:
     Hosts:
       - 192.168.3.240:2379
     Key: usercenter.rpc
+

+ 1 - 0
rpc/knowledge/internal/config/config.go

@@ -13,4 +13,5 @@ type Config struct {
 	Segment        string
 	TestConf       zrpc.RpcClientConf
 	UserCenterConf zrpc.RpcClientConf
+	FindCount      int
 }

+ 40 - 0
rpc/knowledge/internal/logic/commonphrasequerylogic.go

@@ -0,0 +1,40 @@
+package logic
+
+import (
+	. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/init"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/service"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient"
+	"context"
+	"fmt"
+	"github.com/zeromicro/go-zero/core/logx"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/svc"
+)
+
+type CommonPhraseQueryLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCommonPhraseQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommonPhraseQueryLogic {
+	return &CommonPhraseQueryLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 客服输入文字,匹配话术
+func (l *CommonPhraseQueryLogic) CommonPhraseQuery(in *knowledgeclient.CommonPhraseQueryReq) (*knowledgeclient.CommonPhraseQueryResp, error) {
+	// todo: add your logic here and delete this line
+
+	var result = &knowledgeclient.CommonPhraseQueryResp{}
+	c := service.CommonPhrasesService{}
+	contents := c.CommonPhraseQuery(in, C.Segment, C.FindCount)
+	result.ErrorCode = 0
+	result.ErrorMsg = "请求成功"
+	result.Data = contents
+	fmt.Println("推荐话术", result)
+	return result, nil
+}

+ 6 - 0
rpc/knowledge/internal/server/knowledgeserver.go

@@ -92,3 +92,9 @@ func (s *KnowledgeServer) CommonPhraseClassList(ctx context.Context, in *knowled
 	l := logic.NewCommonPhraseClassListLogic(ctx, s.svcCtx)
 	return l.CommonPhraseClassList(in)
 }
+
+// 客服输入文字,匹配话术
+func (s *KnowledgeServer) CommonPhraseQuery(ctx context.Context, in *knowledgeclient.CommonPhraseQueryReq) (*knowledgeclient.CommonPhraseQueryResp, error) {
+	l := logic.NewCommonPhraseQueryLogic(ctx, s.svcCtx)
+	return l.CommonPhraseQuery(in)
+}

+ 32 - 0
rpc/knowledge/internal/service/commonPhrasesService.go

@@ -6,6 +6,7 @@ import (
 	. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/entity"
 	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient"
 	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/util"
+	"github.com/zeromicro/go-zero/core/logx"
 	"log"
 	"strconv"
 	"time"
@@ -175,3 +176,34 @@ func (c *CommonPhrasesService) CommonPhrasesClassList(param *knowledgeclient.Com
 
 	return classListArr
 }
+
+func (c *CommonPhrasesService) CommonPhraseQuery(param *knowledgeclient.CommonPhraseQueryReq, segment string, findCount int) []*knowledgeclient.Content {
+	var (
+		keyWords    = ""
+		searchField = `"content"`
+		contents    []*knowledgeclient.Content
+	)
+	//根据问题进行分词
+	keywordsArr := util.HanlpGetNormalWords(param.Query, segment)
+	logx.Info("keywordsArr", keywordsArr)
+	if len(keywordsArr) != 0 {
+		for _, val := range keywordsArr {
+			keyWords += val + " "
+		}
+	}
+	if keyWords == "" {
+		keyWords = param.Query
+	}
+	//logx.Info("entId:", SE.Decode4Hex(param.RobotEntId))
+	var query = util.DSL4SearchByKwsOrid(keyWords, strconv.Itoa(int(param.EntId)))
+	res := elastic.GetAllByNgram(INDEX, TYPE, query, "", "", searchField, 0, findCount, 0, false)
+	if res != nil && len(*res) > 0 {
+		for _, val := range *res {
+			contents = append(contents, &knowledgeclient.Content{
+				Content: cm.ObjToString(val["content"]),
+			})
+		}
+		log.Println("推荐答案:", contents)
+	}
+	return contents
+}

+ 12 - 0
rpc/knowledge/knowledge.proto

@@ -136,6 +136,16 @@ message CommonPhrasesClassListResp{
   string error_msg = 2; //响应消息
   repeated CommonPhrasesClassListData Data = 3;
 }
+message CommonPhraseQueryReq{
+  string query = 1;
+  int64 entId = 2;
+  string appId = 3;
+}
+message CommonPhraseQueryResp{
+  int64 error_code = 1; //响应代码
+  string error_msg = 2; //响应消息
+  repeated Content data = 3;
+}
 
 service knowledge {
   //知识新增
@@ -162,4 +172,6 @@ service knowledge {
   rpc CommonPhrasesDel(CommonPhrasesInfoReq) returns(AddResponse);
   //客服话术分类查询
   rpc CommonPhraseClassList(CommonPhrasesClassListReq) returns(CommonPhrasesClassListResp);
+  //客服输入文字,匹配话术
+  rpc CommonPhraseQuery(CommonPhraseQueryReq) returns (CommonPhraseQueryResp);
 }

+ 298 - 86
rpc/knowledge/knowledge/knowledge.pb.go

@@ -1568,6 +1568,132 @@ func (x *CommonPhrasesClassListResp) GetData() []*CommonPhrasesClassListData {
 	return nil
 }
 
+type CommonPhraseQueryReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
+	EntId int64  `protobuf:"varint,2,opt,name=entId,proto3" json:"entId,omitempty"`
+	AppId string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`
+}
+
+func (x *CommonPhraseQueryReq) Reset() {
+	*x = CommonPhraseQueryReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_knowledge_proto_msgTypes[24]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CommonPhraseQueryReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CommonPhraseQueryReq) ProtoMessage() {}
+
+func (x *CommonPhraseQueryReq) ProtoReflect() protoreflect.Message {
+	mi := &file_knowledge_proto_msgTypes[24]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CommonPhraseQueryReq.ProtoReflect.Descriptor instead.
+func (*CommonPhraseQueryReq) Descriptor() ([]byte, []int) {
+	return file_knowledge_proto_rawDescGZIP(), []int{24}
+}
+
+func (x *CommonPhraseQueryReq) GetQuery() string {
+	if x != nil {
+		return x.Query
+	}
+	return ""
+}
+
+func (x *CommonPhraseQueryReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
+func (x *CommonPhraseQueryReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+type CommonPhraseQueryResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ErrorCode int64      `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` //响应代码
+	ErrorMsg  string     `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`     //响应消息
+	Data      []*Content `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
+}
+
+func (x *CommonPhraseQueryResp) Reset() {
+	*x = CommonPhraseQueryResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_knowledge_proto_msgTypes[25]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CommonPhraseQueryResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CommonPhraseQueryResp) ProtoMessage() {}
+
+func (x *CommonPhraseQueryResp) ProtoReflect() protoreflect.Message {
+	mi := &file_knowledge_proto_msgTypes[25]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CommonPhraseQueryResp.ProtoReflect.Descriptor instead.
+func (*CommonPhraseQueryResp) Descriptor() ([]byte, []int) {
+	return file_knowledge_proto_rawDescGZIP(), []int{25}
+}
+
+func (x *CommonPhraseQueryResp) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+func (x *CommonPhraseQueryResp) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
+func (x *CommonPhraseQueryResp) GetData() []*Content {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
 var File_knowledge_proto protoreflect.FileDescriptor
 
 var file_knowledge_proto_rawDesc = []byte{
@@ -1739,65 +1865,84 @@ var file_knowledge_proto_rawDesc = []byte{
 	0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74,
 	0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68,
 	0x72, 0x61, 0x73, 0x65, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61,
-	0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x32, 0x83, 0x07, 0x0a, 0x09, 0x6b, 0x6e, 0x6f,
-	0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65,
-	0x64, 0x67, 0x65, 0x41, 0x64, 0x64, 0x12, 0x14, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
-	0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74,
+	0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x58, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71,
+	0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
+	0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70,
+	0x49, 0x64, 0x22, 0x7a, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61,
+	0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72,
+	0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
+	0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
+	0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xd9,
+	0x07, 0x0a, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0c,
+	0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x41, 0x64, 0x64, 0x12, 0x14, 0x2e, 0x74,
+	0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
+	0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64,
+	0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x4b, 0x6e, 0x6f,
+	0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x74, 0x65, 0x6d,
+	0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+	0x74, 0x1a, 0x16, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x4b, 0x6e, 0x6f,
+	0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x45, 0x64, 0x69, 0x74, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x6d,
+	0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x45,
+	0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
+	0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a,
+	0x0d, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19,
+	0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65,
+	0x64, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+	0x6c, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+	0x65, 0x12, 0x40, 0x0a, 0x0c, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x44, 0x65,
+	0x6c, 0x12, 0x19, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x6e, 0x6f,
+	0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74,
 	0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
-	0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65,
-	0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e,
-	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x74, 0x65,
-	0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
-	0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65,
-	0x45, 0x64, 0x69, 0x74, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e,
-	0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71,
-	0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52,
-	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x4b, 0x6e, 0x6f, 0x77, 0x6c,
-	0x65, 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c,
-	0x61, 0x74, 0x65, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x45, 0x6e, 0x74,
-	0x69, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x49,
-	0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x4b,
-	0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x12, 0x19, 0x2e, 0x74, 0x65,
-	0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65,
-	0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
-	0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a,
-	0x0a, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x74, 0x65,
-	0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65,
-	0x72, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e,
-	0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49,
-	0x0a, 0x0f, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65,
+	0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65,
 	0x72, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e,
-	0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6d,
-	0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x41,
-	0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x10, 0x43, 0x6f, 0x6d,
-	0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x41, 0x64, 0x64, 0x12, 0x1d, 0x2e,
-	0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50,
-	0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74,
-	0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
-	0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72,
-	0x61, 0x73, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c,
-	0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65,
-	0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c,
-	0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65,
-	0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x11, 0x43, 0x6f, 0x6d,
-	0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e,
+	0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x6d,
+	0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,
+	0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
+	0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71,
+	0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f,
+	0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x48, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73,
+	0x41, 0x64, 0x64, 0x12, 0x1d, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43,
+	0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x41, 0x64, 0x64, 0x52,
+	0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64,
+	0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x11, 0x43, 0x6f, 0x6d,
+	0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e,
+	0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+	0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1f,
 	0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
-	0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f,
+	0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x54, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73,
+	0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e,
+	0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e,
+	0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50,
+	0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+	0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73,
+	0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+	0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+	0x12, 0x62, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65,
+	0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+	0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73,
+	0x65, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x24,
 	0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
-	0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x49, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73,
-	0x44, 0x65, 0x6c, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43,
-	0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f,
-	0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x41,
-	0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x15, 0x43, 0x6f,
-	0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c,
-	0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43,
-	0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x43, 0x6c, 0x61, 0x73,
-	0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c,
-	0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65,
-	0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0d,
-	0x5a, 0x0b, 0x2e, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x62, 0x06, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68,
+	0x72, 0x61, 0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+	0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73,
+	0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+	0x6c, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x68, 0x72, 0x61, 0x73,
+	0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f,
+	0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x33,
 }
 
 var (
@@ -1812,7 +1957,7 @@ func file_knowledge_proto_rawDescGZIP() []byte {
 	return file_knowledge_proto_rawDescData
 }
 
-var file_knowledge_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
+var file_knowledge_proto_msgTypes = make([]protoimpl.MessageInfo, 26)
 var file_knowledge_proto_goTypes = []interface{}{
 	(*Question)(nil),                   // 0: template.Question
 	(*AddRequest)(nil),                 // 1: template.AddRequest
@@ -1838,6 +1983,8 @@ var file_knowledge_proto_goTypes = []interface{}{
 	(*Content)(nil),                    // 21: template.Content
 	(*CommonPhrasesClassListData)(nil), // 22: template.CommonPhrasesClassListData
 	(*CommonPhrasesClassListResp)(nil), // 23: template.CommonPhrasesClassListResp
+	(*CommonPhraseQueryReq)(nil),       // 24: template.CommonPhraseQueryReq
+	(*CommonPhraseQueryResp)(nil),      // 25: template.CommonPhraseQueryResp
 }
 var file_knowledge_proto_depIdxs = []int32{
 	0,  // 0: template.FindAnswerResp.data:type_name -> template.Question
@@ -1850,35 +1997,38 @@ var file_knowledge_proto_depIdxs = []int32{
 	18, // 7: template.CommonPhrasesListResp.data:type_name -> template.CommonPhrasesList
 	21, // 8: template.CommonPhrasesClassListData.classList:type_name -> template.Content
 	22, // 9: template.CommonPhrasesClassListResp.Data:type_name -> template.CommonPhrasesClassListData
-	1,  // 10: template.knowledge.KnowledgeAdd:input_type -> template.AddRequest
-	7,  // 11: template.knowledge.KnowledgeList:input_type -> template.ListRequest
-	10, // 12: template.knowledge.KnowledgeEdit:input_type -> template.KnowledgeEditReq
-	9,  // 13: template.knowledge.KnowledgeInfo:input_type -> template.KnowledgeEntity
-	12, // 14: template.knowledge.KnowledgeDel:input_type -> template.KnowledgeDelReq
-	3,  // 15: template.knowledge.FindAnswer:input_type -> template.FindAnswerReq
-	3,  // 16: template.knowledge.RecommendAnswer:input_type -> template.FindAnswerReq
-	13, // 17: template.knowledge.CommonPhrasesAdd:input_type -> template.CommonPhrasesAddReq
-	14, // 18: template.knowledge.CommonPhrasesInfo:input_type -> template.CommonPhrasesInfoReq
-	15, // 19: template.knowledge.CommonPhrasesList:input_type -> template.CommonPhrasesListReq
-	14, // 20: template.knowledge.CommonPhrasesDel:input_type -> template.CommonPhrasesInfoReq
-	20, // 21: template.knowledge.CommonPhraseClassList:input_type -> template.CommonPhrasesClassListReq
-	2,  // 22: template.knowledge.KnowledgeAdd:output_type -> template.AddResponse
-	8,  // 23: template.knowledge.KnowledgeList:output_type -> template.ListResponse
-	2,  // 24: template.knowledge.KnowledgeEdit:output_type -> template.AddResponse
-	11, // 25: template.knowledge.KnowledgeInfo:output_type -> template.InfoResponse
-	2,  // 26: template.knowledge.KnowledgeDel:output_type -> template.AddResponse
-	4,  // 27: template.knowledge.FindAnswer:output_type -> template.FindAnswerResp
-	5,  // 28: template.knowledge.RecommendAnswer:output_type -> template.RecommendAnswerResp
-	2,  // 29: template.knowledge.CommonPhrasesAdd:output_type -> template.AddResponse
-	17, // 30: template.knowledge.CommonPhrasesInfo:output_type -> template.CommonPhrasesInfoResp
-	19, // 31: template.knowledge.CommonPhrasesList:output_type -> template.CommonPhrasesListResp
-	2,  // 32: template.knowledge.CommonPhrasesDel:output_type -> template.AddResponse
-	23, // 33: template.knowledge.CommonPhraseClassList:output_type -> template.CommonPhrasesClassListResp
-	22, // [22:34] is the sub-list for method output_type
-	10, // [10:22] is the sub-list for method input_type
-	10, // [10:10] is the sub-list for extension type_name
-	10, // [10:10] is the sub-list for extension extendee
-	0,  // [0:10] is the sub-list for field type_name
+	21, // 10: template.CommonPhraseQueryResp.data:type_name -> template.Content
+	1,  // 11: template.knowledge.KnowledgeAdd:input_type -> template.AddRequest
+	7,  // 12: template.knowledge.KnowledgeList:input_type -> template.ListRequest
+	10, // 13: template.knowledge.KnowledgeEdit:input_type -> template.KnowledgeEditReq
+	9,  // 14: template.knowledge.KnowledgeInfo:input_type -> template.KnowledgeEntity
+	12, // 15: template.knowledge.KnowledgeDel:input_type -> template.KnowledgeDelReq
+	3,  // 16: template.knowledge.FindAnswer:input_type -> template.FindAnswerReq
+	3,  // 17: template.knowledge.RecommendAnswer:input_type -> template.FindAnswerReq
+	13, // 18: template.knowledge.CommonPhrasesAdd:input_type -> template.CommonPhrasesAddReq
+	14, // 19: template.knowledge.CommonPhrasesInfo:input_type -> template.CommonPhrasesInfoReq
+	15, // 20: template.knowledge.CommonPhrasesList:input_type -> template.CommonPhrasesListReq
+	14, // 21: template.knowledge.CommonPhrasesDel:input_type -> template.CommonPhrasesInfoReq
+	20, // 22: template.knowledge.CommonPhraseClassList:input_type -> template.CommonPhrasesClassListReq
+	24, // 23: template.knowledge.CommonPhraseQuery:input_type -> template.CommonPhraseQueryReq
+	2,  // 24: template.knowledge.KnowledgeAdd:output_type -> template.AddResponse
+	8,  // 25: template.knowledge.KnowledgeList:output_type -> template.ListResponse
+	2,  // 26: template.knowledge.KnowledgeEdit:output_type -> template.AddResponse
+	11, // 27: template.knowledge.KnowledgeInfo:output_type -> template.InfoResponse
+	2,  // 28: template.knowledge.KnowledgeDel:output_type -> template.AddResponse
+	4,  // 29: template.knowledge.FindAnswer:output_type -> template.FindAnswerResp
+	5,  // 30: template.knowledge.RecommendAnswer:output_type -> template.RecommendAnswerResp
+	2,  // 31: template.knowledge.CommonPhrasesAdd:output_type -> template.AddResponse
+	17, // 32: template.knowledge.CommonPhrasesInfo:output_type -> template.CommonPhrasesInfoResp
+	19, // 33: template.knowledge.CommonPhrasesList:output_type -> template.CommonPhrasesListResp
+	2,  // 34: template.knowledge.CommonPhrasesDel:output_type -> template.AddResponse
+	23, // 35: template.knowledge.CommonPhraseClassList:output_type -> template.CommonPhrasesClassListResp
+	25, // 36: template.knowledge.CommonPhraseQuery:output_type -> template.CommonPhraseQueryResp
+	24, // [24:37] is the sub-list for method output_type
+	11, // [11:24] is the sub-list for method input_type
+	11, // [11:11] is the sub-list for extension type_name
+	11, // [11:11] is the sub-list for extension extendee
+	0,  // [0:11] is the sub-list for field type_name
 }
 
 func init() { file_knowledge_proto_init() }
@@ -2175,6 +2325,30 @@ func file_knowledge_proto_init() {
 				return nil
 			}
 		}
+		file_knowledge_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CommonPhraseQueryReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_knowledge_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CommonPhraseQueryResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -2182,7 +2356,7 @@ func file_knowledge_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_knowledge_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   24,
+			NumMessages:   26,
 			NumExtensions: 0,
 			NumServices:   1,
 		},
@@ -2232,6 +2406,8 @@ type KnowledgeClient interface {
 	CommonPhrasesDel(ctx context.Context, in *CommonPhrasesInfoReq, opts ...grpc.CallOption) (*AddResponse, error)
 	//客服话术分类查询
 	CommonPhraseClassList(ctx context.Context, in *CommonPhrasesClassListReq, opts ...grpc.CallOption) (*CommonPhrasesClassListResp, error)
+	//客服输入文字,匹配话术
+	CommonPhraseQuery(ctx context.Context, in *CommonPhraseQueryReq, opts ...grpc.CallOption) (*CommonPhraseQueryResp, error)
 }
 
 type knowledgeClient struct {
@@ -2350,6 +2526,15 @@ func (c *knowledgeClient) CommonPhraseClassList(ctx context.Context, in *CommonP
 	return out, nil
 }
 
+func (c *knowledgeClient) CommonPhraseQuery(ctx context.Context, in *CommonPhraseQueryReq, opts ...grpc.CallOption) (*CommonPhraseQueryResp, error) {
+	out := new(CommonPhraseQueryResp)
+	err := c.cc.Invoke(ctx, "/template.knowledge/CommonPhraseQuery", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // KnowledgeServer is the server API for Knowledge service.
 type KnowledgeServer interface {
 	//知识新增
@@ -2376,6 +2561,8 @@ type KnowledgeServer interface {
 	CommonPhrasesDel(context.Context, *CommonPhrasesInfoReq) (*AddResponse, error)
 	//客服话术分类查询
 	CommonPhraseClassList(context.Context, *CommonPhrasesClassListReq) (*CommonPhrasesClassListResp, error)
+	//客服输入文字,匹配话术
+	CommonPhraseQuery(context.Context, *CommonPhraseQueryReq) (*CommonPhraseQueryResp, error)
 }
 
 // UnimplementedKnowledgeServer can be embedded to have forward compatible implementations.
@@ -2418,6 +2605,9 @@ func (*UnimplementedKnowledgeServer) CommonPhrasesDel(context.Context, *CommonPh
 func (*UnimplementedKnowledgeServer) CommonPhraseClassList(context.Context, *CommonPhrasesClassListReq) (*CommonPhrasesClassListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method CommonPhraseClassList not implemented")
 }
+func (*UnimplementedKnowledgeServer) CommonPhraseQuery(context.Context, *CommonPhraseQueryReq) (*CommonPhraseQueryResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CommonPhraseQuery not implemented")
+}
 
 func RegisterKnowledgeServer(s *grpc.Server, srv KnowledgeServer) {
 	s.RegisterService(&_Knowledge_serviceDesc, srv)
@@ -2639,6 +2829,24 @@ func _Knowledge_CommonPhraseClassList_Handler(srv interface{}, ctx context.Conte
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Knowledge_CommonPhraseQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CommonPhraseQueryReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(KnowledgeServer).CommonPhraseQuery(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/template.knowledge/CommonPhraseQuery",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(KnowledgeServer).CommonPhraseQuery(ctx, req.(*CommonPhraseQueryReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 var _Knowledge_serviceDesc = grpc.ServiceDesc{
 	ServiceName: "template.knowledge",
 	HandlerType: (*KnowledgeServer)(nil),
@@ -2691,6 +2899,10 @@ var _Knowledge_serviceDesc = grpc.ServiceDesc{
 			MethodName: "CommonPhraseClassList",
 			Handler:    _Knowledge_CommonPhraseClassList_Handler,
 		},
+		{
+			MethodName: "CommonPhraseQuery",
+			Handler:    _Knowledge_CommonPhraseQuery_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "knowledge.proto",

+ 28 - 18
rpc/knowledge/knowledgeclient/knowledge.go

@@ -13,30 +13,32 @@ import (
 )
 
 type (
+	CommonPhrasesListResp      = knowledge.CommonPhrasesListResp
+	CommonPhrasesClassListReq  = knowledge.CommonPhrasesClassListReq
+	CommonPhrasesClassListData = knowledge.CommonPhrasesClassListData
+	KnowledgeEditReq           = knowledge.KnowledgeEditReq
+	CommonPhrasesAddReq        = knowledge.CommonPhrasesAddReq
+	AddResponse                = knowledge.AddResponse
+	FindAnswerReq              = knowledge.FindAnswerReq
+	ListRequest                = knowledge.ListRequest
 	ListResponse               = knowledge.ListResponse
-	CommonPhrasesInfoResp      = knowledge.CommonPhrasesInfoResp
-	Content                    = knowledge.Content
+	KnowledgeDelReq            = knowledge.KnowledgeDelReq
+	CommonPhrasesListReq       = knowledge.CommonPhrasesListReq
 	Question                   = knowledge.Question
-	FindAnswerReq              = knowledge.FindAnswerReq
-	ListData                   = knowledge.ListData
+	AddRequest                 = knowledge.AddRequest
+	CommonPhrasesClassListResp = knowledge.CommonPhrasesClassListResp
+	CommonPhraseQueryReq       = knowledge.CommonPhraseQueryReq
+	CommonPhraseQueryResp      = knowledge.CommonPhraseQueryResp
+	CommonPhrasesList          = knowledge.CommonPhrasesList
+	Content                    = knowledge.Content
 	InfoResponse               = knowledge.InfoResponse
-	CommonPhrasesListReq       = knowledge.CommonPhrasesListReq
+	CommonPhrasesInfoReq       = knowledge.CommonPhrasesInfoReq
 	CommonPhrases              = knowledge.CommonPhrases
-	CommonPhrasesList          = knowledge.CommonPhrasesList
-	AddRequest                 = knowledge.AddRequest
-	AddResponse                = knowledge.AddResponse
-	FindAnswerResp             = knowledge.FindAnswerResp
 	RecommendAnswerResp        = knowledge.RecommendAnswerResp
+	ListData                   = knowledge.ListData
+	CommonPhrasesInfoResp      = knowledge.CommonPhrasesInfoResp
+	FindAnswerResp             = knowledge.FindAnswerResp
 	KnowledgeEntity            = knowledge.KnowledgeEntity
-	KnowledgeDelReq            = knowledge.KnowledgeDelReq
-	CommonPhrasesInfoReq       = knowledge.CommonPhrasesInfoReq
-	CommonPhrasesListResp      = knowledge.CommonPhrasesListResp
-	CommonPhrasesClassListResp = knowledge.CommonPhrasesClassListResp
-	ListRequest                = knowledge.ListRequest
-	KnowledgeEditReq           = knowledge.KnowledgeEditReq
-	CommonPhrasesAddReq        = knowledge.CommonPhrasesAddReq
-	CommonPhrasesClassListReq  = knowledge.CommonPhrasesClassListReq
-	CommonPhrasesClassListData = knowledge.CommonPhrasesClassListData
 
 	Knowledge interface {
 		// 知识新增
@@ -63,6 +65,8 @@ type (
 		CommonPhrasesDel(ctx context.Context, in *CommonPhrasesInfoReq) (*AddResponse, error)
 		// 客服话术分类查询
 		CommonPhraseClassList(ctx context.Context, in *CommonPhrasesClassListReq) (*CommonPhrasesClassListResp, error)
+		// 客服输入文字,匹配话术
+		CommonPhraseQuery(ctx context.Context, in *CommonPhraseQueryReq) (*CommonPhraseQueryResp, error)
 	}
 
 	defaultKnowledge struct {
@@ -147,3 +151,9 @@ func (m *defaultKnowledge) CommonPhraseClassList(ctx context.Context, in *Common
 	client := knowledge.NewKnowledgeClient(m.cli.Conn())
 	return client.CommonPhraseClassList(ctx, in)
 }
+
+// 客服输入文字,匹配话术
+func (m *defaultKnowledge) CommonPhraseQuery(ctx context.Context, in *CommonPhraseQueryReq) (*CommonPhraseQueryResp, error) {
+	client := knowledge.NewKnowledgeClient(m.cli.Conn())
+	return client.CommonPhraseQuery(ctx, in)
+}

+ 13 - 1
rpc/knowledge/test/commonPhrases_test.go

@@ -17,7 +17,7 @@ func Test_CommonPhrasesAddOrEdit(t *testing.T) {
 	req.EntId = 14929
 	req.Content = "排序看一下"
 	req.EntUserId = 4315
-	req.Id = 32
+	//req.Id = 32
 	req.Classify = "排序"
 	res, err := TestSystem.CommonPhrasesAdd(ctx, req)
 	log.Println("res ", res)
@@ -56,3 +56,15 @@ func Test_CommonPhrasesList(t *testing.T) {
 	log.Println("res ", res)
 	log.Println("err ", err)
 }
+
+func Test_CommonPhrasesQuery(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
+	TestSystem := knowledgeclient.NewKnowledge(zrpc.MustNewClient(c.TestConf))
+	req := &knowledgeclient.CommonPhraseQueryReq{}
+	req.EntId = 14929
+	req.AppId = "10000"
+	req.Query = "test"
+	res, err := TestSystem.CommonPhraseQuery(ctx, req)
+	log.Println("res ", res)
+	log.Println("err ", err)
+}