Improved models' structure
This commit is contained in:
24
resource.go
24
resource.go
@@ -34,19 +34,20 @@ var extensions = [...]string{
|
||||
type Resource interface{
|
||||
GetType() ResourceType
|
||||
getOneResourceByID() Resource
|
||||
StoreOne() Resource
|
||||
}
|
||||
|
||||
type AbstractResource struct {
|
||||
Uuid string `json:"Id" required:"true" `
|
||||
Name string `json:"Name" required:"true" `
|
||||
ShortDescription string
|
||||
Description string
|
||||
Logo string
|
||||
Owner string
|
||||
OwnerLogo string
|
||||
SourceUrl string
|
||||
Uuid string `json:"uuid" required:"true" bson:"uuid"`
|
||||
Name string `json:"name" required:"true" bson:"name"`
|
||||
ShortDescription string `json:"short_description" required:"true" bson:"short_description"`
|
||||
Description string `json:"description,omitempty" bson:"description"`
|
||||
Logo string `json:"logo" required:"true" bson:"logo"`
|
||||
Owner string `json:"owner" required:"true" bson:"owner"`
|
||||
OwnerLogo string `json:"owner_logo" required:"true" bson:"owner_logo"`
|
||||
SourceUrl string `json:"source_url" required:"true" bson:"source_url"`
|
||||
|
||||
Graphic GraphicElement `json:"GraphicElement" `
|
||||
Graphic GraphicElement `json:"graphic,omitempty" bson:"protocol"`
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +81,7 @@ func getObjIDFromString(id string) interface{} {
|
||||
}
|
||||
|
||||
func postToMongo(id string) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (r *AbstractResource) isLinked(){
|
||||
@@ -91,4 +92,5 @@ func (r *AbstractResource) isLinked(){
|
||||
|
||||
// func (r *Resource) GetType() ResourceType {
|
||||
// return INVALID
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user