service/erp/bean/file.go

19 lines
308 B
Go
Raw Normal View History

2024-09-03 17:47:24 +08:00
package bean
import "encoding/json"
type FileData struct {
Name string `json:"name"`
Path string `json:"path"`
}
func (f FileData) ToString() string {
marshal, _ := json.Marshal(f)
return string(marshal)
}
func (f FileData) Parse(data string) FileData {
json.Unmarshal([]byte(data), &f)
return f
}