46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
package profileService
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
pbVC "gitea.cybertalant.ru/VisionCareerMiniapp/DataManagemet/pb/golang"
|
|
"gitea.cybertalant.ru/VisionCareerMiniapp/MiniappGoService/internal/application/types"
|
|
"github.com/minio/minio-go/v7"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
// ----------------------------------------
|
|
// COMMON
|
|
// ----------------------------------------
|
|
|
|
type loggerInstance interface {
|
|
Error(string, ...any)
|
|
Debug(string, ...any)
|
|
}
|
|
|
|
type minioDBInstance interface {
|
|
Get(bucketName string, fileName string) (*minio.Object, error)
|
|
Remove(fileName string, bucketName string) error
|
|
UploadFile(
|
|
ctx context.Context, bucketName, objectName string,
|
|
reader io.Reader, size int64, opts minio.PutObjectOptions,
|
|
) (string, error)
|
|
ListBuckets(ctx context.Context) ([]minio.BucketInfo, error)
|
|
}
|
|
|
|
type supportAPIInstance interface {
|
|
GetUserVacancies(ctx context.Context, in *pbVC.GetUserVacanciesRequest, opts ...grpc.CallOption) (*pbVC.GetUserVacanciesResponse, error)
|
|
UpsertUserData(ctx context.Context, in *pbVC.UpsertUserDataRequest, opts ...grpc.CallOption) (*pbVC.UpsertUserDataResponse, error)
|
|
}
|
|
|
|
// ----------------------------------------
|
|
// REPOSITORIES
|
|
// ----------------------------------------
|
|
|
|
type profileRepository interface {
|
|
GetUserById(id int64) (*types.User, error)
|
|
CreateUser(id int64, username *string) (*types.User, error)
|
|
UpdateUser(user *types.User) error
|
|
}
|