Documentation ¶
Index ¶
- Variables
- func CreateTreeCluster(svc service.TreeClusterService) fiber.Handler
- func DeleteTreeCluster(svc service.TreeClusterService) fiber.Handler
- func GetAllTreeClusters(svc service.TreeClusterService) fiber.Handler
- func GetTreeClusterByID(svc service.TreeClusterService) fiber.Handler
- func RegisterRoutes(r fiber.Router, svc service.TreeClusterService)
- func UpdateTreeCluster(svc service.TreeClusterService) fiber.Handler
Constants ¶
This section is empty.
Variables ¶
var ( TestCluster = &entities.TreeCluster{ ID: 1, Name: "Test Cluster", Address: "456 New St", Description: "Description", WateringStatus: entities.WateringStatusBad, Region: &entities.Region{ID: 1, Name: "Region 1"}, Archived: false, Latitude: utils.P(testLatitude), Longitude: utils.P(testLongitude), SoilCondition: entities.TreeSoilConditionSandig, Trees: []*entities.Tree{ { ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now(), Species: "Oak", Number: "T001", Latitude: testLatitude, Longitude: testLongitude, Description: "A mature oak tree", PlantingYear: 2023, Readonly: true, }, }, } TestClusterRequest = serverEntities.TreeClusterCreateRequest{ Name: "Cluster Request", Address: "123 Main St", Description: "Test description", SoilCondition: serverEntities.TreeSoilConditionSandig, TreeIDs: []*int32{utils.P(int32(1))}, } TestClusterList = []*entities.TreeCluster{ TestCluster, { ID: 2, Name: "Second Cluster", Address: "789 Another St", Description: "Another description", WateringStatus: entities.WateringStatusGood, Region: &entities.Region{ID: 2, Name: "Region 2"}, Archived: false, Latitude: utils.P(testLatitude), Longitude: utils.P(testLongitude), SoilCondition: entities.TreeSoilConditionLehmig, Trees: []*entities.Tree{}, }, } )
Functions ¶
func CreateTreeCluster ¶
func CreateTreeCluster(svc service.TreeClusterService) fiber.Handler
@Summary Create tree cluster @Description Create tree cluster @Id create-tree-cluster @Tags Tree Cluster @Produce json @Success 201 {object} entities.TreeClusterResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/cluster [post] @Param body body entities.TreeClusterCreateRequest true "Tree Cluster Create Request" @Security Keycloak
func DeleteTreeCluster ¶
func DeleteTreeCluster(svc service.TreeClusterService) fiber.Handler
@Summary Delete tree cluster @Description Delete tree cluster @Id delete-tree-cluster @Tags Tree Cluster @Produce json @Success 204 @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/cluster/{cluster_id} [delete] @Param cluster_id path string true "Tree Cluster ID" @Security Keycloak
func GetAllTreeClusters ¶
func GetAllTreeClusters(svc service.TreeClusterService) fiber.Handler
@Summary Get all tree clusters @Description Get all tree clusters @Id get-all-tree-clusters @Tags Tree Cluster @Produce json @Success 200 {object} entities.TreeClusterListResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/cluster [get] @Param page query string false "Page" @Param limit query string false "Limit" @Param status query string false "Status" @Security Keycloak
func GetTreeClusterByID ¶
func GetTreeClusterByID(svc service.TreeClusterService) fiber.Handler
@Summary Get tree cluster by ID @Description Get tree cluster by ID @Id get-tree-cluster-by-id @Tags Tree Cluster @Produce json @Success 200 {object} entities.TreeClusterResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/cluster/{cluster_id} [get] @Param cluster_id path string true "Tree Cluster ID" @Security Keycloak
func RegisterRoutes ¶
func RegisterRoutes(r fiber.Router, svc service.TreeClusterService)
func UpdateTreeCluster ¶
func UpdateTreeCluster(svc service.TreeClusterService) fiber.Handler
@Summary Update tree cluster @Description Update tree cluster @Id update-tree-cluster @Tags Tree Cluster @Produce json @Success 200 {object} entities.TreeClusterResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/cluster/{cluster_id} [put] @Param cluster_id path string true "Tree Cluster ID" @Param body body entities.TreeClusterUpdateRequest true "Tree Cluster Update Request" @Security Keycloak
Types ¶
This section is empty.