package model type Country struct { // 国家 ID uint `gorm:"primaryKey" json:"id"` // 主键ID Adcode string `gorm:"unique;size:20" json:"adcode"` // 地区id Name string `gorm:"size:100" json:"name"` // 名称 Abbr string `gorm:"size:50" json:"abbr"` // 简称 Lng float64 `gorm:"type:decimal(10,7)" json:"lng"` // 经度 Lat float64 `gorm:"type:decimal(10,7)" json:"lat"` // 纬度 Status int `gorm:"type:tinyint(1);default:1" json:"status"` // 状态 0:下架 1:上架 } func (Country) TableName() string { return "country" }