feat: temp upload

This commit is contained in:
fallen-angle
2022-04-13 19:48:10 +08:00
parent 80ca1cd46e
commit fc347a4140
15 changed files with 155 additions and 8 deletions

43
models/investigate.go Normal file
View File

@@ -0,0 +1,43 @@
package models
import (
"fmt"
"time"
)
type FakerDate time.Time
const (
timeFormat = "2006-01-02"
)
func (t *FakerDate) UnmarshalJSON(data []byte) (err error) {
fmt.Println(string(data))
newTime, err := time.ParseInLocation(`"`+timeFormat+`"`, string(data), time.Local)
*t = FakerDate(newTime)
return
}
func (t FakerDate) MarshalJSON() ([]byte, error) {
fmt.Println(time.Time(t).Format(timeFormat))
timeStr := fmt.Sprintf("\"%s\"", time.Time(t).Format(timeFormat))
return []byte(timeStr), nil
}
func (t FakerDate) String() string {
return time.Time(t).Format(timeFormat)
}
type HotelContactRequest struct {
Name string `json:"name"`
Age int `json:"age,string"`
Sex int `json:"sex,string"`
Phone string `json:"phone"`
Address string `json:"address"`
HotelCode string `json:"hotel_code"`
HotelName string `json:"hotel_name"`
LocateCityId string `json:"locate_city_id"`
Identification string `json:"identification"`
InData FakerDate `json:"in_data"`
OutData FakerDate `json:"out_data"`
}