You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
package order
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"recook/internal/model/order_preview"
|
|
)
|
|
|
|
type Addr struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
OrderID uint `gorm:"column:order_id" json:"orderId"`
|
|
AddressID uint `gorm:"column:address_id" json:"addressId"`
|
|
Province string `gorm:"column:province" json:"province"`
|
|
City string `gorm:"column:city" json:"city"`
|
|
District string `gorm:"column:district" json:"district"`
|
|
Address string `gorm:"column:address" json:"address"`
|
|
ReceiverName string `gorm:"column:receiver_name" json:"receiverName"`
|
|
Mobile string `gorm:"column:mobile" json:"mobile"`
|
|
DeletedAt gorm.DeletedAt
|
|
}
|
|
|
|
// TableName sets the insert table name for this struct type
|
|
func (r *Addr) TableName() string {
|
|
return "recook_order_addr"
|
|
}
|
|
|
|
func (*Addr) Reflect(r *order_preview.Addr, o *Information) *Addr {
|
|
return &Addr{
|
|
OrderID: o.ID,
|
|
AddressID: r.AddressID,
|
|
Province: r.Province,
|
|
City: r.City,
|
|
District: r.District,
|
|
Address: r.Address,
|
|
ReceiverName: r.ReceiverName,
|
|
Mobile: r.Mobile,
|
|
}
|
|
}
|