models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	UserID string
	Name   string
	Role   Role
}

type ContextKey

type ContextKey string

ContextKey はコンテキストのキーを表す型です.

const (
	// UserContextKey はユーザー情報を保存するためのコンテキストキーです.
	UserContextKey ContextKey = "user"
)

type Plan

type Plan struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Price       int    `json:"price"`
	Duration    int    `json:"duration"`
}

type PlanSearchParams

type PlanSearchParams struct {
	StartDate *time.Time `form:"start_date" time_format:"2006-01-02"`
	EndDate   *time.Time `form:"end_date"   time_format:"2006-01-02"`
	Status    *string    `form:"status"`
}

type Reservation

type Reservation struct {
	ID        string    `json:"id"`
	UserID    string    `json:"user_id"`
	User      *User     `json:"user"`
	PlanID    string    `json:"plan_id"`
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
	Status    Status    `json:"status"`
	Plan      *Plan     `json:"plan"`
}

type Role

type Role string
const (
	RoleAdmin Role = "admin"
	RoleUser  Role = "user"
)

type Status

type Status string
const (
	StatusReserved  Status = "reserved"
	StatusCanceled  Status = "canceled"
	StatusConfirmed Status = "confirmed"
	StatusPending   Status = "pending"
)

type Token

type Token struct {
	AccessToken string
	ExpiresAt   time.Time
}

type User

type User struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Email          string `json:"email"`
	Phone          string `json:"phone"`
	Password       string `json:"password"`
	Role           Role   `json:"role"`
	SecretQuestion string `json:"secret_question"`
	SecretAnswer   string `json:"secret_answer"`
}

Jump to

Keyboard shortcuts

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