Documentation ¶
Index ¶
- Constants
- type AddData
- type AddMode
- type Client
- type ClientMap
- type Condition
- type Flag
- type Friend
- type FriendInvitation
- 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
- type Log
- type LogAddData
- type LogDao
- type Tour
- type TransactionShareConfig
- 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
- 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
- type UserClientBaseInfo
- type UserClientIos
- type UserClientWeb
- type 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
Constants ¶
View Source
const DISPLAY_FLAGS_DEFAULT = FLAG_AMOUNT + FLAG_CATEGORY + FLAG_TRADE_TIME + FLAG_ACCOUNT + FLAG_REMARK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { commonModel.Model GetByUser(User) error CheckUserAgent(userAgent string) bool InitByUser(User, *gorm.DB) error GetUserId() uint IsCurrentAccount(accountId uint) bool }
func GetUserClientModel ¶
type ClientMap ¶
func GetClients ¶
func GetClients() ClientMap
type Friend ¶
type Friend struct { ID uint `gorm:"primarykey"` UserId uint `gorm:"uniqueIndex:idx_mapping,priority:1"` FriendId uint `gorm:"uniqueIndex:idx_mapping,priority:2;"` AddMode AddMode CreatedAt time.Time `gorm:"type:TIMESTAMP"` UpdatedAt time.Time `gorm:"type:TIMESTAMP"` DeletedAt gorm.DeletedAt `gorm:"index;type:TIMESTAMP"` }
func (*Friend) GetFriendInfo ¶
type FriendInvitation ¶
type FriendInvitation struct { ID uint `gorm:"primarykey"` Inviter uint `gorm:"uniqueIndex:idx_mapping,priority:1"` Invitee uint `gorm:"uniqueIndex:idx_mapping,priority:2"` Status FriendInvitationStatus CreatedAt time.Time `gorm:"type:TIMESTAMP"` UpdatedAt time.Time `gorm:"type:TIMESTAMP"` DeletedAt gorm.DeletedAt `gorm:"index;type:TIMESTAMP"` }
邀请
func (*FriendInvitation) GetInviteeInfo ¶
func (f *FriendInvitation) GetInviteeInfo() (UserInfo, error)
func (*FriendInvitation) GetInviterInfo ¶
func (f *FriendInvitation) GetInviterInfo() (UserInfo, error)
func (*FriendInvitation) TableName ¶
func (f *FriendInvitation) TableName() string
func (*FriendInvitation) UpdateStatus ¶
func (f *FriendInvitation) UpdateStatus(status FriendInvitationStatus, tx *gorm.DB) error
type FriendInvitationStatus ¶
type FriendInvitationStatus int
const ( InvitationStatsOfWaiting FriendInvitationStatus = iota InvitationStatsOfAccept InvitationStatsOfRefuse )
type Log ¶
type Log struct { ID uint `gorm:"primarykey"` UserId uint `gorm:"comment:用户id;not null"` Action constant.UserAction `gorm:"comment:操作;not null;size:32"` Remark string `gorm:"comment:备注;not null;size:255"` CreatedAt time.Time `gorm:"type:TIMESTAMP"` UpdatedAt time.Time `gorm:"type:TIMESTAMP"` DeletedAt gorm.DeletedAt `gorm:"index;type:TIMESTAMP"` commonModel.BaseModel }
type LogAddData ¶
type LogAddData struct { Action constant.UserAction Remark string }
type Tour ¶
type TransactionShareConfig ¶
type TransactionShareConfig struct {}
func (*TransactionShareConfig) ClosedDisplayFlag ¶
func (u *TransactionShareConfig) ClosedDisplayFlag(flag Flag, db *gorm.DB) error
func (*TransactionShareConfig) GetFlagStatus ¶
func (u *TransactionShareConfig) GetFlagStatus(flag Flag) bool
func (*TransactionShareConfig) OpenDisplayFlag ¶
func (u *TransactionShareConfig) OpenDisplayFlag(flag Flag, db *gorm.DB) error
func (*TransactionShareConfig) SelectByUserId ¶
func (u *TransactionShareConfig) SelectByUserId(userId uint) error
func (*TransactionShareConfig) TableName ¶
func (u *TransactionShareConfig) TableName() string
type User ¶
type User struct { ID uint `gorm:"primarykey"` Username string `gorm:"type:varchar(128);comment:'用户名'"` Password string `gorm:"type:char(64);comment:'密码'"` Email string `gorm:"type:varchar(64);comment:'邮箱';unique"` CreatedAt time.Time `gorm:"type:TIMESTAMP"` UpdatedAt time.Time `gorm:"type:TIMESTAMP"` DeletedAt gorm.DeletedAt `gorm:"index;type:TIMESTAMP"` commonModel.BaseModel }
func (*User) GetTransactionShareConfig ¶
func (u *User) GetTransactionShareConfig() (TransactionShareConfig, error)
func (*User) GetUserClient ¶
func (*User) SelectById ¶
type UserClientAndroid ¶
type UserClientAndroid struct { UserClientBaseInfo Version string DeviceNumber string `gorm:"uniqueIndex;default:null;"` commonModel.BaseModel }
func (*UserClientAndroid) CheckUserAgent ¶
func (a *UserClientAndroid) CheckUserAgent(userAgent string) bool
func (*UserClientAndroid) GetByUser ¶
func (a *UserClientAndroid) GetByUser(user User) error
func (*UserClientAndroid) InitByUser ¶
func (a *UserClientAndroid) InitByUser(user User, tx *gorm.DB) error
func (*UserClientAndroid) IsEmpty ¶
func (a *UserClientAndroid) IsEmpty() bool
type UserClientBaseInfo ¶
type UserClientBaseInfo struct { UserId uint `gorm:"primaryKey;autoIncrement:false"` CurrentAccountId uint LoginTime time.Time `gorm:"type:TIMESTAMP"` }
func (*UserClientBaseInfo) CheckUserAgent ¶
func (u *UserClientBaseInfo) CheckUserAgent(string) bool
func (*UserClientBaseInfo) GetByUser ¶
func (u *UserClientBaseInfo) GetByUser(User) error
func (*UserClientBaseInfo) GetUserId ¶
func (uci *UserClientBaseInfo) GetUserId() uint
func (*UserClientBaseInfo) IsCurrentAccount ¶
func (uci *UserClientBaseInfo) IsCurrentAccount(accountId uint) bool
func (*UserClientBaseInfo) IsCurrentShareAccount ¶
func (uci *UserClientBaseInfo) IsCurrentShareAccount(accountId uint) bool
type UserClientIos ¶
type UserClientIos struct { UserClientBaseInfo Version string DeviceNumber string `gorm:"uniqueIndex;default:null;"` commonModel.BaseModel }
func (*UserClientIos) CheckUserAgent ¶
func (i *UserClientIos) CheckUserAgent(userAgent string) bool
func (*UserClientIos) GetByUser ¶
func (i *UserClientIos) GetByUser(user User) error
func (*UserClientIos) InitByUser ¶
func (i *UserClientIos) InitByUser(user User, tx *gorm.DB) error
func (*UserClientIos) IsEmpty ¶
func (i *UserClientIos) IsEmpty() bool
type UserClientWeb ¶
type UserClientWeb struct { UserClientBaseInfo WebName string commonModel.BaseModel }
func (*UserClientWeb) CheckUserAgent ¶
func (w *UserClientWeb) CheckUserAgent(userAgent string) bool
func (*UserClientWeb) GetByUser ¶
func (w *UserClientWeb) GetByUser(user User) error
func (*UserClientWeb) InitByUser ¶
func (w *UserClientWeb) InitByUser(user User, tx *gorm.DB) error
func (*UserClientWeb) IsEmpty ¶
func (w *UserClientWeb) IsEmpty() bool
type UserDao ¶
type UserDao struct {
// contains filtered or unexported fields
}
func (*UserDao) CheckEmail ¶
func (*UserDao) CreateFriendInvitation ¶
func (u *UserDao) CreateFriendInvitation(inviter uint, invitee uint) (FriendInvitation, error)
func (*UserDao) IsRealFriend ¶
func (*UserDao) SelectByDeviceNumber ¶
func (*UserDao) SelectById ¶
func (*UserDao) SelectByUnusedTour ¶
func (*UserDao) SelectClientInfoByUserAndAccount ¶
func (*UserDao) SelectFriend ¶
func (*UserDao) SelectFriendInvitation ¶
func (*UserDao) SelectFriendInvitationList ¶
func (u *UserDao) SelectFriendInvitationList(inviter *uint, invitee *uint) (result []FriendInvitation, err error)
func (*UserDao) SelectFriendList ¶
func (*UserDao) SelectUserClient ¶
func (*UserDao) SelectUserClientBaseInfo ¶
func (*UserDao) SelectUserInfoByCondition ¶
func (*UserDao) SelectUserInfoById ¶
func (*UserDao) UpdateUserClientBaseInfo ¶
Click to show internal directories.
Click to hide internal directories.