Documentation ¶
Index ¶
- Variables
- func GenerateJWT(userType string) (string, error)
- type AuthService
- type FlatRepo
- type FlatService
- func (s *FlatService) CreateFlat(ctx context.Context, req dto.CreateFlatRequest) (*dto.DtoFlat, error)
- func (s *FlatService) GetFlatsByHouseID(ctx context.Context, houseIDStr, token string) ([]*dto.DtoFlat, error)
- func (s *FlatService) UpdateFlat(ctx context.Context, req dto.PostFlatUpdateJSONRequestBody) (*dto.DtoFlat, error)
- type HouseFlatRepo
- type HouseRepo
- type HouseService
- type UserRepo
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 ¶
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 ¶
func (s *AuthService) Register(ctx context.Context, req dto.PostRegisterJSONRequestBody) error
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 (*FlatService) UpdateFlat ¶
func (s *FlatService) UpdateFlat(ctx context.Context, req dto.PostFlatUpdateJSONRequestBody) (*dto.DtoFlat, error)
type HouseFlatRepo ¶
type HouseService ¶
type HouseService struct {
// contains filtered or unexported fields
}
func NewHouseService ¶
func NewHouseService(houseRepo HouseRepo) *HouseService
func (*HouseService) CreateHouse ¶
func (s *HouseService) CreateHouse(ctx context.Context, req dto.PostHouseCreateJSONRequestBody) (*dto.House, error)
Click to show internal directories.
Click to hide internal directories.