Documentation ¶
Index ¶
- Variables
- func BookSeat(ctx helpers.Context, classId int, userId, inOut string) map[string]interface{}
- func CreateSeats(rows, cols, classId int, ctx helpers.Context)
- type CheckInResponse
- type Classroom
- type Learning
- type OccupiedSeat
- type Seat
- type Setting
- type User
- func (o *User) BeforeSave() error
- func (o *User) Create(ctx helpers.Context) map[string]interface{}
- func (o *User) DeleteById(ctx helpers.Context) map[string]interface{}
- func (o *User) GetById(ctx helpers.Context, id string, params map[string][]string) map[string]interface{}
- func (o *User) GetByKey(ctx helpers.Context, key, value string) (*User, error)
- func (o *User) GetPaginated(ctx helpers.Context, params map[string][]string) map[string]interface{}
- func (o *User) IsEmailAvailable(ctx helpers.Context) (map[string]interface{}, error)
- func (o *User) IsPhoneAvailable(ctx helpers.Context) (map[string]interface{}, error)
- func (o *User) Schema() map[string]interface{}
- func (o *User) SetDefaultValue(ctx helpers.Context) (map[string]interface{}, error)
- func (o *User) UpdateById(ctx helpers.Context) map[string]interface{}
- type UserRole
- func (o *UserRole) Create(ctx helpers.Context) map[string]interface{}
- func (o *UserRole) DeleteById(ctx helpers.Context) map[string]interface{}
- func (o *UserRole) GetById(ctx helpers.Context, id string, params map[string][]string) map[string]interface{}
- func (o *UserRole) GetPaginated(ctx helpers.Context, params map[string][]string) map[string]interface{}
- func (o *UserRole) Schema() map[string]interface{}
- func (o *UserRole) SetDefaultValue(ctx helpers.Context) (map[string]interface{}, error)
- func (o *UserRole) UpdateById(ctx helpers.Context) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var Abjad string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Functions ¶
func CreateSeats ¶
Types ¶
type CheckInResponse ¶
type CheckInResponse struct { ClassID int `json:"class_id,omitempty" name:"class_id"` Rows int `json:"rows,omitempty"` Columns int `json:"columns,omitempty"` Teacher string `json:"teacher,omitempty"` AvailableSeat []string `json:"available_seats"` OccupiedSeat []OccupiedSeat `json:"occupied_seats"` Message string `json:"message,omitempty"` }
func (*CheckInResponse) SetAvailableSeats ¶
func (cr *CheckInResponse) SetAvailableSeats(ctx helpers.Context)
func (*CheckInResponse) SetOccupiedClass ¶
func (cr *CheckInResponse) SetOccupiedClass(ctx helpers.Context) map[string]interface{}
func (*CheckInResponse) SetOccupiedSeats ¶
func (cr *CheckInResponse) SetOccupiedSeats(ctx helpers.Context)
type Classroom ¶
type Classroom struct { ID int `json:"id,omitempty" form:"id,omitempty" query:"id,omitempty"` Name string `json:"name" gorm:"type:varchar(50)" validate:"required"` Rows int `json:"rows,omitempty" form:"rows,omitempty" query:"rows,omitempty" validate:"required"` Columns int `json:"columns,omitempty" form:"columns,omitempty" query:"columns,omitempty" validate:"required"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
func (*Classroom) CreateClass ¶
type Learning ¶
type Learning struct { ID string `json:"id,omitempty" form:"id,omitempty" query:"id,omitempty" gorm:"type:char(36)"` ClassID int `json:"class.id,omitempty" gorm:"type:char(36);index:learning_class_id"` ClassName string `json:"class.name,omitempty" gorm:"-"` SeatID string `json:"seat.id,omitempty" gorm:"type:char(36);index:learning_seat_id"` SeatName string `json:"seat.name,omitempty" gorm:"-"` UserID string `json:"user.id,omitempty" gorm:"type:char(36);index:learning_user_id"` UserName string `json:"user.name,omitempty" gorm:"-"` ExpiredAt time.Time `json:"expired_at,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type OccupiedSeat ¶
type Seat ¶
type Seat struct { ID string `json:"id,omitempty" form:"id,omitempty" query:"id,omitempty" gorm:"type:char(36)"` Name string `json:"name" gorm:"type:varchar(50)" validate:"required|string"` SeatType string `json:"seat_type" gorm:"type:varchar(50)" validate:"required|string"` // student,teacher ClassID int `json:"class.id,omitempty" gorm:"index:classroom_id"` ClassName string `json:"class.name,omitempty" query:"class.name,omitempty" gorm:"-"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type Setting ¶
type User ¶
type User struct { ID string `json:"id,omitempty" gorm:"type:char(36)"` Name string `json:"name,omitempty" gorm:"type:varchar(100)" validate:"required,max=100"` Gender string `json:"gender,omitempty" gorm:"type:varchar(6)" validate:"required,eq=male|eq=female"` Email string `json:"email,omitempty" gorm:"type:varchar(100)" validate:"required_without=phone,email,max=100"` Password string `json:"password,omitempty" validate:"required_with=email,max=100"` Phone string `json:"phone,omitempty" validate:"required_without=email,number"` IsPhoneVerified bool `json:"is_phone_verified,omitempty"` IsEmailVerified bool `json:"is_email_verified,omitempty"` RoleID int `json:"role.id,omitempty" gorm:"index:users_role_id"` RoleName string `json:"role.name,omitempty" query:"role.name,omitempty" gorm:"-"` LanguageCode string `json:"language_code,omitempty" gorm:"type:char(2)" validate:"max=2"` CountryCode string `json:"country_code,omitempty" gorm:"type:char(2)" validate:"max=2"` Province string `json:"province,omitempty" gorm:"type:varchar(50)" validate:"max=50"` City string `json:"city,omitempty" gorm:"type:varchar(75)" validate:"max=75"` Token string `json:"token,omitempty" gorm:"-"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
func (*User) BeforeSave ¶
func (*User) GetPaginated ¶
func (*User) IsEmailAvailable ¶
func (*User) IsPhoneAvailable ¶
func (*User) SetDefaultValue ¶
type UserRole ¶
type UserRole struct { ID int `json:"id,omitempty" form:"id,omitempty" query:"id,omitempty"` Name string `json:"name" gorm:"type:varchar(50)" validate:"required|string"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
func (*UserRole) DeleteById ¶
func (*UserRole) GetPaginated ¶
func (*UserRole) SetDefaultValue ¶
Click to show internal directories.
Click to hide internal directories.