service

package
v0.0.0-...-9809e3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUserType = errors.New("invalid user type")

	ErrorInvalidLogin = errors.New("invalid login")
	ErrInValidEmail   = errors.New("invalid email")
)
View Source
var JwtKey = []byte("your_secret_key")

Functions

func GenerateJWT

func GenerateJWT(userType string) (string, error)

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(userRepo UserRepo) *AuthService

func (*AuthService) DummyLogin

func (s *AuthService) DummyLogin(ctx context.Context, req dto.GetDummyLoginParams) (string, error)

func (*AuthService) Login

func (s *AuthService) Login(ctx context.Context, req dto.LoginRequest) (string, error)

func (*AuthService) Register

type FlatRepo

type FlatRepo interface {
	CreateFlat(ctx context.Context, flat *dto.DtoFlat) (*dto.DtoFlat, error)
	UpdateFlat(ctx context.Context, flat *dto.DtoFlat) (*dto.DtoFlat, error)
	GetFlatByHouseID(ctx context.Context, houseID int, userType string) ([]*dto.DtoFlat, error)
	GetFlatByID(ctx context.Context, id int) (*dto.DtoFlat, error)
}

type FlatService

type FlatService struct {
	// contains filtered or unexported fields
}

func NewFlatService

func NewFlatService(flatRepo FlatRepo, houseFlatRepo HouseFlatRepo) *FlatService

func (*FlatService) CreateFlat

func (s *FlatService) CreateFlat(ctx context.Context, req dto.CreateFlatRequest) (*dto.DtoFlat, error)

func (*FlatService) GetFlatsByHouseID

func (s *FlatService) GetFlatsByHouseID(ctx context.Context, houseIDStr, token string) ([]*dto.DtoFlat, error)

func (*FlatService) UpdateFlat

type HouseFlatRepo

type HouseFlatRepo interface {
	UpdateHouse(ctx context.Context, id int, updAt time.Time) (*dto.House, error)
}

type HouseRepo

type HouseRepo interface {
	CreateHouse(ctx context.Context, house *dto.House) (*dto.House, error)
}

type HouseService

type HouseService struct {
	// contains filtered or unexported fields
}

func NewHouseService

func NewHouseService(houseRepo HouseRepo) *HouseService

func (*HouseService) CreateHouse

type UserRepo

type UserRepo interface {
	CreateUser(ctx context.Context, user repository.User) error
	GetUser(ctx context.Context, email string) (repository.User, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL