2023-06-16 11:51:41 +00:00
|
|
|
|
package model
|
2023-06-16 11:04:13 +00:00
|
|
|
|
|
2023-06-16 11:29:48 +00:00
|
|
|
|
import (
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
|
)
|
2023-06-16 11:04:13 +00:00
|
|
|
|
|
2023-06-16 11:29:48 +00:00
|
|
|
|
// fs_address 用户地址表
|
2023-06-16 11:04:13 +00:00
|
|
|
|
type FsAddress struct {
|
2023-06-16 11:29:48 +00:00
|
|
|
|
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
|
2023-06-16 11:51:41 +00:00
|
|
|
|
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
2023-06-16 11:29:48 +00:00
|
|
|
|
Name *string `gorm:"default:'';" json:"name"` // 地址名称
|
|
|
|
|
FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName
|
|
|
|
|
LastName *string `gorm:"default:'';" json:"last_name"` // LastName
|
|
|
|
|
Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码
|
|
|
|
|
Street *string `gorm:"default:'';" json:"street"` // 街道
|
|
|
|
|
Suite *string `gorm:"default:'';" json:"suite"` // 房号
|
|
|
|
|
City *string `gorm:"default:'';" json:"city"` // 城市
|
|
|
|
|
State *string `gorm:"default:'';" json:"state"` // 州名
|
|
|
|
|
Country *string `gorm:"default:'';" json:"country"` // 国家
|
|
|
|
|
ZipCode *string `gorm:"default:'';" json:"zip_code"` // 邮编
|
|
|
|
|
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
|
|
|
|
IsDefault *int64 `gorm:"default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
2023-06-16 11:04:13 +00:00
|
|
|
|
}
|
2023-06-16 11:29:48 +00:00
|
|
|
|
type FsAddressModel struct{ db *gorm.DB }
|
2023-06-16 11:04:13 +00:00
|
|
|
|
|
2023-06-16 11:29:48 +00:00
|
|
|
|
func NewFsAddressModel(db *gorm.DB) *FsAddressModel { return &FsAddressModel{db} }
|