Documentation ¶
Index ¶
- Constants
- func Create(ctx *app.Ctx, param *ParamCreate) error
- func CreateHandler(c *fiber.Ctx) error
- func DeleteByID(ctx *app.Ctx, id string, param ParamDelete) error
- func DeleteByIDHandler(c *fiber.Ctx) error
- func Get(ctx *app.Ctx, query url.Values) (app.ListModel, error)
- func GetByIDHandler(c *fiber.Ctx) error
- func GetListHandler(c *fiber.Ctx) error
- func PartialyUpdateByID(ctx *app.Ctx, id string, param *ParamPartialyUpdate) error
- func PartialyUpdateByIDHandler(c *fiber.Ctx) error
- func UpdateByID(ctx *app.Ctx, id string, param *ParamUpdate) error
- func UpdateByIDHandler(c *fiber.Ctx) error
- type List
- type ParamCreate
- type ParamDelete
- type ParamPartialyUpdate
- type ParamUpdate
- type User
- type UserPLT
- type UserRoles
Constants ¶
View Source
const EndPoint = "users"
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶
func CreateHandler(c *fiber.Ctx) error
func DeleteByID ¶
func DeleteByID(ctx *app.Ctx, id string, param ParamDelete) error
func DeleteByIDHandler ¶
func DeleteByIDHandler(c *fiber.Ctx) error
func GetByIDHandler ¶
func GetByIDHandler(c *fiber.Ctx) error
func GetListHandler ¶
func GetListHandler(c *fiber.Ctx) error
func PartialyUpdateByID ¶
func PartialyUpdateByID(ctx *app.Ctx, id string, param *ParamPartialyUpdate) error
func PartialyUpdateByIDHandler ¶
func PartialyUpdateByIDHandler(c *fiber.Ctx) error
func UpdateByID ¶
func UpdateByID(ctx *app.Ctx, id string, param *ParamUpdate) error
func UpdateByIDHandler ¶
func UpdateByIDHandler(c *fiber.Ctx) error
Types ¶
type ParamCreate ¶
type ParamCreate struct { User Username db.NullString `json:"username" db:"u.username" gorm:"column:username" validate:"required" form:"username"` FirstName db.NullString `json:"firstname" db:"u.first_name" gorm:"column:first_name" validate:"required" form:"firstname"` Email db.NullString `json:"email" db:"u.email" gorm:"column:email" validate:"required" form:"email"` LdapUsername db.NullString `json:"ldap_username" db:"u.ldap_username" gorm:"column:ldap_username" validate:"required" form:"ldap_username"` Roles []UserRoles `json:"roles" db:"ug.user_id=id" gorm:"-" validate:"required" form:"roles"` }
type ParamDelete ¶
type ParamDelete struct { User Reason db.NullString `json:"reason" gorm:"-" validate:"required" form:"reason"` }
type ParamPartialyUpdate ¶
type ParamPartialyUpdate struct { User Reason db.NullString `json:"reason" gorm:"-" validate:"required" form:"reason"` }
type ParamUpdate ¶
type ParamUpdate struct { ParamCreate Reason db.NullString `json:"reason" gorm:"-" validate:"required" form:"reason"` }
type User ¶
type User struct { db.Model ID db.NullInt64 `json:"id" db:"u.id" gorm:"column:id" form:"id"` Username db.NullString `json:"username" db:"u.username" gorm:"column:username" form:"username"` JobTitle db.NullString `json:"jobtitle" db:"u.job_title" gorm:"column:job_title" form:"jobtitle"` IpAddress db.NullString `json:"ipaddress" db:"u.ip_address" gorm:"column:ip_address" form:"ipaddress"` CreatedOn db.NullInt64 `json:"created" db:"u.created_on" gorm:"column:created_on" form:"created"` LastLogin db.NullInt64 `json:"last_login" db:"u.last_login" gorm:"column:last_login" form:"last_login"` Active db.NullBool `json:"active" db:"u.active" gorm:"column:active" form:"active"` FirstName db.NullString `json:"firstname" db:"u.first_name" gorm:"column:first_name" form:"firstname"` LastName db.NullString `json:"lastname" db:"u.last_name" gorm:"column:last_name" form:"lastname"` Phone db.NullString `json:"phone" db:"u.phone" gorm:"column:phone" form:"phone"` PictureUrl db.NullString `json:"picture" db:"u.picture" gorm:"column:picture" form:"-"` PictureFileName db.NullString `json:"picture_filename" db:"u.picture_filename" gorm:"column:picture_filename" form:"-"` File *multipart.FileHeader `json:"-" db:"-" gorm:"-" form:"picture"` ParentPmkId db.NullInt64 `json:"parent_jabatan.id" db:"u.staff_pmk_id" gorm:"column:staff_pmk_id" form:"parent_jabatan[id]"` ParentPmkName db.NullString `json:"parent_jabatan.name" db:"pj.pmk_nama" gorm:"-" form:"parent_jabatan.name"` JabatanUtamaID db.NullInt64 `json:"jabatan_utama.id" db:"ju.pmk_id" gorm:"-" form:"jabatan_utama[id]"` JabatanUtamaName db.NullString `json:"jabatan_utama.name" db:"ju.pmk_nama" gorm:"-" form:"jabatan_utama.name"` SekretarisJabatanID db.NullInt64 `json:"jabatan_sekretaris.id" db:"js.pmk_id" gorm:"-" form:"jabatan_sekretaris[id]"` SekretarisJabatanName db.NullString `json:"jabatan_sekretaris.name" db:"js.pmk_nama" gorm:"-" form:"jabatan_sekretaris.name"` PLT []UserPLT `json:"plt" db:"plt.pmk_plt_user_id=id" gorm:"-" form:"-"` Email db.NullString `json:"email" db:"u.email" gorm:"column:email" form:"email"` LdapUsername db.NullString `json:"ldap_username" db:"u.ldap_username" gorm:"column:ldap_username" form:"ldap_username"` TokenMobile db.NullText `json:"token_mobile" db:"u.token_mobile" gorm:"column:token_mobile" form:"token_mobile"` NIK db.NullString `json:"nik" db:"u.nik" gorm:"column:nik" form:"nik"` Roles []UserRoles `json:"roles" db:"ug.user_id=id" gorm:"-" form:"roles"` ACL map[string]bool `json:"acl" db:"-" gorm:"-" form:"acl"` }
func (*User) SetRelation ¶
func (u *User) SetRelation()
func (User) TableAliasName ¶
func (User) TableVersion ¶
type UserPLT ¶
type UserPLT struct { db.Model ID db.NullInt64 `json:"id" db:"plt.pmk_id" gorm:"column:pmk_id;primaryKey" form:"id"` UserID db.NullInt64 `json:"-" db:"plt.pmk_plt_user_id" gorm:"column:pmk_plt_user_id" form:"-"` Name db.NullString `json:"name" db:"plt.pmk_nama" gorm:"column:pmk_nama" form:"name"` }
func (UserPLT) TableAliasName ¶
type UserRoles ¶
type UserRoles struct { db.Model ID db.NullInt64 `json:"-" db:"ug.id" gorm:"column:id;primaryKey" form:"-"` UserID db.NullInt64 `json:"-" db:"ug.user_id" gorm:"column:user_id" form:"-"` RoleID db.NullInt64 `json:"id" db:"ug.group_id" gorm:"column:group_id" form:"id"` Name db.NullString `json:"name" db:"g.name" gorm:"-" form:"name"` Description db.NullString `json:"description" db:"g.description" gorm:"-" form:"description"` IsAdmin db.NullBool `json:"is_admin" db:"g.is_admin" gorm:"-" form:"is_admin"` ACL roles.AclKeys `json:"-" db:"g.acl_keys~json" gorm:"-" form:"-"` }
func (*UserRoles) SetRelation ¶
func (au *UserRoles) SetRelation()
func (UserRoles) TableAliasName ¶
Click to show internal directories.
Click to hide internal directories.