package logic import ( "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient" "context" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type KeywordListLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewKeywordListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *KeywordListLogic { return &KeywordListLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *KeywordListLogic) KeywordList(req *types.CommonPhrasesQueryReq) (resp *types.CommonRes, err error) { res, rErr := l.svcCtx.Knowledge.KeywordList(l.ctx, &knowledgeclient.CommonPhraseQueryReq{ Query: req.Query, EntId: req.EntId, AppId: req.AppId, }) if rErr != nil { return nil, rErr } return &types.CommonRes{ Error_code: int(res.ErrorCode), Error_msg: res.ErrorMsg, Data: res.Data, }, nil }