backenduser1

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEmployee

func DeleteEmployee(Mongoenv, publickey, dbname, colname string, r *http.Request) string

Delete Data

func DeleteEmployeeData

func DeleteEmployeeData(mongoconn *mongo.Database, colname, EmpId string) (deletedid interface{}, err error)

func DeleteUser

func DeleteUser(Mongoconn *mongo.Database, colname, username string) (deleted interface{}, err error)

func DeleteUserforAdmin

func DeleteUserforAdmin(Mongoenv, publickey, dbname, colname string, r *http.Request) string

Delete User

func GetAllEmployee

func GetAllEmployee(PublicKey, Mongoenv, dbname, colname string, r *http.Request) string

GetAll

func GetDataUserForAdmin

func GetDataUserForAdmin(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

Get Data User

func GetOneEmployee

func GetOneEmployee(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

Get One

func InsertDataEmployee

func InsertDataEmployee(MongoConn *mongo.Database, colname string, emp Employee) (InsertedID interface{})

func InsertEmployee

func InsertEmployee(MongoEnv, dbname, colname, publickey string, r *http.Request) string

Insert data

func IsAdmin

func IsAdmin(Tokenstr, PublicKey string) bool

func IsHR

func IsHR(TokenStr, Publickey string) bool

func Login

func Login(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string

log User

func Register

func Register(Mongoenv, dbname string, r *http.Request) string

reg User

func ResetPassword

func ResetPassword(MongoEnv, publickey, dbname, colname string, r *http.Request) string

Reset Password

func SubmitReport added in v0.0.2

func SubmitReport(MongoEnv, dbname, colname, publickey string, r *http.Request) string

func UpdateDataEmployees

func UpdateDataEmployees(MongoEnv, dbname, publickey string, r *http.Request) string

Update data

func UpdateEmployee

func UpdateEmployee(Mongoconn *mongo.Database, ctx context.Context, emp Employee) (UpdateId interface{}, err error)

func UpdatePassword

func UpdatePassword(mongoconn *mongo.Database, user pasproj.User) (Updatedid interface{})

Types

type Cred

type Cred struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type Division

type Division struct {
	DivId   int    `json:"divId" bson:"divId"`
	DivName string `json:"divName" bson:"divName"`
}

type Employee

type Employee struct {
	EmployeeId string       `json:"employeeid" bson:"employeeid,omitempty"`
	Name       string       `json:"name" bson:"name,omitempty"`
	Email      string       `json:"email" bson:"email,omitempty"`
	Phone      string       `json:"phone" bson:"phone,omitempty"`
	Division   Division     `json:"division" bson:"division,omitempty"`
	Account    pasproj.User `json:"account" bson:"account,omitempty"`
	Salary     Salary       `json:"salary" bson:"salary"`
}

func GetAllEmployeeData

func GetAllEmployeeData(Mongoconn *mongo.Database, colname string) []Employee

func GetOneEmployeeData

func GetOneEmployeeData(mongoconn *mongo.Database, colname, Empid string) (dest Employee)

type Report added in v0.0.2

type Report struct {
	Title          string `json:"title"`
	Description    string `json:"description"`
	DateOccurred   string `json:"dateOccurred"`
	FileAttachment string `json:"fileAttachment"`
}

type ReqUsers

type ReqUsers struct {
	Username string `json:"username"`
}

type RequestEmployee

type RequestEmployee struct {
	EmployeeId string `json:"employeeid"`
}

type ResponseBack

type ResponseBack struct {
	Status  int      `json:"status"`
	Message string   `json:"message"`
	Data    []string `json:"data"`
}

type ResponseEmployee

type ResponseEmployee struct {
	Status  int      `json:"status"`
	Message string   `json:"message"`
	Data    Employee `json:"data"`
}

type ResponseEmployeeBanyak

type ResponseEmployeeBanyak struct {
	Status  int        `json:"status"`
	Message string     `json:"message"`
	Data    []Employee `json:"data"`
}

type Salary

type Salary struct {
	BasicSalary   int `bson:"basic-salary" json:"basic-salary"`
	HonorDivision int `bson:"honor-division" json:"honor-division"`
}

type Updated

type Updated struct {
	Email string `json:"email" bson:"email"`
	Phone string `json:"phone" bson:"phone"`
}

Jump to

Keyboard shortcuts

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