Last active
July 31, 2019 13:48
-
-
Save kamal-kambe/9d423e2b2996bd6c148d6e4bb60268c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model | |
import ( | |
"encoding/json" | |
"time" | |
) | |
type Building struct { | |
ID uint `gorm:"primary_key" json:"id"` | |
CreatedAt time.Time `json:"-"` | |
DeletedAt *time.Time `sql:"index" json:"-"` | |
Name string `gorm:"UNIQUE; not null" json:"name"` | |
DisplayName string `json:"display_name"` | |
Version uint `json:"version"` | |
BuildingLevels []*BuildingLevel | |
} | |
type BuildingLevel struct { | |
ID uint `gorm:"primary_key" json:"id"` | |
CreatedAt time.Time `json:"-"` | |
DeletedAt *time.Time `sql:"index" json:"-"` | |
BuildingID uint | |
LevelNo uint | |
Costs json.RawMessage `sql:"type:json"` | |
Version uint | |
} | |
type Quest struct { | |
ID uint `gorm:"primary_key" json:"id"` | |
CreatedAt time.Time `json:"-"` | |
DeletedAt *time.Time `sql:"index" json:"-"` | |
Name string `json:"name"` | |
Category string `json:"category"` | |
Description string `sql:"type:text"` | |
DependentQuestID uint `json:"dependent_quest_id"` | |
Task json.RawMessage `sql:"type:json"` | |
RequiredQuantity uint `gorm:"default:1" json:"required_quantity"` | |
Reward json.RawMessage `sql:"type:json"` | |
Version uint `json:"version"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment