You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
846 B

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"`
}