Versions in this module Expand all Collapse all v1 v1.0.1 Nov 17, 2024 v1.0.0 Oct 29, 2024 Changes in this version + const DISPLAY_FLAGS_DEFAULT + type AddData struct + Email string + Password string + Username string + type AddMode string + const FriendAddModeOfAccountInvitation + const FriendAddModeOfFriendInvitation + const FriendAddModeOfFriendOnInvitation + type Client interface + CheckUserAgent func(userAgent string) bool + GetByUser func(User) error + GetUserId func() uint + InitByUser func(User, *gorm.DB) error + IsCurrentAccount func(accountId uint) bool + IsCurrentShareAccount func(accountId uint) bool + func GetUserClientModel(client constant.Client) Client + type ClientMap map[constant.Client]Client + func GetClients() ClientMap + type Condition struct + Id *uint + LikePrefixUsername *string + Limit int + Offset int + type Flag uint + const FLAG_ACCOUNT + const FLAG_AMOUNT + const FLAG_CATEGORY + const FLAG_CREATE_TIME + const FLAG_REMARK + const FLAG_TRADE_TIME + const FLAG_UPDATE_TIME + type Friend struct + AddMode AddMode + CreatedAt time.Time + DeletedAt gorm.DeletedAt + FriendId uint + ID uint + UpdatedAt time.Time + UserId uint + func (f *Friend) GetFriend(args ...interface{}) (User, error) + func (f *Friend) GetFriendInfo() (info UserInfo, err error) + func (f *Friend) TableName() string + type FriendInvitation struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + Invitee uint + Inviter uint + Status FriendInvitationStatus + UpdatedAt time.Time + func (f *FriendInvitation) Accept(tx *gorm.DB) (inviterFriend Friend, inviteeFriend Friend, err error) + func (f *FriendInvitation) AddFriend(tx *gorm.DB) (inviterFriend Friend, inviteeFriend Friend, err error) + func (f *FriendInvitation) ForShare(tx *gorm.DB) error + func (f *FriendInvitation) ForUpdate(tx *gorm.DB) error + func (f *FriendInvitation) GetInviteeInfo() (UserInfo, error) + func (f *FriendInvitation) GetInviterInfo() (UserInfo, error) + func (f *FriendInvitation) Refuse(tx *gorm.DB) error + func (f *FriendInvitation) TableName() string + func (f *FriendInvitation) UpdateStatus(status FriendInvitationStatus, tx *gorm.DB) error + type FriendInvitationStatus int + const InvitationStatsOfAccept + const InvitationStatsOfRefuse + const InvitationStatsOfWaiting + type Log struct + Action constant.UserAction + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + Remark string + UpdatedAt time.Time + UserId uint + func (l *Log) IsEmpty() bool + func (l *Log) TableName() string + type LogAddData struct + Action constant.UserAction + Remark string + type LogDao struct + func NewLogDao(db *gorm.DB) *LogDao + func (l *LogDao) Add(user User, data *LogAddData) (*Log, error) + type Tour struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + Status bool + UpdatedAt time.Time + UserId uint + func (t *Tour) GetUser(db *gorm.DB) (user User, err error) + func (t *Tour) Use(db *gorm.DB) error + func (u *Tour) TableName() string + type TransactionShareConfig struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + DisplayFlags Flag + ID uint + UpdatedAt time.Time + UserId uint + func (u *TransactionShareConfig) ClosedDisplayFlag(flag Flag, db *gorm.DB) error + func (u *TransactionShareConfig) GetFlagStatus(flag Flag) bool + func (u *TransactionShareConfig) OpenDisplayFlag(flag Flag, db *gorm.DB) error + func (u *TransactionShareConfig) SelectByUserId(userId uint) error + func (u *TransactionShareConfig) TableName() string + type User struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + Email string + ID uint + Password string + UpdatedAt time.Time + Username string + func (u *User) GetTransactionShareConfig() (TransactionShareConfig, error) + func (u *User) GetUserClient(client constant.Client, db *gorm.DB) (clientInfo UserClientBaseInfo, err error) + func (u *User) IsTourist(db *gorm.DB) (bool, error) + func (u *User) ModifyAsTourist(db *gorm.DB) error + func (u *User) SelectById(id uint, selects ...interface{}) error + type UserClientAndroid struct + DeviceNumber string + Version string + func (a *UserClientAndroid) CheckUserAgent(userAgent string) bool + func (a *UserClientAndroid) GetByUser(user User) error + func (a *UserClientAndroid) InitByUser(user User, tx *gorm.DB) error + func (a *UserClientAndroid) IsEmpty() bool + type UserClientBaseInfo struct + CurrentAccountId uint + CurrentShareAccountId uint + LoginTime time.Time + UserId uint + func (u *UserClientBaseInfo) CheckUserAgent(string) bool + func (u *UserClientBaseInfo) GetByUser(User) error + func (uci *UserClientBaseInfo) GetUserId() uint + func (uci *UserClientBaseInfo) IsCurrentAccount(accountId uint) bool + func (uci *UserClientBaseInfo) IsCurrentShareAccount(accountId uint) bool + type UserClientIos struct + DeviceNumber string + Version string + func (i *UserClientIos) CheckUserAgent(userAgent string) bool + func (i *UserClientIos) GetByUser(user User) error + func (i *UserClientIos) InitByUser(user User, tx *gorm.DB) error + func (i *UserClientIos) IsEmpty() bool + type UserClientWeb struct + WebName string + func (w *UserClientWeb) CheckUserAgent(userAgent string) bool + func (w *UserClientWeb) GetByUser(user User) error + func (w *UserClientWeb) InitByUser(user User, tx *gorm.DB) error + func (w *UserClientWeb) IsEmpty() bool + type UserDao struct + func NewDao(db ...*gorm.DB) *UserDao + func (u *UserDao) Add(data AddData) (User, error) + func (u *UserDao) AddFriend(userId uint, friendId uint, add AddMode) (mapping Friend, err error) + func (u *UserDao) CheckEmail(email string) error + func (u *UserDao) CreateFriendInvitation(inviter uint, invitee uint) (FriendInvitation, error) + func (u *UserDao) CreateTour(user User) (Tour, error) + func (u *UserDao) IsRealFriend(userId uint, friendId uint) (bool, error) + func (u *UserDao) PluckNameById(id uint) (string, error) + func (u *UserDao) SelectByDeviceNumber(client constant.Client, deviceNumber string) (clientBaseInfo UserClientBaseInfo, err error) + func (u *UserDao) SelectByEmail(email string) (User, error) + func (u *UserDao) SelectById(id uint, args ...interface{}) (User, error) + func (u *UserDao) SelectByUnusedTour() (tour Tour, err error) + func (u *UserDao) SelectClientInfoByUserAndAccount(client constant.Client, userId, accountId uint) (result []UserClientBaseInfo, err error) + func (u *UserDao) SelectFriend(userId uint, friendId uint) (Friend, error) + func (u *UserDao) SelectFriendInvitation(inviter uint, invitee uint, forUpdate bool) (result FriendInvitation, err error) + func (u *UserDao) SelectFriendInvitationList(inviter *uint, invitee *uint) (result []FriendInvitation, err error) + func (u *UserDao) SelectFriendList(userId uint) (result []Friend, err error) + func (u *UserDao) SelectTour(userId uint) (Tour, error) + func (u *UserDao) SelectUserClient(userId uint, client constant.Client) (Client, error) + func (u *UserDao) SelectUserClientBaseInfo(userId uint, client constant.Client) (result UserClientBaseInfo, err error) + func (u *UserDao) SelectUserInfoByCondition(condition Condition) ([]UserInfo, error) + func (u *UserDao) SelectUserInfoById(id uint) (result UserInfo, err error) + func (u *UserDao) UpdateUserClientBaseInfo(userId uint, client constant.Client) (result UserClientBaseInfo, err error) + type UserInfo struct + Email string + ID uint + Username string