database

package
v0.0.0-...-3a65944 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOrUpdateEmailParams

type AddOrUpdateEmailParams struct {
	UserID           uint32
	TwoFactorEmail   sql.NullString
	TwoFactorEmail_2 sql.NullString
}

type AddUserAutoUserIdParams

type AddUserAutoUserIdParams struct {
	UserAccount          string
	UserNickname         sql.NullString
	UserAvatar           sql.NullString
	UserState            uint8
	UserMobile           sql.NullString
	UserGender           sql.NullInt16
	UserBirthday         sql.NullTime
	UserEmail            sql.NullString
	UserIsAuthentication uint8
}

type AddUserBaseParams

type AddUserBaseParams struct {
	UserAccount  string
	UserPassword string
	UserSalt     string
}

type AddUserHaveUserIdParams

type AddUserHaveUserIdParams struct {
	UserID               uint64
	UserAccount          string
	UserNickname         sql.NullString
	UserAvatar           sql.NullString
	UserState            uint8
	UserMobile           sql.NullString
	UserGender           sql.NullInt16
	UserBirthday         sql.NullTime
	UserEmail            sql.NullString
	UserIsAuthentication uint8
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DecreaseTicketV1Params

type DecreaseTicketV1Params struct {
	StockAvailable   int32
	ID               int64
	StockAvailable_2 int32
}

type DecreaseTicketV2Params

type DecreaseTicketV2Params struct {
	StockAvailable   int32
	ID               int64
	StockAvailable_2 int32
}

type DisableTwoFactorParams

type DisableTwoFactorParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

type EditUserByUserIdParams

type EditUserByUserIdParams struct {
	UserNickname sql.NullString
	UserAvatar   sql.NullString
	UserMobile   sql.NullString
	UserGender   sql.NullInt16
	UserBirthday sql.NullTime
	UserEmail    sql.NullString
	UserID       uint64
}

type EnableTwoFactorTypeEmailParams

type EnableTwoFactorTypeEmailParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
	TwoFactorEmail    sql.NullString
}

type FindUsersParams

type FindUsersParams struct {
	UserAccount  string
	UserNickname sql.NullString
}

type GetInfoOTPRow

type GetInfoOTPRow struct {
	VerifyID      int32
	VerifyOtp     string
	VerifyKey     string
	VerifyKeyHash string
	VerifyType    sql.NullInt32
	IsVerified    sql.NullInt32
	IsDeleted     sql.NullInt32
}

type GetOneUserInfoAdminRow

type GetOneUserInfoAdminRow struct {
	UserID         int32
	UserAccount    string
	UserPassword   string
	UserSalt       string
	UserLoginTime  sql.NullTime
	UserLogoutTime sql.NullTime
	UserLoginIp    sql.NullString
	UserCreatedAt  sql.NullTime
	UserUpdatedAt  sql.NullTime
}

type GetOneUserInfoRow

type GetOneUserInfoRow struct {
	UserID       int32
	UserAccount  string
	UserPassword string
	UserSalt     string
}

type GetTicketItemByIdRow

type GetTicketItemByIdRow struct {
	ID             int64
	Name           string
	StockInitial   int32
	StockAvailable int32
}

type GetTwoFactorMethodByIDAndByTypeParams

type GetTwoFactorMethodByIDAndByTypeParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

type GetTwoFactorMethodByIDAndByTypeRow

type GetTwoFactorMethodByIDAndByTypeRow struct {
	UserID              uint32
	TwoFactorAuthType   PreGoAccUserTwoFactor9999TwoFactorAuthType
	TwoFactorAuthSecret string
	TwoFactorEmail      sql.NullString
	TwoFactorPhone      sql.NullString
	TwoFactorIsActive   bool
	TwoFactorCreatedAt  sql.NullTime
	TwoFactorUpdatedAt  sql.NullTime
}

type GetTwoFactorMethodByIDRow

type GetTwoFactorMethodByIDRow struct {
	UserID              uint32
	TwoFactorAuthType   PreGoAccUserTwoFactor9999TwoFactorAuthType
	TwoFactorAuthSecret string
	TwoFactorEmail      sql.NullString
	TwoFactorPhone      sql.NullString
	TwoFactorIsActive   bool
	TwoFactorCreatedAt  sql.NullTime
	TwoFactorUpdatedAt  sql.NullTime
}

type GetTwoFactorStatusParams

type GetTwoFactorStatusParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

type GetUserByEmailSQLCRow

type GetUserByEmailSQLCRow struct {
	UsrEmail string
	UsrID    uint32
}

type GetUserTwoFactoryMethodsRow

type GetUserTwoFactoryMethodsRow struct {
	UserID              uint32
	TwoFactorAuthType   PreGoAccUserTwoFactor9999TwoFactorAuthType
	TwoFactorAuthSecret string
	TwoFactorEmail      sql.NullString
	TwoFactorPhone      sql.NullString
	TwoFactorIsActive   bool
	TwoFactorCreatedAt  sql.NullTime
	TwoFactorUpdatedAt  sql.NullTime
}

type GetValidOtpRow

type GetValidOtpRow struct {
	VerifyOtp     string
	VerifyKeyHash string
	VerifyKey     string
	VerifyID      int32
}

type GoCrmUser

type GoCrmUser struct {
	// Account ID
	UsrID uint32
	// Email
	UsrEmail string
	// Phone Number
	UsrPhone string
	// Username
	UsrUsername string
	// Password
	UsrPassword string
	// Created Time
	UsrCreatedAt int32
	// Updated Time
	UsrUpdatedAt int32
	// Created IP
	UsrCreateIpAt string
	// Last Login Time
	UsrLastLoginAt int32
	// Last Login IP
	UsrLastLoginIpAt string
	// Login Times
	UsrLoginTimes int32
	// Status
	UsrStatus bool
}

Account

type InsertOTPVerifyParams

type InsertOTPVerifyParams struct {
	VerifyOtp     string
	VerifyKey     string
	VerifyKeyHash string
	VerifyType    sql.NullInt32
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32
	Offset int32
}

type LoginUserBaseParams

type LoginUserBaseParams struct {
	UserLoginIp  sql.NullString
	UserAccount  string
	UserPassword string
}

type NullPreGoAccUserTwoFactor9999TwoFactorAuthType

type NullPreGoAccUserTwoFactor9999TwoFactorAuthType struct {
	PreGoAccUserTwoFactor9999TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
	Valid                                      bool // Valid is true if PreGoAccUserTwoFactor9999TwoFactorAuthType is not NULL
}

func (*NullPreGoAccUserTwoFactor9999TwoFactorAuthType) Scan

func (ns *NullPreGoAccUserTwoFactor9999TwoFactorAuthType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPreGoAccUserTwoFactor9999TwoFactorAuthType) Value

Value implements the driver Valuer interface.

type PreGoAccUserBase9999

type PreGoAccUserBase9999 struct {
	// User ID
	UserID int32
	// User account
	UserAccount string
	// User password
	UserPassword string
	// Salt for hashing
	UserSalt string
	// Last login timestamp
	UserLoginTime sql.NullTime
	// Last logout timestamp
	UserLogoutTime sql.NullTime
	// IP address of last login
	UserLoginIp sql.NullString
	// Creation timestamp
	UserCreatedAt sql.NullTime
	// Update timestamp
	UserUpdatedAt sql.NullTime
	// authentication two factor enabled for the user
	IsTwoFactorEnabled sql.NullInt32
}

type PreGoAccUserInfo9999

type PreGoAccUserInfo9999 struct {
	// User  ID
	UserID uint64
	// User  account
	UserAccount string
	// User  nickname
	UserNickname sql.NullString
	// User  avatar
	UserAvatar sql.NullString
	// User  state: 0-Locked, 1-Activated, 2-Not Activated
	UserState uint8
	// Mobile phone number
	UserMobile sql.NullString
	// User  gender: 0-Secret, 1-Male, 2-Female
	UserGender sql.NullInt16
	// User  birthday
	UserBirthday sql.NullTime
	// User  email address
	UserEmail sql.NullString
	// Authentication status: 0-Not Authenticated, 1-Pending, 2-Authenticated, 3-Failed
	UserIsAuthentication uint8
	// Record creation time
	CreatedAt sql.NullTime
	// Record update time
	UpdatedAt sql.NullTime
}

type PreGoAccUserTwoFactor9999

type PreGoAccUserTwoFactor9999 struct {
	// Khoa chinh tu dong tang
	TwoFactorID uint32
	// Khoa ngoai lien ket voi bang nguoi dung
	UserID uint32
	// Loai xac thuc 2fa
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
	// Ma bi mat xac thuc 2fa
	TwoFactorAuthSecret string
	// So dien thoai xac thuc 2fa
	TwoFactorPhone sql.NullString
	// Email xac thuc 2fa
	TwoFactorEmail sql.NullString
	// Trang thai kich hoat xac thuc 2fa
	TwoFactorIsActive bool
	// Thoi gian tao xac thuc 2fa
	TwoFactorCreatedAt sql.NullTime
	// Thoi gian cap nhat xac thuc 2fa
	TwoFactorUpdatedAt sql.NullTime
}

pre_go_acc_user_two_factor_9999

type PreGoAccUserTwoFactor9999TwoFactorAuthType

type PreGoAccUserTwoFactor9999TwoFactorAuthType string
const (
	PreGoAccUserTwoFactor9999TwoFactorAuthTypeEMAIL PreGoAccUserTwoFactor9999TwoFactorAuthType = "EMAIL"
	PreGoAccUserTwoFactor9999TwoFactorAuthTypeSMS   PreGoAccUserTwoFactor9999TwoFactorAuthType = "SMS"
	PreGoAccUserTwoFactor9999TwoFactorAuthTypeAPP   PreGoAccUserTwoFactor9999TwoFactorAuthType = "APP"
)

func (*PreGoAccUserTwoFactor9999TwoFactorAuthType) Scan

func (e *PreGoAccUserTwoFactor9999TwoFactorAuthType) Scan(src interface{}) error

type PreGoAccUserVerify9999

type PreGoAccUserVerify9999 struct {
	// Verification ID
	VerifyID int32
	// One-time password
	VerifyOtp string
	// Verification key - email address, phone number, ....
	VerifyKey string
	// Hash of the verification key
	VerifyKeyHash string
	// Verification type (e.g., 1 for email)
	VerifyType sql.NullInt32
	// Verification status: 1 for verified, 0 for not verified
	IsVerified sql.NullInt32
	// Deletion flag: 1 for deleted, 0 for not deleted
	IsDeleted sql.NullInt32
	// Record creation time
	VerifyCreatedAt sql.NullTime
	// Record update time
	VerifyUpdatedAt sql.NullTime
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddOrUpdateEmail

func (q *Queries) AddOrUpdateEmail(ctx context.Context, arg AddOrUpdateEmailParams) error

func (*Queries) AddUserAutoUserId

func (q *Queries) AddUserAutoUserId(ctx context.Context, arg AddUserAutoUserIdParams) (sql.Result, error)

func (*Queries) AddUserBase

func (q *Queries) AddUserBase(ctx context.Context, arg AddUserBaseParams) (sql.Result, error)

func (*Queries) AddUserHaveUserId

func (q *Queries) AddUserHaveUserId(ctx context.Context, arg AddUserHaveUserIdParams) (sql.Result, error)

func (*Queries) CheckTicketItemExists

func (q *Queries) CheckTicketItemExists(ctx context.Context, id int64) (int64, error)

func (*Queries) CheckUserBaseExists

func (q *Queries) CheckUserBaseExists(ctx context.Context, userAccount string) (int64, error)

func (*Queries) DecreaseTicketV1

func (q *Queries) DecreaseTicketV1(ctx context.Context, arg DecreaseTicketV1Params) (sql.Result, error)

func (*Queries) DecreaseTicketV2

func (q *Queries) DecreaseTicketV2(ctx context.Context, arg DecreaseTicketV2Params) (sql.Result, error)

func (*Queries) DisableTwoFactor

func (q *Queries) DisableTwoFactor(ctx context.Context, arg DisableTwoFactorParams) error

func (*Queries) EditUserByUserId

func (q *Queries) EditUserByUserId(ctx context.Context, arg EditUserByUserIdParams) (sql.Result, error)

func (*Queries) EnableTwoFactorTypeEmail

func (q *Queries) EnableTwoFactorTypeEmail(ctx context.Context, arg EnableTwoFactorTypeEmailParams) error

func (*Queries) FindUsers

func (q *Queries) FindUsers(ctx context.Context, arg FindUsersParams) ([]PreGoAccUserInfo9999, error)

func (*Queries) GetInfoOTP

func (q *Queries) GetInfoOTP(ctx context.Context, verifyKeyHash string) (GetInfoOTPRow, error)

func (*Queries) GetOneUserInfo

func (q *Queries) GetOneUserInfo(ctx context.Context, userAccount string) (GetOneUserInfoRow, error)

func (*Queries) GetOneUserInfoAdmin

func (q *Queries) GetOneUserInfoAdmin(ctx context.Context, userAccount string) (GetOneUserInfoAdminRow, error)

func (*Queries) GetTicketItemById

func (q *Queries) GetTicketItemById(ctx context.Context, id int64) (GetTicketItemByIdRow, error)

func (*Queries) GetTwoFactorMethodByID

func (q *Queries) GetTwoFactorMethodByID(ctx context.Context, userID uint32) (GetTwoFactorMethodByIDRow, error)

func (*Queries) GetTwoFactorStatus

func (q *Queries) GetTwoFactorStatus(ctx context.Context, arg GetTwoFactorStatusParams) (bool, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, userID uint64) (PreGoAccUserInfo9999, error)

func (*Queries) GetUserByEmailSQLC

func (q *Queries) GetUserByEmailSQLC(ctx context.Context, usrEmail string) (GetUserByEmailSQLCRow, error)

func (*Queries) GetUserTwoFactoryMethods

func (q *Queries) GetUserTwoFactoryMethods(ctx context.Context, userID uint32) ([]GetUserTwoFactoryMethodsRow, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context, userID uint64) ([]PreGoAccUserInfo9999, error)

func (*Queries) GetValidOtp

func (q *Queries) GetValidOtp(ctx context.Context, verifyKeyHash string) (GetValidOtpRow, error)

func (*Queries) InsertOTPVerify

func (q *Queries) InsertOTPVerify(ctx context.Context, arg InsertOTPVerifyParams) (sql.Result, error)

func (*Queries) IsTwoFactorEnabled

func (q *Queries) IsTwoFactorEnabled(ctx context.Context, userID uint32) (int64, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]PreGoAccUserInfo9999, error)

func (*Queries) LoginUserBase

func (q *Queries) LoginUserBase(ctx context.Context, arg LoginUserBaseParams) error

func (*Queries) LogoutUserBase

func (q *Queries) LogoutUserBase(ctx context.Context, userAccount string) error

func (*Queries) ReactivateTwoFactor

func (q *Queries) ReactivateTwoFactor(ctx context.Context, arg ReactivateTwoFactorParams) error

func (*Queries) RemoveTwoFactor

func (q *Queries) RemoveTwoFactor(ctx context.Context, arg RemoveTwoFactorParams) error

func (*Queries) RemoveUser

func (q *Queries) RemoveUser(ctx context.Context, userID uint64) error

func (*Queries) UpdatePassword

func (q *Queries) UpdatePassword(ctx context.Context, arg UpdatePasswordParams) error

func (*Queries) UpdateTwoFactorStatus

func (q *Queries) UpdateTwoFactorStatus(ctx context.Context, arg UpdateTwoFactorStatusParams) error

func (*Queries) UpdateUserStatusByUserId

func (q *Queries) UpdateUserStatusByUserId(ctx context.Context) error

func (*Queries) UpdateUserVerificationStatus

func (q *Queries) UpdateUserVerificationStatus(ctx context.Context, verifyKeyHash string) error

update lai

func (*Queries) VerifyTwoFactor

func (q *Queries) VerifyTwoFactor(ctx context.Context, arg VerifyTwoFactorParams) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type ReactivateTwoFactorParams

type ReactivateTwoFactorParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

type RemoveTwoFactorParams

type RemoveTwoFactorParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

type TicketItem

type TicketItem struct {
	// Primary key
	ID int64
	// Ticket title
	Name string
	// Ticket description
	Description sql.NullString
	// Initial stock quantity (e.g., 1000 tickets)
	StockInitial int32
	// Current available stock (e.g., 900 tickets)
	StockAvailable int32
	// Indicates if stock is pre-warmed (0/1)
	IsStockPrepared bool
	// Original ticket price
	PriceOriginal int64
	// Discounted price during flash sale
	PriceFlash int64
	// Flash sale start time
	SaleStartTime time.Time
	// Flash sale end time
	SaleEndTime time.Time
	// Ticket status (e.g., active/inactive)
	Status int32
	// ID of associated activity
	ActivityID int64
	// Timestamp of the last update
	UpdatedAt time.Time
	// Creation timestamp
	CreatedAt time.Time
}

Table for ticket details

type UpdatePasswordParams

type UpdatePasswordParams struct {
	UserPassword string
	UserID       int32
}

type UpdateTwoFactorStatusParams

type UpdateTwoFactorStatusParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

type VerifyTwoFactorParams

type VerifyTwoFactorParams struct {
	UserID            uint32
	TwoFactorAuthType PreGoAccUserTwoFactor9999TwoFactorAuthType
}

Jump to

Keyboard shortcuts

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