Documentation ¶
Index ¶
Constants ¶
View Source
const TableNameBook = "books"
View Source
const TableNameCar = "cars"
View Source
const TableNameMovie = "movies"
View Source
const TableNamePlayer = "players"
View Source
const TableNameSong = "songs"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { ID uint64 `gorm:"column:id;type:bigint unsigned;primaryKey;autoIncrement:true" json:"id"` CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;index:deleted_at,priority:1" json:"deleted_at"` Title string `gorm:"column:title;type:varchar(200);not null;index:title,priority:1;comment:书籍名称" json:"title"` // 书籍名称 Author string `gorm:"column:author;type:varchar(200);not null;comment:作者" json:"author"` // 作者 Genre string `gorm:"column:genre;type:varchar(200);not null;comment:分类" json:"genre"` // 分类 }
Book mapped from table <books>
type Car ¶
type Car struct { ID uint64 `gorm:"column:id;type:bigint unsigned;primaryKey;autoIncrement:true" json:"id"` CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;index:deleted_at,priority:1" json:"deleted_at"` Type string `gorm:"column:type;type:varchar(200);not null;comment:车辆类型" json:"type"` // 车辆类型 Fuel string `gorm:"column:fuel;type:varchar(200);not null;comment:燃料" json:"fuel"` // 燃料 Transmission string `gorm:"column:transmission;type:varchar(200);not null;comment:传动结构" json:"transmission"` // 传动结构 Brand string `gorm:"column:brand;type:varchar(200);not null;comment:品牌" json:"brand"` // 品牌 Model string `gorm:"column:model;type:varchar(200);not null;comment:型号" json:"model"` // 型号 Year int32 `gorm:"column:year;type:int;not null;comment:生产年份" json:"year"` // 生产年份 }
Car mapped from table <cars>
type Movie ¶
type Movie struct { ID uint64 `gorm:"column:id;type:bigint unsigned;primaryKey;autoIncrement:true" json:"id"` CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;index:deleted_at,priority:1" json:"deleted_at"` Name string `gorm:"column:name;type:varchar(200);not null;index:name,priority:1;comment:电影名称" json:"name"` // 电影名称 Genre string `gorm:"column:genre;type:varchar(200);not null;comment:分类" json:"genre"` // 分类 Version uint64 `gorm:"column:version;type:bigint unsigned;not null;comment:乐观锁版本号" json:"version"` // 乐观锁版本号 }
Movie mapped from table <movies>
type Player ¶
type Player struct { ID uint64 `gorm:"column:id;type:bigint unsigned;primaryKey;autoIncrement:true" json:"id"` CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;index:deleted_at,priority:1" json:"deleted_at"` Name string `gorm:"column:name;type:varchar(200);not null;comment:姓名" json:"name"` // 姓名 Phone string `gorm:"column:phone;type:varchar(200);not null;index:phone,priority:1;comment:电话" json:"phone"` // 电话 Email string `gorm:"column:email;type:varchar(200);not null;index:email,priority:1;comment:邮件地址" json:"email"` // 邮件地址 Gold int64 `gorm:"column:gold;type:bigint;not null;comment:金币数量" json:"gold"` // 金币数量 Extra datatypes.JSON `gorm:"column:extra;type:json;comment:扩展信息" json:"extra"` // 扩展信息 }
Player mapped from table <players>
type Song ¶
type Song struct { ID uint64 `gorm:"column:id;type:bigint unsigned;primaryKey;autoIncrement:true" json:"id"` CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;index:deleted_at,priority:1" json:"deleted_at"` Title string `gorm:"column:title;type:varchar(200);not null;index:title,priority:1;comment:歌曲名称" json:"title"` // 歌曲名称 Artist string `gorm:"column:artist;type:varchar(200);not null;comment:艺术家" json:"artist"` // 艺术家 Album string `gorm:"column:album;type:varchar(200);not null;comment:专辑" json:"album"` // 专辑 Bpm int32 `gorm:"column:bpm;type:int;not null;comment:BPM" json:"bpm"` // BPM OriginFile string `gorm:"column:origin_file;type:varchar(500);not null;index:origin_file,priority:1;comment:源文件路径" json:"origin_file"` // 源文件路径 Length float64 `gorm:"column:length;type:double;comment:歌曲长度" json:"length"` // 歌曲长度 Version uint64 `gorm:"column:version;type:bigint unsigned;not null;comment:乐观锁版本号" json:"version"` // 乐观锁版本号 }
Song mapped from table <songs>
Click to show internal directories.
Click to hide internal directories.