37 lines
979 B
Go
37 lines
979 B
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.9.2
|
|
// Source: objectstory.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"juwan-backend/app/objectstory/rpc/internal/logic"
|
|
"juwan-backend/app/objectstory/rpc/internal/svc"
|
|
"juwan-backend/app/objectstory/rpc/pb"
|
|
)
|
|
|
|
type FileServiceServer struct {
|
|
svcCtx *svc.ServiceContext
|
|
pb.UnimplementedFileServiceServer
|
|
}
|
|
|
|
func NewFileServiceServer(svcCtx *svc.ServiceContext) *FileServiceServer {
|
|
return &FileServiceServer{
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// 简单上传(适合小文件,或保存元数据)
|
|
func (s *FileServiceServer) Upload(ctx context.Context, in *pb.UploadFileMetadataReq) (*pb.UploadFileResp, error) {
|
|
l := logic.NewUploadLogic(ctx, s.svcCtx)
|
|
return l.Upload(in)
|
|
}
|
|
|
|
// 获取文件访问链接(处理私有文件的鉴权)
|
|
func (s *FileServiceServer) GetFileUrl(ctx context.Context, in *pb.GetFileUrlReq) (*pb.GetFileUrlResp, error) {
|
|
l := logic.NewGetFileUrlLogic(ctx, s.svcCtx)
|
|
return l.GetFileUrl(in)
|
|
}
|