Documentation ¶
Index ¶
- type CasbinRule
- type ChangePassword
- type District
- type Profile
- type ProfileRequest
- type Province
- type RegisterUser
- type Role
- type SplSubType
- type SplType
- type Status
- type SubDistrict
- type SwagChangePasswordResponse
- type SwagCreateBase
- type SwagCreateUserResponse
- type SwagDeleteBase
- type SwagError400
- type SwagError404
- type SwagError500
- type SwagGetAllUsersResponse
- type SwagGetBase
- type SwagGetRoleResponse
- 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
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 District ¶
type Profile ¶
type Profile struct { gorm.Model UserId int `json:"userId" form:"userId" gorm:"unique_index;DEFAULT:null"` Status string `json:"status" form:"status" sql:"type:enum('A','I');DEFAULT:'A'"` IsSpecialist *bool `json:"isSpecialist" form:"isSpecialist" gorm:"DEFAULT:false"` StatusReqform string `json:"statusReqform" form:"statusReqform" sql:"type:enum('edit','checking','verify','approved');DEFAULT:'checking'"` IdCard string `json:"idCard" form:"idCard"` GovCard string `json:"govCard" form:"govCard"` CardExpire *time.Time `json:"cardExpire" form:"cardExpire" gorm:"type:date"` PrefixName string `json:"prefixName" form:"prefixName"` FirstName string `json:"firstName" form:"firstName"` LastName string `json:"lastName" form:"lastName"` BirthDate *time.Time `json:"birthDate" form:"birthDate" gorm:"type:date"` Race string `json:"race" form:"race"` Nation string `json:"nation" form:"nation"` DomicileNo string `json:"domicileNo" form:"domicileNo"` DomicileMoo string `json:"domicileMoo" form:"domicileMoo"` DomicileSoi string `json:"domicileSoi" form:"domicileSoi"` DomicileRoad string `json:"domicileRoad" form:"domicileRoad"` DomicileProvince int `json:"domicileProvince" form:"domicileProvince"` DomicileDistrict int `json:"domicileDistrict" form:"domicileDistrict"` DomicileSubDistrict int `json:"domicileSubDistrict" form:"domicileSubDistrict"` DomicileZipcode string `json:"domicileZipcode" form:"domicileZipcode"` DomicileTel string `json:"domicileTel" form:"domicileTel"` DomicileFax string `json:"domicileFax" form:"domicileFax"` DomicileEmail string `json:"domicileEmail" form:"domicileEmail"` AddressNo string `json:"addressNo" form:"addressNo"` AddressMoo string `json:"addressMoo" form:"addressMoo"` AddressSoi string `json:"addressSoi" form:"addressSoi"` AddressRoad string `json:"addressRoad" form:"addressRoad"` AddressSubDistrict int `json:"addressSubDistrict" form:"addressSubDistrict"` AddressDistrict int `json:"addressDistrict" form:"addressDistrict"` AddressProvince int `json:"addressProvince" form:"addressProvince"` AddressZipcode string `json:"addressZipcode" form:"addressZipcode"` AddressTel string `json:"addressTel" form:"addressTel"` AddressFax string `json:"addressFax" form:"addressFax"` AddressEmail string `json:"addressEmail" form:"addressEmail"` ContactNo string `json:"contactNo" form:"contactNo"` ContactMoo string `json:"contactMoo" form:"contactMoo"` ContactSoi string `json:"contactSoi" form:"contactSoi"` ContactRoad string `json:"contactRoad" form:"contactRoad"` ContactSubDistrict int `json:"contactSubDistrict" form:"contactSubDistrict"` ContactDistrict int `json:"contactDistrict" form:"contactDistrict"` ContactProvince int `json:"contactProvince" form:"contactProvince"` ContactZipcode string `json:"contactZipcode" form:"contactZipcode"` ContactTel string `json:"contactTel" form:"contactTel"` ContactFax string `json:"contactFax" form:"contactFax"` ContactEmail string `json:"contactEmail" form:"contactEmail"` WorkOccupation string `json:"workOccupation" form:"workOccupation"` WorkPosition string `json:"workPosition" form:"workPosition"` WorkPlaces string `json:"workPlaces" form:"workPlaces"` WorkRoad string `json:"workRoad" form:"workRoad"` WorkSubDistrict int `json:"workSubDistrict" form:"workSubDistrict"` WorkDistrict int `json:"workDistrict" form:"workDistrict"` WorkProvince int `json:"workProvince" form:"workProvince"` WorkZipcode string `json:"workZipcode" form:"workZipcode"` WorkTel string `json:"workTel" form:"workTel"` WorkFax string `json:"workFax" form:"workFax"` WorkEmail string `json:"workEmail" form:"workEmail"` BossFirstName string `json:"bossFirstName" form:"bossFirstName"` BossLastName string `json:"bossLastName" form:"bossLastName"` BossNo string `json:"bossNo" form:"bossNo"` BossMoo string `json:"bossMoo" form:"bossMoo"` BossSoi string `json:"bossSoi" form:"bossSoi"` BossRoad string `json:"bossRoad" form:"bossRoad"` BossSubDistrict int `json:"bossSubDistrict" form:"bossSubDistrict"` BossDistrict int `json:"bossDistrict" form:"bossDistrict"` BossProvince int `json:"bossProvince" form:"bossProvince"` BossZipcode string `json:"bossZipcode" form:"bossZipcode"` BossTel string `json:"bossTel" form:"bossTel"` BossFax string `json:"bossFax" form:"bossFax"` BossEmail string `json:"bossEmail" form:"bossEmail"` WorkExperience string `json:"workExperience" form:"workExperience"` SplTypeID int `json:"splTypeID" form:"splTypeID"` SplSubTypeID int `json:"splSubTypeID" form:"splSubTypeID"` RegisQualification string `json:"regisQualification" form:"regisQualification"` RegisDocument string `json:"regisDocument" form:"regisDocument"` RegisEver string `json:"regisEver" form:"regisEver"` RegisEverYear string `json:"regisEverYear" form:"regisEverYear"` RegisEverPass string `json:"regisEverPass" form:"regisEverPass"` RegisEverPassNo string `json:"regisEverPassNo" form:"regisEverPassNo"` RegisEverNopass string `json:"regisEverNopass" form:"regisEverNopass"` RegisEverNopassDesc string `json:"regisEverNopassDesc" form:"regisEverNopassDesc"` FileAttachIdcardURL string `json:"fileAttachIdcardURL" form:"fileAttachIdcardURL"` FileAttachHouseURL string `json:"fileAttachHouseURL" form:"fileAttachHouseURL"` FileAttachGovCardURL string `json:"fileAttachGovCardURL" form:"fileAttachGovCardURL"` FileAttachQualificationURL string `json:"fileAttachQualificationURL" form:"fileAttachQualificationURL"` Remark string `json:"remark" form:"remark"` SplSubType SplSubType `json:"SplSubType" form:"SplSubType"` }
func (Profile) SerializeList ¶
type ProfileRequest ¶
type ProfileRequest struct { UserId int `json:"userId" form:"userId"` Status string `json:"status" form:"status"` IsSpecialist *bool `json:"isSpecialist" form:"isSpecialist"` IdCard string `json:"idCard" form:"idCard"` GovCard string `json:"govCard" form:"govCard"` CardExpire *time.Time `json:"cardExpire" form:"cardExpire"` PrefixName string `json:"prefixName" form:"prefixName"` FirstName string `json:"firstName" form:"firstName"` LastName string `json:"lastName" form:"lastName"` BirthDate *time.Time `json:"birthDate" form:"birthDate"` Race string `json:"race" form:"race"` Nation string `json:"nation" form:"nation"` DomicileNo string `json:"domicileNo" form:"domicileNo"` DomicileMoo string `json:"domicileMoo" form:"domicileMoo"` DomicileSoi string `json:"domicileSoi" form:"domicileSoi"` DomicileRoad string `json:"domicileRoad" form:"domicileRoad"` DomicileProvince int `json:"domicileProvince" form:"domicileProvince"` DomicileDistrict int `json:"domicileDistrict" form:"domicileDistrict"` DomicileSubDistrict int `json:"domicileSubDistrict" form:"domicileSubDistrict"` DomicileZipcode string `json:"domicileZipcode" form:"domicileZipcode"` DomicileTel string `json:"domicileTel" form:"domicileTel"` DomicileFax string `json:"domicileFax" form:"domicileFax"` DomicileEmail string `json:"domicileEmail" form:"domicileEmail"` AddressNo string `json:"addressNo" form:"addressNo"` AddressMoo string `json:"addressMoo" form:"addressMoo"` AddressSoi string `json:"addressSoi" form:"addressSoi"` AddressRoad string `json:"addressRoad" form:"addressRoad"` AddressSubDistrict int `json:"addressSubDistrict" form:"addressSubDistrict"` AddressDistrict int `json:"addressDistrict" form:"addressDistrict"` AddressProvince int `json:"addressProvince" form:"addressProvince"` AddressZipcode string `json:"addressZipcode" form:"addressZipcode"` AddressTel string `json:"addressTel" form:"addressTel"` AddressFax string `json:"addressFax" form:"addressFax"` AddressEmail string `json:"addressEmail" form:"addressEmail"` ContactNo string `json:"contactNo" form:"contactNo"` ContactMoo string `json:"contactMoo" form:"contactMoo"` ContactSoi string `json:"contactSoi" form:"contactSoi"` ContactRoad string `json:"contactRoad" form:"contactRoad"` ContactSubDistrict int `json:"contactSubDistrict" form:"contactSubDistrict"` ContactDistrict int `json:"contactDistrict" form:"contactDistrict"` ContactProvince int `json:"contactProvince" form:"contactProvince"` ContactZipcode string `json:"contactZipcode" form:"contactZipcode"` ContactTel string `json:"contactTel" form:"contactTel"` ContactFax string `json:"contactFax" form:"contactFax"` ContactEmail string `json:"contactEmail" form:"contactEmail"` WorkOccupation string `json:"workOccupation" form:"workOccupation"` WorkPosition string `json:"workPosition" form:"workPosition"` WorkPlaces string `json:"workPlaces" form:"workPlaces"` WorkRoad string `json:"workRoad" form:"workRoad"` WorkSubDistrict int `json:"workSubDistrict" form:"workSubDistrict"` WorkDistrict int `json:"workDistrict" form:"workDistrict"` WorkProvince int `json:"workProvince" form:"workProvince"` WorkZipcode string `json:"workZipcode" form:"workZipcode"` WorkTel string `json:"workTel" form:"workTel"` WorkFax string `json:"workFax" form:"workFax"` WorkEmail string `json:"workEmail" form:"workEmail"` BossFirstName string `json:"bossFirstName" form:"bossFirstName"` BossLastName string `json:"bossLastName" form:"bossLastName"` BossNo string `json:"bossNo" form:"bossNo"` BossMoo string `json:"bossMoo" form:"bossMoo"` BossSoi string `json:"bossSoi" form:"bossSoi"` BossRoad string `json:"bossRoad" form:"bossRoad"` BossSubDistrict int `json:"bossSubDistrict" form:"bossSubDistrict"` BossDistrict int `json:"bossDistrict" form:"bossDistrict"` BossProvince int `json:"bossProvince" form:"bossProvince"` BossZipcode string `json:"bossZipcode" form:"bossZipcode"` BossTel string `json:"bossTel" form:"bossTel"` BossFax string `json:"bossFax" form:"bossFax"` BossEmail string `json:"bossEmail" form:"bossEmail"` WorkExperience string `json:"workExperience" form:"workExperience"` SplTypeID int `json:"splTypeID" form:"splTypeID"` SplSubTypeID int `json:"splSubTypeID" form:"splSubTypeID"` RegisQualification string `json:"regisQualification" form:"regisQualification"` RegisDocument string `json:"regisDocument" form:"regisDocument"` RegisEver string `json:"regisEver" form:"regisEver"` RegisEverYear string `json:"regisEverYear" form:"regisEverYear"` RegisEverPass string `json:"regisEverPass" form:"regisEverPass"` RegisEverPassNo string `json:"regisEverPassNo" form:"regisEverPassNo"` RegisEverNopass string `json:"regisEverNopass" form:"regisEverNopass"` RegisEverNopassDesc string `json:"regisEverNopassDesc" form:"regisEverNopassDesc"` FileAttachIdcard *multipart.FileHeader `json:"fileAttachIdcard" form:"fileAttachIdcard"` FileAttachHouse *multipart.FileHeader `json:"fileAttachHouse" form:"fileAttachHouse"` FileAttachGovCard *multipart.FileHeader `json:"fileAttachGovCard" form:"fileAttachGovCard"` FileAttachQualification *multipart.FileHeader `json:"fileAttachQualification" form:"fileAttachQualification"` Remark string `json:"remark" form:"remark"` }
type Province ¶
type RegisterUser ¶
type RegisterUser struct { Username string `json:"username" form:"username" binding:"required,min=6,max=50"` Password string `json:"password" form:"password" binding:"required,min=6,max=20"` FirstName string `json:"firstName" form:"firstName" binding:"required"` LastName string `json:"lastName" form:"lastName" binding:"required"` Email string `json:"email" form:"email" binding:"required,email"` }
type Role ¶
type SplSubType ¶
type SplSubType struct { gorm.Model NameTH string `json:"nameTH" form:"nameTH"` NameEN string `json:"nameEN" form:"nameEN"` SplTypeID int `json:"splTypeID" form:"splTypeID"` SplType SplType `json:"splType" form:"splType"` }
func (SplSubType) Serialize ¶
func (s SplSubType) Serialize() map[string]interface{}
type SplType ¶
type SubDistrict ¶
type SubDistrict struct { gorm.Model Code int `json:"code" form:"code"` NameTH string `json:"nameTH" form:"nameTH"` NameEN string `json:"nameEN" form:"nameEN"` ZipCode int `json:"zipCode" form:"zipCode"` DistrictID int `json:"districtID" form:"districtID"` }
func (SubDistrict) Serialize ¶
func (s SubDistrict) Serialize() map[string]interface{}
type SwagCreateBase ¶
type SwagCreateUserResponse ¶
type SwagCreateUserResponse struct { SwagCreateBase Data SwagUser `json:"data"` }
type SwagDeleteBase ¶
type SwagError400 ¶
type SwagError404 ¶
type SwagError500 ¶
type SwagGetAllUsersResponse ¶
type SwagGetAllUsersResponse struct { SwagGetBase Data []SwagUser `json:"data"` PageMeta SwagPageMeta `json:"pageMeta"` }
type SwagGetBase ¶
type SwagGetRoleResponse ¶
type SwagGetRoleResponse struct { SwagGetBase Data Role `json:"data"` }
type SwagGetUserResponse ¶
type SwagGetUserResponse struct { SwagGetBase 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 SwagUser `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,min=6,max=50"` Password string `json:"password" form:"password" gorm:"not null" binding:"required,min=6,max=20"` 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" binding:"required,email"` 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"` RoleID int `json:"roleId" form:"roleId"` Role Role `json:"role" ` Profile Profile }
func (*User) GenerateJwtToken ¶
GenerateJwtToken -- Generate JWT token associated to this user
func (*User) GetUserStatusAsString ¶
func (*User) IsNotAdmin ¶
Click to show internal directories.
Click to hide internal directories.