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.

48 lines
963 B
Go

package model
import (
"encoding/json"
"time"
)
type Applicant struct {
ID int
OrderSn string
ApplicantName string
CreditVld string
CreditCode string
ContactName string
ContactMobile string
ComTelArea string
Province string
City string
District string
Address string
Email string
LegalName string
LegalNum string
ComTelNum string
LicenseFiles string
SignUrl string
Order *Order `gorm:"foreignKey:OrderSn;references:OrderSn"`
CreatedAt time.Time
UpdatedAt time.Time `json:"-"`
}
func (Applicant) TableName() string {
return "applicant"
}
func (a Applicant) MarshalJSON() ([]byte, error) {
type Alias Applicant
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),
})
}