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/knowledge" "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 *knowledge.CommonPhraseQueryReq) (*knowledge.CommonPhraseQueryResp, error) { // todo: add your logic here and delete this line var result = &knowledge.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 }