models

package
v0.0.0-...-d860576 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var USERDB *sqlx.DB
View Source
var USERDBERR bool

Functions

func AddUser

func AddUser(newUser User) (int64, error)

func ConnectUserDatabase

func ConnectUserDatabase() error

func DeleteUser

func DeleteUser(userId int64) (bool, error)

func UpdateUser

func UpdateUser(updUser User, userId int64) (bool, error)

Types

type User

type User struct {
	UserId     int64  `db:"USER_ID" json:"userId"`
	UserName   string `db:"USER_NAME" json:"userName"`
	FirstName  string `db:"FIRST_NAME" json:"firstName"`
	LastName   string `db:"LAST_NAME" json:"lastName"`
	Email      string `db:"EMAIL" json:"email"`
	UserStatus string `db:"USER_STATUS" json:"userStatus"`
	Department string `db:"DEPARTMENT" json:"department"`
}

func GetUsers

func GetUsers(count int) ([]User, error)

type UserDTO

type UserDTO struct {
	UserName   string `db:"USER_NAME" json:"userName"`
	FirstName  string `db:"FIRST_NAME" json:"firstName"`
	LastName   string `db:"LAST_NAME" json:"lastName"`
	Email      string `db:"EMAIL" json:"email"`
	UserStatus string `db:"USER_STATUS" json:"userStatus"`
	Department string `db:"DEPARTMENT" json:"department"`
}

Jump to

Keyboard shortcuts

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