models

package
v0.0.0-...-556e172 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAllLeavesResponse

type GetAllLeavesResponse struct {
	Leaves []Leave `json:"leaves"`
}

GetAllLeavesResponse Model

type GetLeavesResponse

type GetLeavesResponse struct {
	User   User    `json:"user"`
	Leaves []Leave `json:"leaves"`
}

GetLeavesResponse Model

type HTTPErr

type HTTPErr struct {
	Message string `json:"message"`
}

HTTPErr msg

type JWTClaims

type JWTClaims struct {
	UserID int `json:"userID"`
	RoleID int `json:"roleID"`
	jwt.StandardClaims
}

JWTClaims describes Claims in token.

type Leave

type Leave struct {
	ID          int       `gorm:"id;PRIMARY_KEY;AUTO_INCREMENT" json:"id,omitempty"`
	UserID      int       `gorm:"user_id" json:"userID,omitempty"`
	Status      string    `gorm:"status" json:"status,omitempty"`
	LeaveReason string    `gorm:"leave_reason" json:"leaveReason,omitempty"`
	Feedback    string    `gorm:"feedback" json:"feedback,omitempty"`
	FromDate    time.Time `gorm:"from_date" json:"fromDate,omitempty"`
	ToDate      time.Time `gorm:"to_date" json:"toDate,omitempty"`
	LeaveDays   int       `gorm:"leave_days" json:"leaveDays,omitempty"`
	CreatedAt   time.Time `gorm:"created_at" json:"-"`
}

Leave Model

type Role

type Role struct {
	ID       int    `gorm:"id" json:"id"`
	RoleName string `gorm:"role_name" json:"roleName"`
}

Role Model

type User

type User struct {
	ID          int        `gorm:"id" json:"id"`
	Name        string     `gorm:"name" json:"name"`
	Email       string     `gorm:"email" json:"email"`
	Password    string     `gorm:"password" json:"-"`
	RoleID      int        `gorm:"role_id" json:"roleID"`
	TotalLeaves int        `gorm:"total_leaves" json:"totalLeaves"`
	CreatedAt   time.Time  `gorm:"created_at" json:"createdAt"`
	UpdatedAt   time.Time  `gorm:"updated_at" json:"-"`
	DeletedAt   *time.Time `gorm:"deleted_at" json:"-"`
}

User Model

type UserLoginRequest

type UserLoginRequest struct {
	Email    string `json:"email" validate:"required" email:"true"`
	Password string `json:"password" validate:"required"`
}

UserLoginRequest Model

type UserLoginResponse

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

UserLoginResponse Model

Jump to

Keyboard shortcuts

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