package logic import ( "context" "app.yhyue.com/moapp/jy_docs/rpc/stdlib/internal/svc" "app.yhyue.com/moapp/jy_docs/rpc/stdlib/stdlib" stdlibService "app.yhyue.com/moapp/jy_docs/services/stdlib" "github.com/tal-tech/go-zero/core/logx" ) type DocQueryLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewDocQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocQueryLogic { return &DocQueryLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } func (l *DocQueryLogic) DocQuery(in *stdlib.DocQueryRequest) (*stdlib.DocQueryResponse, error) { // todo: add your logic here and delete this line //调用service示例 stdlibService.FindDocumentById(1) //end of service call demo pageNum := 0 if in.PageNum <= 0 { pageNum = 0 } stdlibService.FindDocumentsByKeyWords(in.KeyWords, pageNum) return &stdlib.DocQueryResponse{}, nil }