Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = sqlx.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type AdminsModel ¶
type AdminsModel interface {
// contains filtered or unexported methods
}
AdminsModel is an interface to be customized, add more methods here, and implement the added methods in customAdminsModel.
func NewAdminsModel ¶
func NewAdminsModel(conn sqlx.SqlConn) AdminsModel
NewAdminsModel returns a model for the database table.
type LoginRecords ¶
type LoginRecords struct { Id uint64 `db:"id"` // 记录ID UserId uint64 `db:"user_id"` // 用户ID LoginIp string `db:"login_ip"` // 登录IP LoginLocation sql.NullString `db:"login_location"` // 登录地点 DeviceType sql.NullString `db:"device_type"` // 设备类型 CreatedAt time.Time `db:"created_at"` // 创建时间 }
type LoginRecordsModel ¶
type LoginRecordsModel interface { FindByUserId(ctx context.Context, userId uint64, limit int) ([]*LoginRecords, error) BatchInsert(ctx context.Context, records []*LoginRecords) error Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error // contains filtered or unexported methods }
LoginRecordsModel is an interface to be customized, add more methods here, and implement the added methods in customLoginRecordsModel.
func NewLoginRecordsModel ¶
func NewLoginRecordsModel(conn sqlx.SqlConn) LoginRecordsModel
NewLoginRecordsModel returns a model for the database table.
type TransactionStats ¶
type UserAddresses ¶
type UserAddresses struct { Id uint64 `db:"id"` // 地�ID UserId uint64 `db:"user_id"` // 用户ID ReceiverName string `db:"receiver_name"` // 收货人姓� ReceiverPhone string `db:"receiver_phone"` // 收货人电� Province string `db:"province"` // �份 City string `db:"city"` // 城市 District string `db:"district"` // 区/县 DetailAddress string `db:"detail_address"` // 详细地� IsDefault int64 `db:"is_default"` // 是�默认地� CreatedAt time.Time `db:"created_at"` // 创建时间 UpdatedAt time.Time `db:"updated_at"` // 更新时间 }
type UserAddressesModel ¶
type UserAddressesModel interface { WithSession(session sqlx.Session) UserAddressesModel FindByUserId(ctx context.Context, userId uint64) ([]*UserAddresses, error) SetDefault(ctx context.Context, userId, addressId uint64) error Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error // contains filtered or unexported methods }
func NewUserAddressesModel ¶
func NewUserAddressesModel(conn sqlx.SqlConn) UserAddressesModel
type Users ¶
type Users struct { Id uint64 `db:"id"` // 用户ID Username string `db:"username"` // 用户å�� Password string `db:"password"` // 密ç � Phone sql.NullString `db:"phone"` // 手机å�· Email sql.NullString `db:"email"` // 邮箱 Nickname sql.NullString `db:"nickname"` // 昵称 Avatar sql.NullString `db:"avatar"` // 头åƒ�URL Gender string `db:"gender"` // 性别 MemberLevel int64 `db:"member_level"` // 会员ç‰çº§ Status int64 `db:"status"` // 状æ€� 0:ç¦�用 1:å�¯ç”¨ Online int64 `db:"online"` // 状æ€� 0:离线 1:在线 CreatedAt time.Time `db:"created_at"` // 创建时间 UpdatedAt time.Time `db:"updated_at"` // 更新时间 }
type UsersModel ¶
type UsersModel interface { WithSession(session sqlx.Session) UsersModel FindOneByPhoneOrEmail(ctx context.Context, account string) (*Users, error) UpdatePassword(ctx context.Context, id uint64, password string) error UpdateStatus(ctx context.Context, id uint64, status int32) error UpdateProfile(ctx context.Context, id uint64, nickname string, gender string) error UpdateOnline(ctx context.Context, id uint64, online int32) error Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error // contains filtered or unexported methods }
UsersModel is an interface to be customized, add more methods here, and implement the added methods in customUsersModel.
func NewUsersModel ¶
func NewUsersModel(conn sqlx.SqlConn) UsersModel
NewUsersModel returns a model for the database table.
type WalletAccounts ¶
type WalletAccounts struct { Id uint64 `db:"id"` // 钱包ID UserId uint64 `db:"user_id"` // 用户ID Balance float64 `db:"balance"` // 账户余é¢� FrozenAmount float64 `db:"frozen_amount"` // 冻结金é¢� PayPassword sql.NullString `db:"pay_password"` // 支付密ç � Status int64 `db:"status"` // 状æ€� 0:冻结 1:æ£å¸¸ CreatedAt time.Time `db:"created_at"` // 创建时间 UpdatedAt time.Time `db:"updated_at"` // 更新时间 }
type WalletAccountsModel ¶
type WalletAccountsModel interface { WithSession(session sqlx.Session) WalletAccountsModel UpdateBalance(ctx context.Context, userId uint64, amount float64) error FreezeAmount(ctx context.Context, userId uint64, amount float64) error UnfreezeAmount(ctx context.Context, userId uint64, amount float64) error UpdatePayPassword(ctx context.Context, userId uint64, password string) error DeleteByUserId(ctx context.Context, userId uint64) error Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error // contains filtered or unexported methods }
func NewWalletAccountsModel ¶
func NewWalletAccountsModel(conn sqlx.SqlConn) WalletAccountsModel
type WalletTransactions ¶
type WalletTransactions struct { Id uint64 `db:"id"` // 交易ID UserId uint64 `db:"user_id"` // 用户ID OrderId string `db:"order_id"` // 订å�•å�· Amount float64 `db:"amount"` // 交易金é¢� Type int64 `db:"type"` // 交易类型 1:充值 2:æ��现 3:消费 4:退款 Status int64 `db:"status"` // 交易状æ€� 0:处ç�†ä¸ 1:æˆ�功 2:失败 Remark sql.NullString `db:"remark"` // 交易备注 CreatedAt time.Time `db:"created_at"` // 创建时间 UpdatedAt time.Time `db:"updated_at"` // 更新时间 }
type WalletTransactionsModel ¶
type WalletTransactionsModel interface { WithSession(session sqlx.Session) WalletTransactionsModel FindByUserId(ctx context.Context, userId uint64, page, pageSize int) ([]*WalletTransactions, error) FindByType(ctx context.Context, userId uint64, transType int64) ([]*WalletTransactions, error) GetTransactionStats(ctx context.Context, tranId uint64) (*TransactionStats, error) UpdateState(ctx context.Context, status int64, tranId uint64) (int64, error) DeleteByUserId(ctx context.Context, userId uint64) error Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error // contains filtered or unexported methods }
func NewWalletTransactionsModel ¶
func NewWalletTransactionsModel(conn sqlx.SqlConn) WalletTransactionsModel
Source Files ¶
Click to show internal directories.
Click to hide internal directories.