12345678910111213141516171819202122232425262728293031323334353637383940 |
- 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
- }
|