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.

42 lines
912 B
Go

2 months ago
package model
import (
"encoding/json"
"time"
)
type StudentInsureInfo struct {
ID int
SchoolName string
StudentName string
StudentIdentityNo string
StudentIdentityType uint
ParentName string
College string
Speciality string
Class string
Relation string
ParentIdentityNo string
ParentIdentityType uint
ParentMobile string
CreatedAt time.Time
UpdatedAt time.Time `json:"-"`
}
func (StudentInsureInfo) TableName() string {
return "student_insure_info"
}
func (a StudentInsureInfo) MarshalJSON() ([]byte, error) {
type Alias StudentInsureInfo
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),
})
}