| package models | |
| import ( | |
| "time" | |
| ) | |
| type User struct { | |
| ID uint `gorm:"primaryKey" json:"id"` | |
| Username string `gorm:"uniqueIndex;size:50;not null" json:"username"` | |
| Password string `gorm:"not null" json:"-"` | |
| CreatedAt time.Time `json:"created_at"` | |
| Pastes []Paste `gorm:"foreignKey:UserID" json:"pastes,omitempty"` | |
| } | |