Documentation
¶
Index ¶
- Constants
- func AdministratorVerification() gin.HandlerFunc
- func CheckAuthCode(email, inputAuthCode string, isExist bool) (isValid bool)
- func ExistEmailAccountValidateKey(email string) string
- func NewEmailAccountValidateKey(email string) string
- func TokenBasedSessionFilter() gin.HandlerFunc
- type Account
- type AccountInfoVo
- type AccountRepo
- func (repo *AccountRepo) CreateAccount(email string, srcPassword string) (account *Account, err error)
- func (repo *AccountRepo) CreateDummyAccount() (account *Account, err error)
- func (repo *AccountRepo) CreateDummyAccountWithEmail(email string, license string) (account *Account, err error)
- func (repo *AccountRepo) ExistAccountEmail(email string) (exist bool, err error)
- func (repo *AccountRepo) FindAccountById(accountId string) (account *Account, err error)
- func (repo *AccountRepo) FindAccountEmail(email string) (account *Account, err error)
- func (repo *AccountRepo) IsAdminAccount(accountId string) (isAdmin bool, err error)
- func (repo *AccountRepo) UpdateAccount(account *Account, columns ...string) (err error)
- func (repo *AccountRepo) UpdateAccountAvatar(id string, headerFileId string) (err error)
- func (repo *AccountRepo) UpdateAccountEmail(accountId string, email string, password, salt string) (err error)
- func (repo *AccountRepo) UpdateAccountPassword(accountId string, srcPassword string) (err error)
- func (repo *AccountRepo) UpdateLoginFailIncrease(id string, cnt int) (err error)
- type AccountStatus
Constants ¶
View Source
const KeyAccountId = "account_id"
Variables ¶
This section is empty.
Functions ¶
func AdministratorVerification ¶
func AdministratorVerification() gin.HandlerFunc
func CheckAuthCode ¶
func TokenBasedSessionFilter ¶ added in v1.9.18
func TokenBasedSessionFilter() gin.HandlerFunc
Types ¶
type Account ¶
type Account struct {
database.Model
Email string `gorm:"unique;index;type:varchar(128)"`
Password string `gorm:"type:varchar(32)"`
Salt string `gorm:"type:varchar(6)"`
Nickname string `gorm:"type:varchar(64)"`
IsAdmin bool
HeaderId sql.NullString `gorm:"nullable"`
Header storage.FileInfo `gorm:"foreignKey:HeaderId" json:"-"`
Status AccountStatus `gorm:"type:varchar(32)"`
FailLoginCount int
LastLoginAt *time.Time
Remark string `gorm:"type:varchar(64)"`
}
type AccountInfoVo ¶ added in v1.9.12
type AccountInfoVo struct {
AccountId string `json:"accountId"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Header string `json:"header"`
Remark string
}
func AccountInfoVoFromAccount ¶ added in v1.9.12
func AccountInfoVoFromAccount(account *Account) *AccountInfoVo
type AccountRepo ¶
type AccountRepo struct {
database.GeneralRepo
}
func GetAccountRepo ¶
func GetAccountRepo(transactionalConn *gorm.DB) (repo *AccountRepo)
func (*AccountRepo) CreateAccount ¶
func (repo *AccountRepo) CreateAccount(email string, srcPassword string) (account *Account, err error)
func (*AccountRepo) CreateDummyAccount ¶
func (repo *AccountRepo) CreateDummyAccount() (account *Account, err error)
func (*AccountRepo) CreateDummyAccountWithEmail ¶ added in v1.9.18
func (repo *AccountRepo) CreateDummyAccountWithEmail(email string, license string) (account *Account, err error)
func (*AccountRepo) ExistAccountEmail ¶
func (repo *AccountRepo) ExistAccountEmail(email string) (exist bool, err error)
func (*AccountRepo) FindAccountById ¶
func (repo *AccountRepo) FindAccountById(accountId string) (account *Account, err error)
func (*AccountRepo) FindAccountEmail ¶
func (repo *AccountRepo) FindAccountEmail(email string) (account *Account, err error)
func (*AccountRepo) IsAdminAccount ¶
func (repo *AccountRepo) IsAdminAccount(accountId string) (isAdmin bool, err error)
func (*AccountRepo) UpdateAccount ¶
func (repo *AccountRepo) UpdateAccount(account *Account, columns ...string) (err error)
func (*AccountRepo) UpdateAccountAvatar ¶
func (repo *AccountRepo) UpdateAccountAvatar(id string, headerFileId string) (err error)
func (*AccountRepo) UpdateAccountEmail ¶
func (repo *AccountRepo) UpdateAccountEmail(accountId string, email string, password, salt string) (err error)
func (*AccountRepo) UpdateAccountPassword ¶ added in v1.9.18
func (repo *AccountRepo) UpdateAccountPassword(accountId string, srcPassword string) (err error)
func (*AccountRepo) UpdateLoginFailIncrease ¶
func (repo *AccountRepo) UpdateLoginFailIncrease(id string, cnt int) (err error)
type AccountStatus ¶
type AccountStatus string
const ( ASPendingApproval AccountStatus = "pendingApproval" ASNormal AccountStatus = "normal" ASAbnormal AccountStatus = "abnormal" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.