Documentation ¶
Index ¶
- type CasbinRule
- type ChangePassword
- type Role
- type SwagChangePasswordResponse
- type SwagCreateBase
- type SwagCreateUserResponse
- type SwagDeleteBase
- type SwagError400
- type SwagError404
- type SwagError500
- type SwagGetAllUsersResponse
- type SwagGetBase
- type SwagGetUserResponse
- type SwagID
- type SwagLogin
- type SwagPageMeta
- type SwagUpdateBase
- type SwagUpdateUserResponse
- type SwagUploadAvatarResponse
- type SwagUser
- type SwagUserBody
- type SwagUserBodyIncludePassword
- type SwagUserPassword
- type UploadAvatar
- type User
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasbinRule ¶
type CasbinRule struct { PType string `gorm:"type:varchar(100);DEFAULT:NULL"` V0 string `gorm:"type:varchar(100);DEFAULT:NULL"` V1 string `gorm:"type:varchar(100);DEFAULT:NULL"` V2 string `gorm:"type:varchar(100);DEFAULT:NULL"` V3 string `gorm:"type:varchar(100);DEFAULT:NULL"` V4 string `gorm:"type:varchar(100);DEFAULT:NULL"` V5 string `gorm:"type:varchar(100);DEFAULT:NULL"` }
func (CasbinRule) TableName ¶
func (CasbinRule) TableName() string
type ChangePassword ¶
type Role ¶
type SwagCreateBase ¶
type SwagCreateUserResponse ¶
type SwagCreateUserResponse struct { SwagCreateBase Data struct { Users SwagUser `json:"users"` } `json:"data"` }
type SwagDeleteBase ¶
type SwagError400 ¶
type SwagError404 ¶
type SwagError500 ¶
type SwagGetAllUsersResponse ¶
type SwagGetAllUsersResponse struct { SwagGetBase Data struct { PageMeta SwagPageMeta `json:"pageMeta"` Users []SwagUser `json:"users"` } `json:"data"` }
type SwagGetBase ¶
type SwagGetUserResponse ¶
type SwagGetUserResponse struct { SwagGetBase Data struct { Users SwagUser `json:"users"` } `json:"data"` }
type SwagLogin ¶
type SwagLogin struct { Success bool `json:"success" example:"true"` // ผลการเรียกใช้งาน Status int `json:"status" example:"200"` // HTTP Status Code Message string `json:"message" example:"User logged in successfully"` // ข้อความตอบกลับ Token string `json:"token" example:"eyJhbGciOiJIUzI1NiIsI"` // token Data SwagUser `json:"data" ` }
type SwagPageMeta ¶
type SwagPageMeta struct { CurrentItemsCount int `json:"currentItemsCount" example:"1"` CurrentPageNumber int `json:"currentPageNumber" example:"1"` HasNextPage bool `json:"hasNextPage" example:"false"` HasPrevPage bool `json:"hasPrevPage" example:"false"` NextPageNumber int `json:"nextPageNumber" example:"1"` NextPageUrl string `json:"nextPageUrl" example:"/api/v1/users/addresses?page=1&pageSize=10"` Offset int `json:"offset" example:"0"` PrevPageNumber int `json:"prevPageNumber" example:"1"` PrevPageUrl string `json:"prevPageUrl" example:"/api/v1/users/addresses?page=1&pageSize=10"` RequestedPageSize int `json:"requestedPageSize" example:"10"` TotalPagesCount int `json:"totalPagesCount" example:"1"` TotalItemsCount int `json:"totalItemsCount" example:"1"` }
type SwagUpdateBase ¶
type SwagUpdateUserResponse ¶
type SwagUpdateUserResponse struct { SwagUpdateBase Data struct { Users SwagUser `json:"users"` } `json:"data"` }
type SwagUser ¶
type SwagUser struct { SwagID SwagUserBody }
type SwagUserBody ¶
type SwagUserBody struct { Username string `json:"username" example:"user01"` // Username FirstName string `json:"firstName" example:"john"` // ชื่อ LastName string `json:"lastName" example:"doe"` // นามสกุล Email string `json:"email" example:"user01@email.com"` // อีเมล์ Slug string `json:"slug" example:"user01"` // Slug Avatar string `json:"avatar" example:"user01.png"` // รูป Avatar }
type SwagUserBodyIncludePassword ¶
type SwagUserBodyIncludePassword struct { SwagUserBody SwagUserPassword }
type SwagUserPassword ¶
type SwagUserPassword struct {
Password string `json:"password" example:"pass1234"` // รหัสผ่าน
}
type UploadAvatar ¶
type UploadAvatar struct {
Avatar string `json:"avatar" form:"avatar" binding:"required" example:"avatar.png"` // รูปภาพ
}
type User ¶
type User struct { gorm.Model Username string `json:"username" form:"username" gorm:"type:varchar(50);not null;unique_index" binding:"required"` Password string `json:"password" form:"password" gorm:"not null" binding:"required"` FirstName string `json:"firstName" form:"firstName" gorm:"type:varchar(100);not null" binding:"required"` LastName string `json:"lastName" form:"lastName" gorm:"type:varchar(100);not null" binding:"required"` Email string `json:"email" form:"email" gorm:"type:varchar(100);unique_index"` Slug string `json:"slug" form:"slug" uri:"slug" gorm:"type:varchar(50);unique_index"` Status string `json:"status" form:"status" sql:"type:enum('A','I');DEFAULT:'A'"` Avatar string `json:"avatar" form:"avatar" ` Roles []Role `json:"roles" gorm:"many2many:users_roles;"` UserRoles []UserRole `json:"users_roles" gorm:"foreignkey:UserId"` }
func (*User) GetUserStatusAsString ¶
func (*User) IsNotAdmin ¶
Click to show internal directories.
Click to hide internal directories.