package types import ( "net/http" "time" "gorm.io/gorm" ) /* Base Model */ type Building struct { ID uint64 `gorm:"primarykey" json:"id"` Name string `json:"name"` ShelfLocations []ShelfLocation `json:"shelves,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"` } /* Requests */ type CreateBuildingRequest struct { Name string `json:"name"` } func (c CreateBuildingRequest) Bind(r *http.Request) error { return nil } /* Responses */ type BuildingResponse struct { *Response Building *Building `json:"building"` } type MultipleBuildingResponse struct { *Response Buildings []*Building `json:"buildings"` Total int64 `json:"total"` }