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.

41 lines
728 B
Go

4 months ago
package model
import (
"encoding/json"
"time"
)
type Claim struct {
ID int
PolicyNo string
BankName string
AccountName string
ContactName string
ContactPhone string
FileList string
BankCardNum string
BackPremium string
Reason string
Status string
Msg string
CreatedAt time.Time
UpdatedAt time.Time `json:"-"`
}
func (Claim) TableName() string {
return "claim"
}
func (a Claim) MarshalJSON() ([]byte, error) {
type Alias Claim
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),
})
}