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.
53 lines
1.1 KiB
Go
53 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type Project struct {
|
|
ID int
|
|
OrderNo string
|
|
Name string
|
|
TpID string
|
|
BdID string
|
|
BdName string
|
|
StartDate string
|
|
Amount string
|
|
InsureAmount string
|
|
Province string
|
|
City string
|
|
District string
|
|
BzjEtime string
|
|
CreateTime string
|
|
PlanDate string
|
|
BuildPrice string
|
|
BuildPlace string
|
|
TenderProjectType string
|
|
ValidPeriod string
|
|
TenderNoticeUrl string
|
|
TenderFileUrl string
|
|
TenderFileUrlMd5 string
|
|
ProjectApprovalNo string
|
|
Order *Order `gorm:"foreignKey:OrderNo;references:OrderNo"`
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time `json:"-"`
|
|
}
|
|
|
|
func (Project) TableName() string {
|
|
return "project"
|
|
}
|
|
|
|
func (a Project) MarshalJSON() ([]byte, error) {
|
|
type Alias Project
|
|
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),
|
|
})
|
|
}
|