package model import ( "time" "github.com/shopspring/decimal" ) type UserDetail struct { CreatedAndModifiedWithUser `xorm:"extends"` DeletedWithUser `xorm:"extends"` Id string `xorm:"varchar(120) pk not null" json:"-"` Name *string `xorm:"varchar(100)" json:"name"` Abbr *string `xorm:"varchar(50)" json:"abbr"` Region *string `xorm:"varchar(10)" json:"region"` Address *string `xorm:"varchar(120)" json:"address"` Contact *string `xorm:"varchar(100)" json:"contact"` Phone *string `xorm:"varchar(50)" json:"phone"` UnitServiceFee decimal.Decimal `xorm:"numeric(8,2) not null" json:"unitServiceFee"` ServiceExpiration time.Time `xorm:"date not null" json:"serviceExpiration" time_format:"simple_date" time_location:"shanghai"` } func (UserDetail) TableName() string { return "user_detail" } type JoinedUserDetail struct { UserDetail `xorm:"extends"` Id string `json:"id"` Username string `json:"username"` Type int8 `json:"type"` Enabled bool `json:"enabled"` } func (JoinedUserDetail) TableName() string { return "user" } type FullJoinedUserDetail struct { UserDetail `xorm:"extends"` User `xorm:"extends"` } func (FullJoinedUserDetail) TableName() string { return "user_detail" } type UserDetailSimplified struct { Id string `xorm:"varchar(120) pk not null" json:"id"` Name *string `xorm:"varchar(100)" json:"name"` Abbr *string `xorm:"varchar(50)" json:"abbr"` Region *string `xorm:"varchar(10)" json:"region"` Address *string `xorm:"varchar(120)" json:"address"` Contact *string `xorm:"varchar(100)" json:"contact"` Phone *string `xorm:"varchar(50)" json:"phone"` } func (UserDetailSimplified) TableName() string { return "user_detail" }