minor changes

This commit is contained in:
pb 2024-04-04 16:44:46 +02:00
parent c140a742b8
commit 8cdc8e6965
2 changed files with 15 additions and 16 deletions

View File

@ -15,26 +15,13 @@ type DataNEWModel struct {
ShortDescription string `json:"short_description" required:"true" validate:"required"` ShortDescription string `json:"short_description" required:"true" validate:"required"`
Logo string `json:"logo" required:"true" validate:"required"` Logo string `json:"logo" required:"true" validate:"required"`
// Dtype string `json:"dtype"` Dtype string `json:"dtype"`
Type string `json:"type,omitempty" required:"true" validate:"required" description:"Define type of data" example:"file"` Type string `json:"type,omitempty" required:"true" validate:"required" description:"Define type of data" example:"file"`
Example string `json:"example" required:"true" validate:"required" description:"base64 encoded data"` Example string `json:"example" required:"true" validate:"required" description:"base64 encoded data"`
Protocol []string `json:"protocol"` //TODO Enum type Protocol []string `json:"protocol"` //TODO Enum type
Location string `json:"location" required:"true" validate:"required"` Location string `json:"location" required:"true" validate:"required"`
} }
type DataModel struct {
ID string `json:"ID" bson:"_id" required:"true" validate:"required"`
DataNEWModel `bson:",inline"`
}
func (obj DataModel) getRtype() rtype.Rtype {
return rtype.DATA
}
func (model DataModel) getName() string {
return model.Name
}
type DataIO struct { type DataIO struct {
Counter uint `description:"Incremental number starting from 0"` Counter uint `description:"Incremental number starting from 0"`
} }
@ -43,6 +30,18 @@ type DataObject struct {
ReferenceID primitive.ObjectID `json:"referenceID" description:"Data model ID"` ReferenceID primitive.ObjectID `json:"referenceID" description:"Data model ID"`
} }
type DataModel struct {
ID string `json:"ID" bson:"_id" required:"true" validate:"required"`
DataNEWModel `bson:",inline"`
}
func (obj DataModel) getRtype() rtype.Rtype {
return rtype.DATA
}
func (model DataModel) getName() string {
return model.Name
}
func (obj DataObject) getHost() *string { func (obj DataObject) getHost() *string {
return nil // Host is DC only attribute return nil // Host is DC only attribute
} }

View File

@ -32,9 +32,9 @@ type DatacenterGpuModel struct {
type DatacenterNEWModel struct { type DatacenterNEWModel struct {
Name string `json:"name" required:"true"` Name string `json:"name" required:"true"`
// Type string `json:"type,omitempty" required:"true"` Type string `json:"type,omitempty" required:"true"`
Acronym string `json:"acronym" required:"true" description:"id of the DC"` Acronym string `json:"acronym" required:"true" description:"id of the DC"`
// Hosts []string `json:"hosts" required:"true" description:"list of host:port"` Hosts []string `json:"hosts" required:"true" description:"list of host:port"`
Description string `json:"description" required:"true"` Description string `json:"description" required:"true"`
ShortDescription string `json:"short_description" required:"true" validate:"required"` ShortDescription string `json:"short_description" required:"true" validate:"required"`
Logo string `json:"logo" required:"true" validate:"required"` Logo string `json:"logo" required:"true" validate:"required"`