package card type IdCard struct { IdName string `json:"id_name"` IdNumber string `json:"id_number"` Flag string `json:"flag"` } type UnionIdCard struct { IdCard Id int `json:"id"` //shuyou_id_card的主键 UseCount int `json:"use_count"` //使用次数 UsageId int `json:"usage_id"` //shuyou_id_card_usage表的主键 } type IdCardUsage struct { Id int `json:"id"` IdIdCard int `json:"id_id_card" gorm:"column:id_idCard"` //主表id IdNumber string `json:"id_number"` //身份证号 Channel string `json:"channel"` //渠道 UseCount int `json:"use_count"` //使用次数 CreateTime string `json:"create_time" gorm:"column:createTime"` // 创建时间 UpdateTime string `json:"update_time" gorm:"column:updateTime"` // 更新时间 } func (IdCard) TableName() string { return "shuyou_id_card" } func (IdCardUsage) TableName() string { return "shuyou_id_card_usage" }