19 lines
623 B
Go
19 lines
623 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Snippet struct {
|
|
ID string `json:"id" gorm:"primaryKey"`
|
|
Name string `json:"name" gorm:"type:varchar(255)"`
|
|
Content string `json:"content" gorm:"type:text"`
|
|
Visibility string `json:"visibility" gorm:"type:varchar(20);default:'private'"`
|
|
CreatedBy string `json:"createdBy" gorm:"type:varchar(36)"`
|
|
CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"`
|
|
UpdatedBy string `json:"updatedBy" gorm:"type:varchar(36)"`
|
|
UpdatedAt time.Time `json:"updatedAt" gorm:"autoUpdateTime"`
|
|
}
|
|
|
|
func (r Snippet) TableName() string {
|
|
return "snippets"
|
|
}
|