package model import ( "gorm.io/gorm" ) // PersonalCustomer 个人客户模型 type PersonalCustomer struct { gorm.Model Phone string `gorm:"column:phone;type:varchar(20);uniqueIndex:idx_personal_customer_phone,where:deleted_at IS NULL;comment:手机号(唯一标识)" json:"phone"` Nickname string `gorm:"column:nickname;type:varchar(50);comment:昵称" json:"nickname"` AvatarURL string `gorm:"column:avatar_url;type:varchar(255);comment:头像URL" json:"avatar_url"` WxOpenID string `gorm:"column:wx_open_id;type:varchar(100);index;comment:微信OpenID" json:"wx_open_id"` WxUnionID string `gorm:"column:wx_union_id;type:varchar(100);index;comment:微信UnionID" json:"wx_union_id"` Status int `gorm:"column:status;type:int;not null;default:1;comment:状态 0=禁用 1=启用" json:"status"` } // TableName 指定表名 func (PersonalCustomer) TableName() string { return "tb_personal_customer" }