123456789101112131415161718192021222324252627 |
- package request
- import "time"
- type Location struct {
- ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"`
- AddressID int64 `gorm:"not null" json:"address_id"`
- Lon float32 `json:"lon"` // 经度(Longitude)
- Lat float32 `json:"lat"` // 纬度(Latitude)
- CreatedAt time.Time `json:"created_at"`
- UpdatedAt *time.Time `json:"updated_at"`
- }
- type Address struct {
- ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"`
- UserID int64 `gorm:"not null" json:"user_id"`
- Country string `json:"country"` // 国家
- Province string `json:"province"` // 省
- City string `json:"city"` // 市
- District string `json:"district"` // 区
- Street string `json:"street"` // 街道
- Remark string `json:"remark"` // 详细地址
- Location Location `gorm:"foreignKey:AddressID" json:"location"` // 地理位置
- IsDefault int32 `json:"is_default"` // 默认地址 0 | 1
- CreatedAt time.Time `json:"created_at"`
- UpdatedAt *time.Time `json:"updated_at"`
- }
|