Versions in this module Expand all Collapse all v1 v1.0.5 Nov 1, 2023 Changes in this version + const ChannelServiceName + const Web3VerifyLogin + const Web3VerifyPassword type IService + UpdateUserMsgExpireSecond func(uid string, msgExpireSecond int64) error type Model + MsgExpireSecond int64 + Web3PublicKey string type Resp + MsgExpireSecond int64 type Service + func (s *Service) UpdateUserMsgExpireSecond(uid string, msgExpireSecond int64) error type SettingDB + func (d *SettingDB) InsertUserSettingModelTx(setting *SettingModel, tx *dbr.Tx) error v1.0.4 Aug 6, 2023 v1.0.3 Aug 4, 2023 v1.0.2 Aug 3, 2023 v1.0.1 Aug 1, 2023 Changes in this version + const CacheKeyFriends + const ThirdAuthcodePrefix + var ErrUserNeedVerification = errors.New("user need verification") + var ErrorUserNotExist = errors.New("用户不存在!") + var Names = []string + func SendQRCodeInfo(uuid string, qrcode *common.QRCodeModel) + type AddUserReq struct + Email string + Name string + Password string + Phone string + UID string + Username string + Zone string + type BlacklistModel struct + Name string + UID string + Username string + type Category string + const CategoryService + type DB struct + func NewDB(ctx *config.Context) *DB + func (d *DB) AddOrRemoveBlacklistTx(uid string, touid string, blacklist int, version int64, tx *dbr.Tx) error + func (d *DB) Blacklists(uid string) ([]*BlacklistModel, error) + func (d *DB) Insert(m *Model) error + func (d *DB) QueryByCategory(category string) ([]*Model, error) + func (d *DB) QueryByKeyword(keyword string) (*Model, error) + func (d *DB) QueryByPhone(zone string, phone string) (*Model, error) + func (d *DB) QueryByPhones(phones []string) ([]*Model, error) + func (d *DB) QueryByUID(uid string) (*Model, error) + func (d *DB) QueryByUIDs(uids []string) ([]*Model, error) + func (d *DB) QueryByUsername(username string) (*Model, error) + func (d *DB) QueryByUsernameCxt(ctx context.Context, username string) (*Model, error) + func (d *DB) QueryByVercode(vercode string) (*Model, error) + func (d *DB) QueryDetailByUID(uid string, loginUID string) (*Detail, error) + func (d *DB) QueryDetailByUIDs(uids []string, loginUID string) ([]*Detail, error) + func (d *DB) QueryUIDsByUsernames(usernames []string) ([]string, error) + func (d *DB) QueryUserWithOnlyShortNo(shortNo string) (*Model, error) + func (d *DB) QueryWithAppID(appID string) ([]*Model, error) + func (d *DB) UpdateUsersWithField(field string, value string, uid string) error + type Detail struct + ChatPwdOn int + Mute int + Receipt int + RevokeRemind int + Screenshot int + Top int + type DetailModel struct + Blacklist int + ChatPwdOn int + IsAlone int + IsDeleted int + Mute int + Receipt int + Remark string + Robot int + ShortNo string + ToCategory string + ToName string + ToUID string + Top int + Vercode string + Version int64 + type Friend struct + func NewFriend(ctx *config.Context) *Friend + func (f *Friend) Route(r *wkhttp.WKHttp) + type FriendDetailModel struct + Name string + ToName string + type FriendModel struct + Flag int + Initiator int + IsAlone int + IsDeleted int + SourceVercode string + ToUID string + UID string + Vercode string + Version int64 + type FriendReq struct + Flag int + ToUID string + UID string + Version int64 + type FriendResp struct + IsAlone int + Name string + UID string + type IOnlineService interface + DeviceOnline func(uid string, device config.DeviceFlag) (bool, error) + GetOnlineCount func() (int64, error) + GetUserLastOnlineStatus func(uids []string) ([]*config.OnlinestatusResp, error) + type IService interface + AddFriend func(uid string, friend *FriendReq) error + AddUser func(user *AddUserReq) error + ExistBlacklist func(uid string, toUID string) (bool, error) + GetAllUserCount func() (int64, error) + GetAllUsers func() ([]*Resp, error) + GetDeviceOnline func(uid string, deviceFlag config.DeviceFlag) (*config.OnlinestatusResp, error) + GetFriends func(uid string) ([]*FriendResp, error) + GetFriendsWithToUIDs func(uid string, toUIDs []string) ([]*FriendResp, error) + GetOnetimePrekeyCount func(uid string) (int, error) + GetOnlineCount func() (int64, error) + GetRegisterCountWithDateSpace func(startDate, endDate string) (map[string]int64, error) + GetRegisterWithDate func(date string) (int64, error) + GetUser func(uid string) (*Resp, error) + GetUserDetail func(uid string, loginUID string) (*UserDetailResp, error) + GetUserDetails func(uids []string, loginUID string) ([]*UserDetailResp, error) + GetUserOnlineStatus func([]string) ([]*OnLineUserResp, error) + GetUserSettings func(uids []string, loginUID string) ([]*SettingResp, error) + GetUserUIDWithUsernames func(usernames []string) ([]string, error) + GetUserWithQRVercode func(qrVercode string) (*Resp, error) + GetUserWithUsername func(username string) (*Resp, error) + GetUsers func(uids []string) ([]*Resp, error) + GetUsersWithAppID func(appID string) ([]*Resp, error) + GetUsersWithCategory func(category Category) ([]*Resp, error) + IsFriend func(uid string, toUID string) (bool, error) + UpdateLoginPassword func(req UpdateLoginPasswordReq) error + UpdateUser func(req UserUpdateReq) error + func NewService(ctx *config.Context) IService + type LoginLog struct + func NewLoginLog(ctx *config.Context) *LoginLog + type LoginLogDB struct + func NewLoginLogDB(session *dbr.Session) *LoginLogDB + type LoginLogModel struct + LoginIP string + UID string + type Manager struct + func NewManager(ctx *config.Context) *Manager + func (m *Manager) Route(r *wkhttp.WKHttp) + type Model struct + AppID string + Category string + ChatPwd string + DeviceLock int + Email string + GiteeUID string + GithubUID string + IsDestroy int + IsUploadAvatar int + LockAfterMinute int + LockScreenPwd string + MsgShowDetail int + MuteOfApp int + Name string + NewMsgNotice int + OfflineProtection int + Password string + Phone string + QRVercode string + Robot int + Role string + SearchByPhone int + SearchByShort int + Sex int + ShockOn int + ShortNo string + ShortStatus int + Status int + UID string + Username string + Vercode string + Version int64 + VoiceOn int + WXOpenid string + WXUnionid string + Zone string + type OnLineUserResp struct + DeviceFlag uint8 + LastOffline int + Online int + UID string + type OnlineService struct + func NewOnlineService(ctx *config.Context) *OnlineService + func (o *OnlineService) DeviceOnline(uid string, device config.DeviceFlag) (bool, error) + func (o *OnlineService) GetOnlineCount() (int64, error) + func (o *OnlineService) GetUserLastOnlineStatus(uids []string) ([]*config.OnlinestatusResp, error) + type Resp struct + Email string + IsUploadAvatar int + MsgShowDetail int + Name string + NewMsgNotice int + Phone string + UID string + Zone string + type Service struct + func (s *Service) AddFriend(uid string, friend *FriendReq) error + func (s *Service) AddUser(user *AddUserReq) error + func (s *Service) ExistBlacklist(uid string, toUID string) (bool, error) + func (s *Service) GetAllUserCount() (int64, error) + func (s *Service) GetAllUsers() ([]*Resp, error) + func (s *Service) GetDeviceOnline(uid string, deviceFlag config.DeviceFlag) (*config.OnlinestatusResp, error) + func (s *Service) GetFriends(uid string) ([]*FriendResp, error) + func (s *Service) GetFriendsWithToUIDs(uid string, toUIDs []string) ([]*FriendResp, error) + func (s *Service) GetOnetimePrekeyCount(uid string) (int, error) + func (s *Service) GetOnlineCount() (int64, error) + func (s *Service) GetRegisterCountWithDateSpace(startDate, endDate string) (map[string]int64, error) + func (s *Service) GetRegisterWithDate(date string) (int64, error) + func (s *Service) GetUser(uid string) (*Resp, error) + func (s *Service) GetUserDetail(uid string, loginUID string) (*UserDetailResp, error) + func (s *Service) GetUserDetails(uids []string, loginUID string) ([]*UserDetailResp, error) + func (s *Service) GetUserOnlineStatus(uids []string) ([]*OnLineUserResp, error) + func (s *Service) GetUserSettings(uids []string, loginUID string) ([]*SettingResp, error) + func (s *Service) GetUserUIDWithUsernames(usernames []string) ([]string, error) + func (s *Service) GetUserWithQRVercode(qrVercode string) (*Resp, error) + func (s *Service) GetUserWithUsername(username string) (*Resp, error) + func (s *Service) GetUsers(uids []string) ([]*Resp, error) + func (s *Service) GetUsersWithAppID(appID string) ([]*Resp, error) + func (s *Service) GetUsersWithCategory(category Category) ([]*Resp, error) + func (s *Service) IsFriend(uid string, toUID string) (bool, error) + func (s *Service) UpdateLoginPassword(req UpdateLoginPasswordReq) error + func (s *Service) UpdateUser(req UserUpdateReq) error + type Setting struct + func NewSetting(ctx *config.Context) *Setting + type SettingDB struct + func NewSettingDB(session *dbr.Session) *SettingDB + func (d *SettingDB) InsertUserSettingModel(setting *SettingModel) error + func (d *SettingDB) QueryTwoUserSettingModel(uid, loginUID string) ([]*SettingModel, error) + func (d *SettingDB) QueryUserSettingModel(uid, loginUID string) (*SettingModel, error) + func (d *SettingDB) QueryUserSettings(uids []string, loginUID string) ([]*SettingModel, error) + func (d *SettingDB) QueryWithUidsAndToUID(uids []string, toUID string) ([]*SettingModel, error) + func (d *SettingDB) UpdateUserSettingModel(setting *SettingModel) error + type SettingModel struct + Blacklist int + ChatPwdOn int + Flame int + FlameSecond int + Mute int + Receipt int + Remark string + RevokeRemind int + Screenshot int + ToUID string + Top int + UID string + Version int64 + type SettingResp struct + Blacklist int + ChatPwdOn int + Mute int + Receipt int + RevokeRemind int + Screenshot int + Top int + UID string + Version int64 + type Status int + const StatusDisable + const StatusEnable + func (s Status) Int() int + type UpdateLoginPasswordReq struct + NewPassword string + Password string + UID string + type User struct + func New(ctx *config.Context) *User + func (u *User) GetFriendByVercode(vercode string) (*source.FriendModel, error) + func (u *User) GetFriendByVercodes(vercodes []string) ([]*source.FriendModel, error) + func (u *User) GetUserByMailListVercode(vercode string) (*source.UserModel, error) + func (u *User) GetUserByQRVercode(qrvercode string) (*source.UserModel, error) + func (u *User) GetUserByUID(uid string) (*source.UserModel, error) + func (u *User) GetUserByVercode(vercode string) (*source.UserModel, error) + func (u *User) Route(r *wkhttp.WKHttp) + func (u *User) UserAvatar(c *wkhttp.Context) + type UserDetailResp struct + BeBlacklist int + BeDeleted int + Category string + ChatPwdOn int + Code string + DeviceFlag config.DeviceFlag + Email string + Flame int + FlameSecond int + Follow int + IsDestroy int + IsUploadAvatar int + LastOffline int + Mute int + Name string + Online int + Phone string + Receipt int + Remark string + RevokeRemind int + Robot int + Screenshot int + Sex int + ShortNo string + SourceDesc string + Status int + Top int + UID string + Username string + Vercode string + Zone string + func NewUserDetailResp(m *Detail, remark, loginUID string, sourceFrom string, onLine int, ...) *UserDetailResp + type UserUpdateReq struct + Name *string + UID string