Documentation ¶
Index ¶
- func CreateHouse(c *gin.Context)
- func GetAllDevices(c *gin.Context)
- func GetAllRooms(c *gin.Context)
- func GetAllRoomsByID(c *gin.Context)
- func GetAllUsers(c *gin.Context)
- func GetDeviceById(c *gin.Context)
- func GetHouseById(c *gin.Context)
- func GetNumberOfActiveDevices(c *gin.Context)
- func GetNumberOfAllDevices(c *gin.Context)
- func GetNumberOfAllHouses(c *gin.Context)
- func GetNumberOfAllRooms(c *gin.Context)
- func GetUserByID(c *gin.Context)
- func Login(c *gin.Context)
- func Register(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHouse ¶
@Summary Create House @Description Create new house with relevant data @Tags houses @Accept json @Produce json @Param id path int true "House ID" Format(int64) @Success 200 {string} string "Successfully added new house." @Failure 404 {string} string "Internal server error." @Router /api/houses/{id} [post]
func GetAllDevices ¶
@Summary Get all Devices @Description Fetches a list of all devices from the database. @Tags devices @Accept json @Produce json @Success 200 {array} models.Device @Router /api/devices [get]
func GetAllRooms ¶
@Summary Get all Rooms @Description Fetches a list of all rooms from the database. @Tags rooms @Accept json @Produce json @Success 200 {array} models.Room @Router /api/rooms [get]
func GetAllRoomsByID ¶
@Summary Get a Room by ID @Description Retrieve a room's information by its unique ID. @Tags rooms @Accept json @Produce json @Param id path int true "Room ID" Format(int64) @Success 200 {object} models.Room @Failure 404 {string} string "Room with that ID doesn't exist." @Router /api/rooms/{id} [get]
func GetAllUsers ¶
@Summary Get all users from the database @Description Fetch all users from the database (administrator permission needed) @Tags users @Accept json @Produce json @Success 200 {array} models.User @Router /api/users [get]
func GetDeviceById ¶
@Summary Get a Device by ID @Description Retrieve a device's information by its unique ID. @Tags devices @Accept json @Produce json @Param id path int true "Device ID" Format(int64) @Success 200 {object} models.Device @Failure 404 {string} string "Device with that ID doesn't exist." @Router /api/devices/{id} [get]
func GetHouseById ¶
@Summary Get House by ID @Description Retrieve a house's information by its unique ID @Tags houses @Accept json @Produce json @Param id path int true "House ID" Format(int64) @Success 200 {object} models.House @Failure 404 {string} string "House with that ID doesn't exist." @Router /api/houses/{id} [get]
func GetNumberOfActiveDevices ¶
@Summary Get Number of Active Devices @Description Retrieves the total number of active devices. @Tags analytics @Accept json @Produce json @Success 200 {integer} int64 @Router /api/analytics/activedevices [get]
func GetNumberOfAllDevices ¶
@Summary Get Number of All Devices @Description Retrieves the total number of devices in the database. @Tags analytics @Accept json @Produce json @Success 200 {integer} int64 @Router /api/analytics/devices [get]
func GetNumberOfAllHouses ¶
@Summary Get Number of All Houses @Description Retrieves the total number of houses. @Tags analytics @Accept json @Produce json @Success 200 {integer} int64 @Router /api/analytics/houses [get]
func GetNumberOfAllRooms ¶
@Summary Get Number of All Rooms @Description Retrieves the total number of rooms in the database. @Tags analytics @Accept json @Produce json @Success 200 {integer} int64 @Router /api/analytics/rooms [get]
func GetUserByID ¶
@Summary Get a User by ID @Description Retrieve a user's information by their unique ID. @Tags users @Accept json @Produce json @Param id path int true "User ID" Format(int64) @Success 200 {object} models.User @Failure 404 {string} string "User with that ID doesn't exist" @Router /api/users/{id} [get]
func Login ¶
@Summary User Login @Description Authenticates a user based on provided email and password. @Tags users @Accept json @Produce json @Param email body string true "User's email address" Format(email) @Param password body string true "User's password" @Success 200 {object} models.User @Failure 400 {string} string "Bad Request" @Failure 401 {string} string "Invalid Password" @Failure 404 {string} string "User with that credentials doesn't exist." @Router /api/users/login [post]
func Register ¶
@Summary User Registration @Description Creates a new user account with the provided information. @Tags users @Accept json @Produce json @Param name body string true "User's first name" @Param surname body string true "User's last name" @Param email body string true "User's email address" Format(email) @Param password body string true "User's password" @Param city body string true "User's city" @Success 200 {string} string "Account successfully registered." @Failure 400 {string} string "Invalid request data" @Failure 400 {string} string "All fields are required" @Failure 409 {string} string "User already exists." @Failure 500 {string} string "Internal server error." @Router /api/users/register [post]
Types ¶
This section is empty.