app

package
v0.0.0-...-54cc154 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermUserGroup          = "add users and groups"
	PermUserProperties     = "manage most users properties"
	PermUserManage         = "create and manage user views"
	PermUserUpdatePassword = "update password expiration policies"
	PermServiceRequest     = "manage service requests"
	PermReadWrite          = "readWrite"
	PermResetPassword      = "resetPassword"
	PermListEmployee       = "listEmployee"
	PermAttendance         = "readWriteAttendance"
	PermUserDetails        = "readUpdateUserDetails"
)

Variables

View Source
var DeleteCookie = &http.Cookie{
	Name:    "token",
	Value:   "",
	Path:    "/",
	Expires: time.Now().Add(0),
}

Functions

This section is empty.

Types

type AccessControl

type AccessControl struct {
	Authority []struct {
		Name string `json:"name"`
	} `json:"authority"`
	Permission []struct {
		Name string `json:"name"`
	} `json:"permission"`
}

type AccountDetail

type AccountDetail struct {
	ID            string    `json:"id" gorm:"type:varchar(50);primaryKey"`
	JobTitle      string    `json:"job_title" gorm:"type:text;not null"`
	Level         string    `json:"level" gorm:"type:text;not null"`
	Phone         string    `json:"phone" gorm:"type:text;not null"`
	Address       string    `json:"address" gorm:"type:text;not null"`
	StartContract time.Time `json:"start_contract" gorm:"not null;"`
	EndContract   time.Time `json:"end_contract" gorm:"not null;"`
	AccountID     string    `json:"-" gorm:"type:varchar(50)"`
}

type AccountRepository

type AccountRepository interface {
	Store(adminID, roleName string, in *RegisterInput) error
	FindUsername(username string) (*Accounts, error)
	FindID(id string) (*Accounts, error)
	GetAccount(adminID string, roleName string) ([]Accounts, error)
	DeleteAccount(id string, username string) error
	CheckRole(adminID string, roleName string) error
	GivenPermission(userId string, roleName string, permName string) error
	AssignAccessControl(adminID string, roleName string, control *AssignRole) error
	AccessControlList() (AccessControl, error)
	SetOnlineStatus(id string, status bool) error
	GetOnlineStatus(Id string) ([]*Accounts, error)
}

type Accounts

type Accounts struct {
	ID             string    `json:"id" gorm:"type:varchar(50);primaryKey"`
	Name           string    `json:"name" gorm:"type:varchar(50);not null"`
	Username       string    `json:"username" gorm:"type:varchar(24);not null"`
	Password       string    `json:"-" gorm:"type:text;not null"`
	SecretPassword string    `json:"-" gorm:"type:text;not null"`
	Email          string    `json:"email" gorm:"type:varchar(80);not null"`
	OnlineStatus   bool      `json:"online_status" gorm:"default:false"`
	SuspendStatus  bool      `json:"suspend_status" gorm:"default:false"`
	CreatedAt      time.Time `json:"created_at" gorm:"not null;"`
	UpdatedAt      time.Time
	LastLogin      time.Time     `json:"last_login" gorm:"not null;"`
	Accounts       AccountDetail `json:"-" gorm:"ForeignKey:AccountID"`
	Trello         Trello        `json:"-" gorm:"ForeignKey:AccountID"`
}

func (*Accounts) Payload

func (m *Accounts) Payload() interface{}

type AssignRole

type AssignRole struct {
	UserID     string            `json:"userID"`
	Role       string            `json:"role"`
	Permission string            `json:"permission"`
	Errors     map[string]string `json:"-"`
}

func (*AssignRole) Validate

func (m *AssignRole) Validate() bool

type AuthRepository

type AuthRepository interface {
	GetPassword(username string) (*Accounts, error)
	GetRole(userID string) (string, error)
	UpdateLogin(userID string) error
}

type DashboardContent

type DashboardContent struct {
	User   interface{}
	Errors map[string]string
	Any    map[string]string
	Page   map[string]int
	Token  string
	Data   map[string]interface{}
}

type LoginInput

type LoginInput struct {
	Username  string
	Password  string
	Errors    map[string]string
	Token     string
	LongToken bool
}

func (*LoginInput) ComparePassword

func (m *LoginInput) ComparePassword(hashed string, secret string) bool

func (*LoginInput) GenerateJwt

func (m *LoginInput) GenerateJwt(data map[string]interface{}) (string, error)

func (*LoginInput) RefreshJwt

func (m *LoginInput) RefreshJwt(oldToken string) (string, error)

func (*LoginInput) Validate

func (m *LoginInput) Validate() bool
type MenuType int
const (
	HomeMenu MenuType = iota
	HomeMenuInbox
	HpmeMenuAttendece
	HomeMenuActivity
	HomeMenuEmployee
	AnalyticsSummary
	AnalyticsResult
	TrelloMenu
	SettingDetails
	SettingUsers
)

type Performance

type Performance struct {
	Todo          int         `json:"todo"`
	OnProgress    int         `json:"on_progress"`
	Done          int         `json:"done"`
	Product       interface{} `json:"product"`
	Daily         interface{} `json:"daily"`
	TimelineGantt interface{} `json:"timeline_gantt"`
}

type RegisterInput

type RegisterInput struct {
	Name     string            `json:"name"`
	Email    string            `json:"email"`
	Username string            `json:"username"`
	Password string            `json:"password"`
	Errors   map[string]string `json:"-"`
	Token    string
}

func (*RegisterInput) GeneratePassword

func (m *RegisterInput) GeneratePassword(secret string) (string, error)

func (*RegisterInput) ValidateAPI

func (m *RegisterInput) ValidateAPI() bool

type Trello

type Trello struct {
	ID           uint64           `json:"id" gorm:"primary_key"`
	BoardName    string           `json:"board_name" gorm:"type:varchar(50);not null"`
	BoardID      string           `json:"board_id" gorm:"type:varchar(50);not null"`
	CardMemberID string           `json:"-" gorm:"type:varchar(120);null;index:card_member_id_id_k"`
	AccountID    string           `json:"-" gorm:"type:varchar(50);null"`
	CardItems    []TrelloUserCard `json:"card_items" gorm:"ForeignKey:CardMemberID;references:CardMemberID"`
}

func (Trello) TableName

func (Trello) TableName() string

type TrelloRepository

type TrelloRepository interface {
	Store(in *TrelloUserCard) (*TrelloUserCard, error)
	FindCardCategory(id string, category string) (int, error)
}

type TrelloUserCard

type TrelloUserCard struct {
	gorm.Model
	CardID                   string    `json:"card_id" gorm:"type:varchar(120);not null"`
	CardName                 string    `json:"card_name" gorm:"type:text;not null"`
	CardCategory             string    `json:"card_category" gorm:"type:varchar(120);not null"`
	CardVotes                int64     `json:"card_votes" gorm:"type:int(12);not null"`
	CardCheckItems           int64     `json:"card_check_items" gorm:"type:int(12);not null"`
	CardCheckLists           int64     `json:"card_check_lists" gorm:"type:int(12);not null"`
	CardCommentCount         int64     `json:"comment_count" gorm:"type:int(12);not null"`
	CardAttachmentsCount     int64     `json:"attachments_count" gorm:"type:int(12);not null"`
	CardCheckItemsComplete   int64     `json:"card_check_items_complete" gorm:"type:int(12);not null"`
	CardCheckItemsInComplete int64     `json:"card_check_items_incomplete" gorm:"type:int(12);not null"`
	CardUrl                  string    `json:"card_url" gorm:"type:text;not null"`
	CardMemberID             string    `json:"card_member_id" gorm:"type:varchar(120);not null"`
	CardMemberName           string    `json:"card_member_name" gorm:"type:text;not null"`
	CardMemberUsername       string    `json:"card_member_username" gorm:"type:text;not null"`
	CardCreatedAt            time.Time `json:"card_created_at" gorm:"not null;"`
}

func (TrelloUserCard) TableName

func (TrelloUserCard) TableName() string

Directories

Path Synopsis
pb
util

Jump to

Keyboard shortcuts

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