models

package
v0.0.0-...-70b0572 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TenantDefault  = "Default"
	TIDDefault     = "1"
	TenantCommon   = "Common"
	TIDCommon      = "99"
	Expiration     = 120
	ExpirationHour = 24
	ADMIN          = 1
	MANAGER        = 2
	SUPERVISOR     = 3
	OPERATOR       = 4
	AGENT          = 5
	STAFF          = 6
	USER           = 99
)
View Source
const (
	UserStatusNotActive = 1
	UserStatusActive    = 2
	UserStatusSuspend   = 3
	UserStatusOnlyName  = 4
	UserColl            = "user"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	UserID string `json:"userid"`
	TID    string `json:"tid"`
	Role   int    `json:"role"`
	jwt.StandardClaims
}

type IDRequest

type IDRequest struct {
	ID string `json:"id" bson:"_id"`
}

type JwtClaim

type JwtClaim struct {
	UserID string `json:"userid"`
	TID    string `json:"tid"`
	Role   int    `json:"role"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	ID       string `json:"id" bson:"_id"`
	Username string `json:"username" bson:"username"`
	Name     string `json:"name" bson:"name"`
	Role     int    `json:"role" bson:"role"`
	Image    string `json:"image" bson:"image"`
	Active   int    `json:"active" bson:"active"`
	TID      string `json:"tid" bson:"tid"`
	Token    string `json:"token" bson:"token"`
}

type RegMailResponse

type RegMailResponse struct {
	ID    string `json:"id"`
	Token string `json:"token"`
}

type SearchRequest

type SearchRequest struct {
	Limit  int
	Page   int
	Sortby string
	Order  string
	ID     string
	TID    string
	Role   int
	Name   string
	Code   string
}

type User

type User struct {
	ID       string    `json:"id" bson:"_id"`
	Username string    `json:"username" bson:"username"`
	Password string    `json:"-" bson:"password"`
	Name     string    `json:"name" bson:"name"`
	Role     int       `json:"role" bson:"role"`
	Image    string    `json:"image" bson:"image"`
	Active   int       `json:"active" bson:"active"`
	Verified int       `json:"verified" bson:"verified"`
	RegBy    string    `json:"regby" bson:"regby"`
	TID      string    `json:"tid" bson:"tid"`
	Created  time.Time `json:"created" bson:"created"`
	Updated  time.Time `json:"updated" bson:"updated"`
}

type UserFindRequest

type UserFindRequest struct {
	Username string
}

type UserRequest

type UserRequest struct {
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	Name     string `json:"name" bson:"name"`
	Role     int    `json:"role" bson:"role"`
	Image    string `json:"image" bson:"image"`
	Active   int    `json:"active" bson:"active"`
	RegBy    string `json:"regby" bson:"regby"`
	TID      string `json:"tid" bson:"tid"`
}

type UserSearchRequest

type UserSearchRequest struct {
	Limit    int
	Page     int
	Sortby   string `json:"sortby,omitempty"`
	Order    string `json:"order,omitempty"`
	TID      string `json:"tid,omitempty"`
	Username string `json:"username,omitempty"`
	Name     string `json:"name,omitempty"`
	Role     int    `json:"role,omitempty"`
	Active   int    `json:"active,omitempty"`
	Verified int    `json:"verified,omitempty"`
	RegBy    string `json:"regby,omitempty"`
}

Jump to

Keyboard shortcuts

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