You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type OrderResult struct {
|
|
ID int
|
|
OrderSn string
|
|
PolicyNo string
|
|
MinPremium string
|
|
Rate string
|
|
Status string
|
|
ServiceAmount string
|
|
GuranteeLink string
|
|
GuranteeLinkMd5 string
|
|
GuranteeOfdLink string
|
|
GuranteeOfdLinkMd5 string
|
|
InvoiceLink string
|
|
InvoiceLinkMd5 string
|
|
ConfirmReceiptLink string
|
|
ConfirmReceiptLinkMd5 string
|
|
Remark string
|
|
Order *Order `gorm:"foreignKey:OrderSn;references:OrderSn"`
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time `json:"-"`
|
|
}
|
|
|
|
func (OrderResult) TableName() string {
|
|
return "order_result"
|
|
}
|
|
|
|
func (a OrderResult) MarshalJSON() ([]byte, error) {
|
|
type Alias OrderResult
|
|
return json.Marshal(&struct {
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
*Alias
|
|
}{
|
|
CreatedAt: a.CreatedAt.Format("2006-01-02 15:04:05"),
|
|
UpdatedAt: a.UpdatedAt.Format("2006-01-02 15:04:05"),
|
|
Alias: (*Alias)(&a),
|
|
})
|
|
}
|