package dto import "time" type File struct { BasePath string `json:"basePath"` Url string `json:"url"` Path string `json:"path"` Name string `json:"name"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` } func (f *File) GetDiffMs() int64 { return f.EndTime.Sub(f.StartTime).Milliseconds() }