From 103745fe76e1a6796d97d789f741b052d02a34c4 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Thu, 22 Aug 2024 13:24:20 -0400 Subject: [PATCH] merge: models dans entity.go --- models/models.go => entity.go | 2 +- handler.go | 10 ++++------ response.go | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) rename models/models.go => entity.go (85%) diff --git a/models/models.go b/entity.go similarity index 85% rename from models/models.go rename to entity.go index 9ef3c9e..bc34cf5 100644 --- a/models/models.go +++ b/entity.go @@ -1,4 +1,4 @@ -package models +package main type Bucket struct { Name string diff --git a/handler.go b/handler.go index abca06b..5287d4d 100644 --- a/handler.go +++ b/handler.go @@ -11,16 +11,14 @@ import ( "codeberg.org/vlbeaudoin/pave/v2" "codeberg.org/vlbeaudoin/voki/v3" "git.agecem.com/agecem/agecem-org/api" - "git.agecem.com/agecem/agecem-org/config" "git.agecem.com/agecem/agecem-org/media" - "git.agecem.com/agecem/agecem-org/models" "git.agecem.com/agecem/agecem-org/version" "github.com/labstack/echo/v4" "github.com/minio/minio-go/v7" ) type V1Handler struct { - Config config.Config + Config Config MediaClient *media.MediaClient Pave *pave.Pave } @@ -628,7 +626,7 @@ func (h *WebHandler) HandleDocumentation(c echo.Context) error { return c.Render(http.StatusOK, "documentation-html", response) } - response.Data.Buckets = append(response.Data.Buckets, models.Bucket{ + response.Data.Buckets = append(response.Data.Buckets, Bucket{ Name: bucket, DisplayName: displayName, Documents: v1BucketReadResponse.Data.Keys, @@ -698,7 +696,7 @@ func (h *WebHandler) HandleAdminDocumentsUpload(c echo.Context) error { } for bucketName, displayName := range v1BucketsGET.Data.Buckets { - response.Data.Buckets = append(response.Data.Buckets, models.Bucket{ + response.Data.Buckets = append(response.Data.Buckets, Bucket{ Name: bucketName, DisplayName: displayName, }) @@ -722,7 +720,7 @@ func (h *WebHandler) HandleAdminDocumentsUploadPOST(c echo.Context) error { } for bucketName, displayName := range v1BucketsGET.Data.Buckets { - response.Data.Buckets = append(response.Data.Buckets, models.Bucket{ + response.Data.Buckets = append(response.Data.Buckets, Bucket{ Name: bucketName, DisplayName: displayName, }) diff --git a/response.go b/response.go index bbfed83..b2379b8 100644 --- a/response.go +++ b/response.go @@ -7,7 +7,6 @@ package main import ( "codeberg.org/vlbeaudoin/voki/v3" - "git.agecem.com/agecem/agecem-org/models" ) type APIResponse struct { @@ -89,7 +88,7 @@ type ReadSpecResponse struct { type HandleAdminDocumentsUploadResponse struct { APIResponse Data struct { - Buckets []models.Bucket + Buckets []Bucket } } @@ -97,7 +96,7 @@ type HandleAdminDocumentsUploadResponse struct { type HandleDocumentationResponse struct { APIResponse Data struct { - Buckets []models.Bucket + Buckets []Bucket } }