From 78157b80d26743596534f03e271cd47c10426b81 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 14 Jan 2025 08:42:12 +0100 Subject: [PATCH] kick out geopoint useless --- models/resources/resource.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/models/resources/resource.go b/models/resources/resource.go index 5885f5b..1ccda72 100644 --- a/models/resources/resource.go +++ b/models/resources/resource.go @@ -10,7 +10,6 @@ import ( "cloud.o-forge.io/core/oc-lib/models/utils" "cloud.o-forge.io/core/oc-lib/tools" "github.com/biter777/countries" - "github.com/marcinwyszynski/geopoint" ) // AbstractResource is the struct containing all of the attributes commons to all ressources @@ -119,14 +118,18 @@ func verifyAuthAction[T ResourceInstanceITF](baseInstance []T, request *tools.AP return instances } +type GeoPoint struct { + Latitude float64 `json:"latitude,omitempty" bson:"latitude,omitempty"` + Longitude float64 `json:"longitude,omitempty" bson:"longitude,omitempty"` +} + type ResourceInstance[T ResourcePartnerITF] struct { - UUID string `json:"id,omitempty" bson:"id,omitempty"` - Name string `json:"name,omitempty" bson:"name,omitempty"` - Location geopoint.GeoPoint `json:"location,omitempty" bson:"location,omitempty"` - Country countries.CountryCode `json:"country,omitempty" bson:"country,omitempty"` - // Url string `json:"url,omitempty" bson:"url,omitempty"` - AccessProtocol string `json:"access_protocol,omitempty" bson:"access_protocol,omitempty"` - Partnerships []T `json:"partner_resource,omitempty" bson:"partner_resource,omitempty"` + UUID string `json:"id,omitempty" bson:"id,omitempty"` + Name string `json:"name,omitempty" bson:"name,omitempty"` + Location GeoPoint `json:"location,omitempty" bson:"location,omitempty"` + Country countries.CountryCode `json:"country,omitempty" bson:"country,omitempty"` + AccessProtocol string `json:"access_protocol,omitempty" bson:"access_protocol,omitempty"` + Partnerships []T `json:"partner_resource,omitempty" bson:"partner_resource,omitempty"` } func (ri *ResourceInstance[T]) GetID() string {