Documentation
¶
Index ¶
- type AdminUseCase
- func (uc *AdminUseCase) CompleteAdminProfile(adminID string, profileData domain.AdminProfileData) error
- func (uc *AdminUseCase) GetAdminProfile(adminID string) (*domain.Admin, error)
- func (uc *AdminUseCase) GetParkingLotsByAdmin(adminUUID string) ([]domain.ParkingLot, error)
- func (uc *AdminUseCase) RegisterAdmin(adminID string) error
- type CreateEsp32DeviceRequest
- type CreateParkingLotRequest
- type CreateSensorRequest
- type Esp32DeviceResponse
- type Esp32DeviceUseCase
- func (uc *Esp32DeviceUseCase) CreateEsp32Device(req CreateEsp32DeviceRequest) error
- func (uc *Esp32DeviceUseCase) DeleteEsp32Device(id uint64) error
- func (uc *Esp32DeviceUseCase) GetEsp32Device(id uint64) (*Esp32DeviceResponse, error)
- func (uc *Esp32DeviceUseCase) GetEsp32DeviceByIdentifier(identifier string) (*domain.Esp32Device, error)
- func (uc *Esp32DeviceUseCase) ListEsp32Devices() ([]domain.Esp32Device, error)
- func (uc *Esp32DeviceUseCase) UpdateEsp32Device(id uint64, req UpdateEsp32DeviceRequest) error
- type IAdminUseCase
- type IEsp32DeviceUseCase
- type IParkingLotUseCase
- type ISensorUseCase
- type IUserUseCase
- type ParkingLotResponse
- type ParkingLotUseCase
- func (uc *ParkingLotUseCase) CreateParkingLot(req CreateParkingLotRequest) (*ParkingLotResponse, error)
- func (uc *ParkingLotUseCase) DeleteParkingLot(parkingLotID uint, adminUUID string) error
- func (uc *ParkingLotUseCase) GetParkingLot(parkingLotID uint) (*ParkingLotResponse, error)
- func (uc *ParkingLotUseCase) GetParkingLotWithOwnership(parkingLotID uint, adminUUID string) (*ParkingLotResponse, error)
- func (uc *ParkingLotUseCase) ListParkingLots() ([]ParkingLotResponse, error)
- func (uc *ParkingLotUseCase) UpdateParkingLot(parkingLotID uint, req UpdateParkingLotRequest, adminUUID string) error
- type SensorResponse
- type SensorUseCase
- func (uc *SensorUseCase) CreateSensor(req CreateSensorRequest) error
- func (uc *SensorUseCase) DeleteSensor(sensorID uint) error
- func (uc *SensorUseCase) GetSensor(sensorID uint) (*SensorResponse, error)
- func (uc *SensorUseCase) GetSensorByDeviceAndNumber(deviceIdentifier string, sensorNumber int) (*SensorResponse, error)
- func (uc *SensorUseCase) ListSensorsByParkingLot(parkingLotID uint) ([]SensorResponse, error)
- func (uc *SensorUseCase) UpdateSensor(sensorID uint, req UpdateSensorRequest) error
- type UpdateEsp32DeviceRequest
- type UpdateParkingLotRequest
- type UpdateSensorRequest
- type UserUseCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminUseCase ¶
type AdminUseCase struct { AdminRepository repository.IAdminRepository ParkingLotRepository repository.IParkingLotRepository }
func (*AdminUseCase) CompleteAdminProfile ¶
func (uc *AdminUseCase) CompleteAdminProfile(adminID string, profileData domain.AdminProfileData) error
func (*AdminUseCase) GetAdminProfile ¶
func (uc *AdminUseCase) GetAdminProfile(adminID string) (*domain.Admin, error)
func (*AdminUseCase) GetParkingLotsByAdmin ¶
func (uc *AdminUseCase) GetParkingLotsByAdmin(adminUUID string) ([]domain.ParkingLot, error)
func (*AdminUseCase) RegisterAdmin ¶
func (uc *AdminUseCase) RegisterAdmin(adminID string) error
type CreateEsp32DeviceRequest ¶
type CreateEsp32DeviceRequest struct {
DeviceIdentifier string `json:"device_identifier"`
}
type CreateParkingLotRequest ¶
type CreateSensorRequest ¶
type Esp32DeviceResponse ¶
type Esp32DeviceUseCase ¶
type Esp32DeviceUseCase struct { Esp32DeviceRepository repository.IEsp32DeviceRepository SensorRepository repository.ISensorRepository }
func (*Esp32DeviceUseCase) CreateEsp32Device ¶
func (uc *Esp32DeviceUseCase) CreateEsp32Device(req CreateEsp32DeviceRequest) error
func (*Esp32DeviceUseCase) DeleteEsp32Device ¶
func (uc *Esp32DeviceUseCase) DeleteEsp32Device(id uint64) error
func (*Esp32DeviceUseCase) GetEsp32Device ¶
func (uc *Esp32DeviceUseCase) GetEsp32Device(id uint64) (*Esp32DeviceResponse, error)
func (*Esp32DeviceUseCase) GetEsp32DeviceByIdentifier ¶
func (uc *Esp32DeviceUseCase) GetEsp32DeviceByIdentifier(identifier string) (*domain.Esp32Device, error)
func (*Esp32DeviceUseCase) ListEsp32Devices ¶
func (uc *Esp32DeviceUseCase) ListEsp32Devices() ([]domain.Esp32Device, error)
func (*Esp32DeviceUseCase) UpdateEsp32Device ¶
func (uc *Esp32DeviceUseCase) UpdateEsp32Device(id uint64, req UpdateEsp32DeviceRequest) error
type IAdminUseCase ¶
type IAdminUseCase interface { RegisterAdmin(adminID string) error CompleteAdminProfile(adminID string, profileData domain.AdminProfileData) error GetAdminProfile(adminID string) (*domain.Admin, error) GetParkingLotsByAdmin(adminUUID string) ([]domain.ParkingLot, error) }
func NewAdminUseCase ¶
func NewAdminUseCase(adminRepo repository.IAdminRepository) IAdminUseCase
type IEsp32DeviceUseCase ¶
type IEsp32DeviceUseCase interface { CreateEsp32Device(req CreateEsp32DeviceRequest) error GetEsp32Device(id uint64) (*Esp32DeviceResponse, error) GetEsp32DeviceByIdentifier(identifier string) (*domain.Esp32Device, error) UpdateEsp32Device(id uint64, req UpdateEsp32DeviceRequest) error DeleteEsp32Device(id uint64) error ListEsp32Devices() ([]domain.Esp32Device, error) }
func NewEsp32DeviceUseCase ¶
func NewEsp32DeviceUseCase(esp32DeviceRepo repository.IEsp32DeviceRepository, sensorRepo repository.ISensorRepository) IEsp32DeviceUseCase
type IParkingLotUseCase ¶
type IParkingLotUseCase interface { CreateParkingLot(req CreateParkingLotRequest) (*ParkingLotResponse, error) GetParkingLot(parkingLotID uint) (*ParkingLotResponse, error) GetParkingLotWithOwnership(parkingLotID uint, adminUUID string) (*ParkingLotResponse, error) UpdateParkingLot(parkingLotID uint, req UpdateParkingLotRequest, adminUUID string) error DeleteParkingLot(parkingLotID uint, adminUUID string) error ListParkingLots() ([]ParkingLotResponse, error) }
func NewParkingLotUseCase ¶
func NewParkingLotUseCase(parkingLotRepo repository.IParkingLotRepository, sensorRepository repository.ISensorRepository, adminRepository repository.IAdminRepository) IParkingLotUseCase
NewParkingLotUseCase creates a new instance of ParkingLotUseCase.
type ISensorUseCase ¶
type ISensorUseCase interface { CreateSensor(req CreateSensorRequest) error GetSensor(sensorID uint) (*SensorResponse, error) UpdateSensor(sensorID uint, req UpdateSensorRequest) error DeleteSensor(sensorID uint) error ListSensorsByParkingLot(parkingLotID uint) ([]SensorResponse, error) GetSensorByDeviceAndNumber(deviceIdentifier string, sensorNumber int) (*SensorResponse, error) }
func NewSensorUseCase ¶
func NewSensorUseCase(sensorRepo repository.ISensorRepository, esp32DeviceRepo repository.IEsp32DeviceRepository) ISensorUseCase
type IUserUseCase ¶
type IUserUseCase interface { Register(username, password, email string) (*domain.User, error) FindByID(id uint) (*domain.User, error) UpdateUser(id uint, username, email, password string) (*domain.User, error) DeleteUser(id uint) error }
func NewUserUseCase ¶
func NewUserUseCase(userRepo repository.IUserRepository) IUserUseCase
type ParkingLotResponse ¶
type ParkingLotUseCase ¶
type ParkingLotUseCase struct { ParkingLotRepository repository.IParkingLotRepository SensorRepository repository.ISensorRepository AdminRepository repository.IAdminRepository }
func (*ParkingLotUseCase) CreateParkingLot ¶
func (uc *ParkingLotUseCase) CreateParkingLot(req CreateParkingLotRequest) (*ParkingLotResponse, error)
CreateParkingLot creates a new parking lot.
func (*ParkingLotUseCase) DeleteParkingLot ¶
func (uc *ParkingLotUseCase) DeleteParkingLot(parkingLotID uint, adminUUID string) error
DeleteParkingLot deletes a parking lot with ownership validation.
func (*ParkingLotUseCase) GetParkingLot ¶
func (uc *ParkingLotUseCase) GetParkingLot(parkingLotID uint) (*ParkingLotResponse, error)
GetParkingLot retrieves a parking lot by ID.
func (*ParkingLotUseCase) GetParkingLotWithOwnership ¶
func (uc *ParkingLotUseCase) GetParkingLotWithOwnership(parkingLotID uint, adminUUID string) (*ParkingLotResponse, error)
GetParkingLotWithOwnership retrieves a parking lot if it belongs to the admin.
func (*ParkingLotUseCase) ListParkingLots ¶
func (uc *ParkingLotUseCase) ListParkingLots() ([]ParkingLotResponse, error)
ListParkingLots retrieves all parking lots with their available spaces.
func (*ParkingLotUseCase) UpdateParkingLot ¶
func (uc *ParkingLotUseCase) UpdateParkingLot(parkingLotID uint, req UpdateParkingLotRequest, adminUUID string) error
UpdateParkingLot updates a parking lot.
type SensorResponse ¶
type SensorUseCase ¶
type SensorUseCase struct { SensorRepository repository.ISensorRepository Esp32DeviceRepository repository.IEsp32DeviceRepository }
func (*SensorUseCase) CreateSensor ¶
func (uc *SensorUseCase) CreateSensor(req CreateSensorRequest) error
func (*SensorUseCase) DeleteSensor ¶
func (uc *SensorUseCase) DeleteSensor(sensorID uint) error
func (*SensorUseCase) GetSensor ¶
func (uc *SensorUseCase) GetSensor(sensorID uint) (*SensorResponse, error)
func (*SensorUseCase) GetSensorByDeviceAndNumber ¶
func (uc *SensorUseCase) GetSensorByDeviceAndNumber(deviceIdentifier string, sensorNumber int) (*SensorResponse, error)
func (*SensorUseCase) ListSensorsByParkingLot ¶
func (uc *SensorUseCase) ListSensorsByParkingLot(parkingLotID uint) ([]SensorResponse, error)
func (*SensorUseCase) UpdateSensor ¶
func (uc *SensorUseCase) UpdateSensor(sensorID uint, req UpdateSensorRequest) error
type UpdateEsp32DeviceRequest ¶
type UpdateEsp32DeviceRequest struct {
DeviceIdentifier string `json:"device_identifier"`
}
type UpdateParkingLotRequest ¶
type UpdateSensorRequest ¶
type UserUseCase ¶
type UserUseCase struct {
UserRepository repository.IUserRepository
}
func (*UserUseCase) DeleteUser ¶
func (u *UserUseCase) DeleteUser(id uint) error
func (*UserUseCase) Register ¶
func (u *UserUseCase) Register(username, password, email string) (*domain.User, error)
func (*UserUseCase) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.