package logic import ( "app.yhyue.com/moapp/jydocs/rpc/stdlib/internal/svc" "app.yhyue.com/moapp/jydocs/rpc/stdlib/stdlib" stdlibService "app.yhyue.com/moapp/jydocs/services/stdlib" "context" "fmt" "github.com/tal-tech/go-zero/core/logx" ) type DocOnLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewDocOnLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocOnLogic { return &DocOnLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } func (l *DocOnLogic) DocOn(in *stdlib.DocChangeReq) (*stdlib.DocChangeResp, error) { // todo: add your logic here and delete this line err := stdlibService.ChangeDocumentOn(in.Id, in.Reason) fmt.Println(err) if err == nil { return &stdlib.DocChangeResp{State: true}, nil } else { return &stdlib.DocChangeResp{State: false}, nil } }