model

package
v0.0.0-...-0259ebf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	ID       int    `json:"id" gorm:"primaryKey;autoIncrement"`
	Name     string `json:"name" gorm:"uniqueIndex;size:255;not null"`
	Password string `json:"password" gorm:"not null"`
	Email    string `json:"email"  gorm:"not null"`
}

func (Admin) TableName

func (Admin) TableName() string

type Pager

type Pager struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
}

type Resv

type Resv struct {
	ID          int        `json:"id" gorm:"primaryKey; autoIncrement"`
	UserID      int        `json:"user_id" gorm:"index"`
	SeatID      int        `json:"seat_id" gorm:"index"`
	CreateTime  *time.Time `json:"create_time"`
	StartTime   *time.Time `json:"start_time"`
	EndTime     *time.Time `json:"end_time"`
	SigninTime  *time.Time `json:"signin_time"`
	SignoutTime *time.Time `json:"signout_time"`
	Status      int        `json:"status"`
}

func (Resv) CalculateTimeBits

func (r Resv) CalculateTimeBits(startTime, endTime time.Time) (int, int)

func (Resv) TableName

func (Resv) TableName() string

type Room

type Room struct {
	ID          int    `json:"id" gorm:"primaryKey;autoIncrement"`
	Name        string `json:"name"`
	Capacity    int    `json:"capacity"`
	OpenTime    string `json:"opening_time"`
	CloseTime   string `json:"closing_time"`
	Location    string `json:"location"`
	Description string `json:"description"`
	Status      int    `json:"status"`
}

func (Room) TableName

func (Room) TableName() string

type Seat

type Seat struct {
	ID          int    `json:"id" gorm:"primaryKey; autoIncrement"`
	RoomID      int    `json:"room_id" gorm:"index; not null"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Status      int    `json:"status"`
}

func (Seat) TableName

func (Seat) TableName() string

type User

type User struct {
	ID       int    `json:"id" gorm:"primaryKey;autoIncrement"`
	Username string `json:"username" gorm:"uniqueIndex;size:255;not null"`
	Password string `json:"password" gorm:"not null"`
	Email    string `json:"email"  gorm:"not null"`
}

func (User) TableName

func (User) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL