package logic import ( "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge" "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 CommonPhrasesListLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewCommonPhrasesListLogic(ctx context.Context, svcCtx *svc.ServiceContext) CommonPhrasesListLogic { return CommonPhrasesListLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *CommonPhrasesListLogic) CommonPhrasesList(req types.CommonPhrasesListReq) (*types.CommonRes, error) { resp, err := l.svcCtx.Knowledge.CommonPhrasesList(l.ctx, &knowledge.CommonPhrasesListReq{ EntId: req.EntId, PageIndex: req.PageIndex, PageSize: req.PageSize, 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 }