Documentation ¶
Overview ¶
Package Teams will helps to create your cms application admin users Authorized user only access the functions All teams package functions are authenticated using github.com/spurtcms/pkg-core/auth package
Index ¶
- func MigrateTables(db *gorm.DB)
- type Filters
- type TblUser
- type Team
- func (t Team) ChangeAccess(user *TblUser, userIds []int, DB *gorm.DB) error
- func (t Team) ChangeActiveUser(user *TblUser, userId int, DB *gorm.DB) error
- func (t Team) ChangePasswordById(user *TblUser, DB *gorm.DB) error
- func (t Team) CheckEmail(user *TblUser, email string, userid int, DB *gorm.DB) error
- func (t Team) CheckNumber(user *TblUser, mobile string, userid int, DB *gorm.DB) error
- func (t Team) CheckRoleUsed(user *TblUser, roleid int, DB *gorm.DB) error
- func (t Team) CheckUsername(user *TblUser, username string, userid int, DB *gorm.DB) error
- func (t Team) CheckValidation(user *TblUser, email, username, mobile string, userid int, DB *gorm.DB) error
- func (t Team) CreateUser(user *TblUser, DB *gorm.DB) error
- func (t Team) DeleteMultipleUser(user *TblUser, usersId []int, DB *gorm.DB) error
- func (t Team) DeleteUser(user *TblUser, DB *gorm.DB) error
- func (t Team) GetUserDetailsTeam(user *TblUser, id int, DB *gorm.DB) error
- func (t Team) GetUsersList(users *[]TblUser, offset, limit int, filter Filters, flag bool, DB *gorm.DB) ([]TblUser, int64)
- func (t Team) Lastlogin(id int, log_time time.Time, DB *gorm.DB) error
- func (t Team) NewuserCount(DB *gorm.DB) (count int64, err error)
- func (t Team) SelectedUserStatusChange(userStatus *TblUser, userIds []int, DB *gorm.DB) error
- func (t Team) UpdateUser(user *TblUser, imgdata string, DB *gorm.DB) error
- func (t Team) UserCount(DB *gorm.DB) (count int64, err error)
- func (t Team) UserUsedRoleCheck(user *TblUser, id int, DB *gorm.DB) error
- type TeamAuth
- func (a TeamAuth) ChangeAccess(userIds []int, status int) error
- func (a TeamAuth) ChangeYourPassword(password string) (success bool, err error)
- func (a TeamAuth) CheckEmail(Email string, userid int) (users TblUser, checl bool, errr error)
- func (a TeamAuth) CheckNumber(mobile string, userid int) (bool, error)
- func (a TeamAuth) CheckPasswordwithOld(password string) (bool, error)
- func (a TeamAuth) CheckRoleUsed(roleid int) (bool, error)
- func (a TeamAuth) CheckUserValidation(mobile string, email string, username string, userid int) (emaill bool, users bool, mobiles bool, err error)
- func (a TeamAuth) CheckUsername(username string, userid int) (bool, error)
- func (a TeamAuth) CreateUser(teamcreate TeamCreate) error
- func (a TeamAuth) DashboardUserCount() (totalcount int, lasttendayscount int, err error)
- func (a TeamAuth) DeleteMultipleUser(usersId []int) error
- func (a TeamAuth) DeleteUser(id int) error
- func (a TeamAuth) GetUserDetails(userid int) (user TblUser, err error)
- func (a TeamAuth) LastLoginActivity() (err error)
- func (a TeamAuth) ListUser(limit, offset int, filter Filters) (tbluser []TblUser, totoaluser int64, err error)
- func (a TeamAuth) SelectedUserStatusChange(userIds []int, activeStatus int) error
- func (a TeamAuth) UpdateMyUser(userupdate TeamCreate) error
- func (a TeamAuth) UpdateUser(teamcreate TeamCreate, userid int) error
- type TeamCreate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateTables ¶
MigrateTables creates this package related tables in your database
Types ¶
type TblUser ¶
type TblUser struct { Id int `gorm:"primaryKey;auto_increment"` Uuid string FirstName string LastName string RoleId int Email string Username string Password string MobileNo string IsActive int ProfileImage string ProfileImagePath string DataAccess int CreatedOn time.Time CreatedBy int ModifiedOn time.Time `gorm:"DEFAULT:NULL"` ModifiedBy int `gorm:"DEFAULT:NULL"` LastLogin time.Time `gorm:"DEFAULT:NULL"` IsDeleted int DeletedOn time.Time `gorm:"DEFAULT:NULL"` DeletedBy int `gorm:"DEFAULT:NULL"` ModuleName string `gorm:"-"` RouteName string `gorm:"-:migration;<-:false"` DisplayName string `gorm:"-:migration;<-:false"` Description string `gorm:"-"` ModuleId int `gorm:"-:migration;<-:false"` PermissionId int `gorm:"-"` FullAccessPermission int `gorm:"-:migration;<-:false"` RoleName string `gorm:"-:migration;<-:false"` DefaultLanguageId int NameString string `gorm:"-"` }
type Team ¶
type Team struct{}
Team structure pointed to all database related query
var TM Team
func (Team) ChangeAccess ¶ added in v1.0.74
func (Team) ChangeActiveUser ¶ added in v1.0.74
func (Team) CheckEmail ¶
func (Team) CheckNumber ¶
func (Team) CheckRoleUsed ¶
Rolechekc
func (Team) CheckUsername ¶
func (Team) CheckValidation ¶
func (Team) CreateUser ¶
This func will help to create a user in your database
func (Team) DeleteMultipleUser ¶ added in v1.0.74
func (Team) GetUserDetailsTeam ¶
func (Team) GetUsersList ¶
func (Team) SelectedUserStatusChange ¶ added in v1.0.74
type TeamAuth ¶
type TeamAuth struct {
Authority *auth.Authorization
}
This TeamAuth structure functions will have only for admin based functionality TeamAuth contains database connection string, token and secret key for your token
func (TeamAuth) ChangeAccess ¶ added in v1.0.74
func (TeamAuth) ChangeYourPassword ¶
func (TeamAuth) CheckEmail ¶
check email is already exists in your database
func (TeamAuth) CheckNumber ¶
check mobile
func (TeamAuth) CheckPasswordwithOld ¶
check new password with old password if it's return false it does not match to the old password or return true it does match to the old password
func (TeamAuth) CheckRoleUsed ¶
Check role already used or not
func (TeamAuth) CheckUserValidation ¶
func (a TeamAuth) CheckUserValidation(mobile string, email string, username string, userid int) (emaill bool, users bool, mobiles bool, err error)
Check all username,email,number
func (TeamAuth) CheckUsername ¶
check username
func (TeamAuth) CreateUser ¶
func (a TeamAuth) CreateUser(teamcreate TeamCreate) error
CreateUser create for your admin login. if TeamAuth does not have token or invalid it wil return invalid token error. Token user does not have Permission to call this Createuser function it will return not authorized error.
func (TeamAuth) DashboardUserCount ¶
Dashboard usercount function
func (TeamAuth) DeleteMultipleUser ¶ added in v1.0.74
func (TeamAuth) GetUserDetails ¶
func (TeamAuth) LastLoginActivity ¶ added in v1.0.45
Logout Last Active
func (TeamAuth) ListUser ¶
func (a TeamAuth) ListUser(limit, offset int, filter Filters) (tbluser []TblUser, totoaluser int64, err error)
ListUser function returns the userslist,usercount and err. if TeamAuth does not have token or invalid it wil return invalid token error Token user does not have Permission to call this ListUser function it will return not authorized error
func (TeamAuth) SelectedUserStatusChange ¶ added in v1.0.74
func (TeamAuth) UpdateMyUser ¶
func (a TeamAuth) UpdateMyUser(userupdate TeamCreate) error
UpdateMyUser what are you want to update your profile using TeamCreate struct and pass your values. This function want some mandatory fields (eg.firstname,email,username,mobileno..) if this fields are empty it will return error(given values is empty)
func (TeamAuth) UpdateUser ¶
func (a TeamAuth) UpdateUser(teamcreate TeamCreate, userid int) error
Update User