catface_backend_go/app/model/encounter_result.go

27 lines
980 B
Go
Raw Permalink Normal View History

2024-10-20 21:01:12 +08:00
package model
import "time"
2024-10-20 21:02:22 +08:00
// TIP 用这种方式绑定 GORM 的 Raw 就会比较有效了。
2024-10-20 21:01:12 +08:00
type EncounterList struct {
2024-10-21 00:24:48 +08:00
Id int `form:"id" json:"id"`
UserId int `form:"user_id" json:"user_id"`
Title string `form:"title" json:"title"`
Avatar string `form:"avatar" json:"url"`
AvatarHeight int `form:"avatar_height" json:"height"`
AvatarWidth int `form:"avatar_width" json:"width"`
UpdatedAt *time.Time `form:"updated_at" json:"time"` // TIP 设为 *time.Timeomitempty 和 autoUpdated 就都可以生效
2024-10-20 21:01:12 +08:00
Like bool `form:"ue_like" json:"like"`
UseAnimalAvatar bool `form:"use_animal_avatar" json:"use_animal_avatar"`
UserName string `form:"user_name" json:"user_name"`
UserAvatar string `form:"user_avatar" json:"user_avatar"`
2024-10-20 21:01:12 +08:00
}
2024-10-21 16:31:53 +08:00
type EncounterDetail struct {
2024-10-23 01:33:34 +08:00
Encounter Encounter `json:"encounter"`
2024-10-21 16:31:53 +08:00
UsersModel UsersModel `json:"user"`
Animals []Animal `json:"animals"`
}