27 lines
702 B
Go
27 lines
702 B
Go
package model
|
|
|
|
import "encoding/json"
|
|
|
|
type UploadFile struct {
|
|
Id string `json:"id" gorm:"primary_key"`
|
|
Data []byte `json:"-"`
|
|
FileName string `json:"fileName"`
|
|
FileSize int64 `json:"fileSize"`
|
|
Sort int `json:"sort"`
|
|
CreateBy string `json:"createBy"`
|
|
CreateTime int64 `json:"createTime"`
|
|
UpdateBy string `json:"updateBy"`
|
|
UpdateTime int64 `json:"updateTime"`
|
|
State string `json:"state"`
|
|
Del int `json:"del"`
|
|
}
|
|
|
|
func (file *UploadFile) MarshalBinary() (data []byte, err error) {
|
|
// encoding.BinaryMarshaler
|
|
return json.Marshal(file)
|
|
}
|
|
|
|
func (file *UploadFile) UnmarshalBinary(data []byte) (err error) {
|
|
return json.Unmarshal(data, file)
|
|
}
|