service/erp/bean/file.go
2024-09-03 17:47:24 +08:00

19 lines
308 B
Go

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
}