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.
47 lines
1.0 KiB
Go
47 lines
1.0 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type Assured struct {
|
|
ID int
|
|
OrderNo string
|
|
AssuredName string
|
|
ComTelArea string
|
|
CreditCode string
|
|
CreditVld string
|
|
ContactName string
|
|
ContactMobile string
|
|
TenderBankAccount string
|
|
TenderBankOpenbank string
|
|
TenderAccountName string
|
|
Province string
|
|
City string
|
|
District string
|
|
Address string
|
|
ComTelNum string
|
|
Agency string
|
|
Order *Order `gorm:"foreignKey:OrderNo;references:OrderNo"`
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time `json:"-"`
|
|
}
|
|
|
|
func (Assured) TableName() string {
|
|
return "assured"
|
|
}
|
|
|
|
func (a Assured) MarshalJSON() ([]byte, error) {
|
|
type Alias Assured
|
|
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),
|
|
})
|
|
}
|