account

package
v1.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2025 License: MulanPSL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const KeyAccountId = "account_id"

Variables

This section is empty.

Functions

func AdministratorVerification

func AdministratorVerification() gin.HandlerFunc

func CheckAuthCode

func CheckAuthCode(email, inputAuthCode string, isExist bool) (isValid bool)

func ExistEmailAccountValidateKey

func ExistEmailAccountValidateKey(email string) string

func NewEmailAccountValidateKey

func NewEmailAccountValidateKey(email string) string

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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL