package logic import ( "app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/config" "app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/svc" "app.yhyue.com/moapp/jy_docs/rpc/userlib/userlib" "app.yhyue.com/moapp/jy_docs/services/model" userLibService "app.yhyue.com/moapp/jy_docs/services/userlib" "context" "log" "github.com/tal-tech/go-zero/core/logx" ) type DocDownloadLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewDocDownloadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocDownloadLogic { return &DocDownloadLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } //转存操作 func (l *DocDownloadLogic) DocDownload(in *userlib.UserCollectRequest) (*userlib.UserCollectResponse, error) { b, msg := userLibService.UserDocDownload( &model.UserDoc{ UserId: in.UserId, DocId: in.DocId, <<<<<<< HEAD DocCategory: int(in.DocCategory), IsDelete: int(userlib.UserDocStatus_Normal), DocName: in.DocName, DocFileType: int(in.DocFileType), DocFileSuffix: in.DocFileSuffix, DocFileSize: int(in.DocFileSize), DocPageSize: int(in.DocPageSize), DocSummary: in.DocSummary, DocSourceUserId: in.SourceUserId, }, int(in.Cost), config.Configs.FileSystemConf.Etcd.Hosts, config.Configs.FileSystemConf.Etcd.Key) ======= }, int(in.Cost),config.Configs.FileSystemConf.Etcd.Hosts,config.Configs.FileSystemConf.Etcd.Key) >>>>>>> da3594f67ecdc12ecfff7b4a4a66f0ffb82bf39b log.Printf("用户文档收藏,userId:[%s],docId:[%s] 是否成功:[%v]", in.UserId, in.DocId, b) if b { return &userlib.UserCollectResponse{ Code: int32(1), Message: msg, }, nil } else { return &userlib.UserCollectResponse{ Code: int32(0), Message: msg, }, nil } }