You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
940 B

9 months ago
package service
import (
"context"
"fmt"
"fm-upload/api"
"fm-upload/internal/biz"
"fm-upload/internal/conf"
)
// GreeterService is a greeter service.
type GreeterService struct {
api.UnimplementedGreeterServer
uc *biz.StorageUsecase
ic *biz.ImageUsecase
conf *conf.System
}
// NewGreeterService new a greeter service.
func NewGreeterService(uc *biz.StorageUsecase, ic *biz.ImageUsecase, conf *conf.System) *GreeterService {
return &GreeterService{uc: uc, ic: ic, conf: conf}
}
// SayHello implements helloworld.GreeterServer.
func (s *GreeterService) Ping(ctx context.Context, in *api.PingRequest) (*api.PingReply, error) {
return &api.PingReply{Message: "Hello"}, nil
}
// SayHello implements helloworld.GreeterServer.
func (s *GreeterService) Upload(ctx context.Context, in *api.UploadRequest) (*api.UploadReply, error) {
fmt.Println(in.Type)
fmt.Println(in.File)
return &api.UploadReply{Message: "Hello"}, nil
}