UsersBackend

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 10 Imported by: 1

README

UsersBackend Readme cek

Backend untuk Handle data User

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEmployee added in v0.1.1

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

func DeleteEmployeeData added in v0.1.1

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

func DeleteUser added in v0.0.15

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

func DeleteUserforAdmin added in v0.0.15

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

func GetAllEmployee added in v0.1.0

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

func GetDataUserForAdmin added in v0.0.3

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

func GetOneEmployee added in v0.0.6

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

func InsertDataEmployee added in v0.0.6

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

func InsertEmployee added in v0.0.6

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

func IsAdmin added in v0.0.3

func IsAdmin(Tokenstr, PublicKey string) bool

func IsHR added in v0.0.6

func IsHR(TokenStr, Publickey string) bool

func Login

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

func Register

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

func ResetPassword added in v0.0.16

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

func UpdateDataEmployees added in v0.0.6

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

func UpdateEmployee added in v0.0.6

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

func UpdatePassword added in v0.0.16

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

Types

type Cred added in v0.0.15

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

type Division added in v0.0.6

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

type Employee added in v0.0.6

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 added in v0.1.0

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

func GetOneEmployeeData added in v0.1.4

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

type ReqUsers added in v0.0.15

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

type RequestEmployee added in v0.1.1

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 added in v0.0.6

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

type ResponseEmployeeBanyak added in v0.1.0

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

type Salary added in v0.1.0

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

type Updated added in v0.0.6

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