views

package
v0.0.0-...-aa5d22e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	M_BAD_REQUEST                   = "BAD_REQUEST"
	M_INVALID_CREDENTIALS           = "M_INVALID_CREDENTIALS"
	M_CREATED                       = "CREATED"
	M_OK                            = "OK"
	M_INTERNAL_SERVER_ERROR         = "INTERNAL_SERVER_ERROR"
	M_EMAIL_ALREADY_USED            = "EMAIL_ALREADY_USED"
	M_USERNAME_ALREADY_USED         = "USERNAME_ALREADY_USED"
	M_TICKET_SUCCESSFULLY_DELETED   = "Ticket has been successfully deleted"
	M_CATEGORY_SUCCESSFULLY_DELETED = "Category has been successfully deleted"
	M_STOCK_IS_NOT_ENOUGH           = "STOCK_IS_NOT_ENOUGH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCategory

type CreateCategory struct {
	Id uint `json:"id"`
	// UserId    uint      `json:"user_id"`
	Type      string    `json:"type"`
	CreatedAt time.Time `json:"created_at"`
}

type CreateTicket

type CreateTicket struct {
	Id          uint          `json:"id"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Price       float32       `json:"price"`
	Seat        int           `json:"seat"`
	Duration    time.Duration `json:"duration"`
	CategoryId  uint          `json:"category_id"`
	CreatedAt   time.Time     `json:"created_at"`
}

type GetCategories

type GetCategories struct {
	Id uint `json:"id"`
	// UserId    uint               `json:"user_id"`
	Type      string             `json:"type"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
	Ticket    []TicketCategories `json:"ticket"`
}

type GetTicketById

type GetTicketById struct {
	Id          uint          `json:"id"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Price       float32       `json:"price"`
	Seat        int           `json:"seat"`
	Duration    time.Duration `json:"duration"`
	CategoryId  uint          `json:"category_id"`
	UserId      uint          `json:"user_id"`
	UserTickets UserTickets   `json:"user"`
}

type GetTickets

type GetTickets struct {
	Id          uint          `json:"id"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Price       float32       `json:"price"`
	Seat        int           `json:"seat"`
	Duration    time.Duration `json:"duration"`
	CategoryId  uint          `json:"category_id"`
	CreatedAt   time.Time     `json:"created_at"`
	UpdatedAt   time.Time     `json:"updated_at"`
}

type Login

type Login struct {
	Token string `json:"token"`
}

type Register

type Register struct {
	Id        uint      `json:"id"`
	FullName  string    `json:"full_name"`
	NickName  string    `json:"nick_name"`
	UserName  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	Age       uint      `json:"age"`
	CreatedAt time.Time `json:"created_at"`
	Role      models.Role
}

type Response

type Response struct {
	Status  int         `json:"status"`
	Message string      `json:"message"`
	Payload interface{} `json:"payload,omitempty"`
	Error   interface{} `json:"error,omitempty"`
}

func ErrorResponse

func ErrorResponse(status int, message string, error error) *Response

func SuccessResponse

func SuccessResponse(status int, message string, payload interface{}) *Response

type TicketCategories

type TicketCategories struct {
	Id        uint          `json:"id"`
	Title     string        `json:"title"`
	Seat      int           `json:"seat"`
	Price     float32       `json:"price"`
	Duration  time.Duration `json:"duration"`
	CreatedAt time.Time     `json:"created_at"`
	UpdatedAt time.Time     `json:"updated_at"`
}

type UpdateCategory

type UpdateCategory struct {
	Id uint `json:"id"`
	// UserId    uint      `json:"user_id"`
	Type      string    `json:"type"`
	UpdatedAt time.Time `json:"updated_at"`
}

type UpdateTicket

type UpdateTicket struct {
	Id          uint          `json:"id"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Price       float32       `json:"price"`
	Seat        int           `json:"seat"`
	Duration    time.Duration `json:"duration"`
	CategoryId  uint          `json:"category_id"`
	UpdatedAt   time.Time     `json:"updated_at"`
}

type UserTickets

type UserTickets struct {
	Id       uint        `json:"id"`
	FullName string      `json:"full_name"`
	NickName string      `json:"nick_name"`
	UserName string      `json:"username"`
	Email    string      `json:"email"`
	Age      uint        `json:"age"`
	Role     models.Role `json:"role"`
}

Jump to

Keyboard shortcuts

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