package model import "time" // Role 角色模型 type Role struct { Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"` Name string `gorm:"column:name;type:varchar(50);not null" json:"name"` Code string `gorm:"column:code;type:varchar(50);uniqueIndex;not null" json:"code"` Description string `gorm:"column:description;type:varchar(255);default:''" json:"description"` IsSystem bool `gorm:"column:is_system;default:false" json:"isSystem"` SortOrder int `gorm:"column:sort_order;default:0" json:"sortOrder"` Status int `gorm:"column:status;default:1" json:"status"` CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"` UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"` } func (Role) TableName() string { return "role" }