Documentation ¶
Index ¶
- Constants
- func AddContactFromUser(uidOwner int64, uidFriend int64, groupName string) (res *v10.Contact, err error)
- func AddContactFromUserInternal(uidOwner int64, uidFriend int64, groupName string, isGroup, relationship int32, ...) (res *v10.Contact, err error)
- func AddFriend(relation *v10.Relation) (ret *v10.FriendUserInfo, err error)
- func AddFriend2(relation *v10.Relation) (ret *v10.FriendUserInfo, err error)
- func DeleteFriend(relation *v10.Relation) bool
- func GetContact(req *v10.GetContactReq) (res *v10.GetContactReply, err error)
- func GetFriendList(autoId int64, uid string) ([]*v10.FriendUserInfo, error)
- func GetUserDdevices(uid int64) (ret []*v10.DeviceUserRelation, err error)
- func GetUserInfoByAutoId(autoId int64) (*v10.UserInfo, error)
- func GetUserInfoByPhone(phone string) (*v10.UserInfo, error)
- func GetUserInfoByUid(uid string) (*v10.UserInfo, error)
- func IsExistDevice(uid int64, deviceId string) (yes bool, dur *v10.DeviceUserRelation)
- func ListContacts(uidOwner int64) (res *v10.ContactGroups, err error)
- func RemoveContact(req *v10.RemoveContactReq) (res *v10.RemoveContactReply, err error)
- func SaveOrUpdateDevice(uid int64, device *v10.Device) (dur *v10.DeviceUserRelation, err error)
- func TxRollback(tx *gorm.DB, err error)
- func UpdateContact(req *v10.UpdateContactReq) (res *v10.UpdateContactReply, err error)
- func UpdateFriend(relation *v10.Relation) (ret *v10.Relation, err error)
- func UpdateFriend2(relation *v10.Relation) (*v10.Relation, error)
- func UpdateUserInfo(userInfo *v10.UserInfo) (ok bool, err error, obj *models.User)
- func UserGetFriends()
- func UserLoginByPhoneCode(phone string) *v10.UserInfo
- func UserLoginUsePass(userInfo *v10.UserInfo) (ret *v10.UserInfo, err error)
- func UserRegister(userInfo *v10.UserInfo) (*v10.UserInfo, error)
- type AppDao
- func (s *AppDao) AddOrUpdate(in *models.App) (ret *models.App, err error)
- func (s *AppDao) Get(tmpl *models.App) (ret *models.App, err error)
- func (s *AppDao) GetById(id uint64) (ret *models.App, err error)
- func (s *AppDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.App, err error)
- func (s *AppDao) ListFast(query interface{}, args ...interface{}) (ret []*models.App, err error)
- func (s *AppDao) Remove(tmpl *models.App) (rows int64, err error)
- func (s *AppDao) RemoveById(id uint64) (rows int64, err error)
- func (s *AppDao) Update(in *models.App) (rows int64, err error)
- func (s *AppDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type FilterDao
- func (s *FilterDao) AddOrUpdate(in *models.Filter) (ret *models.Filter, err error)
- func (s *FilterDao) Get(tmpl *models.Filter) (ret *models.Filter, err error)
- func (s *FilterDao) GetById(id uint64) (ret *models.Filter, err error)
- func (s *FilterDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.Filter, err error)
- func (s *FilterDao) ListFast(query interface{}, args ...interface{}) (ret []*models.Filter, err error)
- func (s *FilterDao) Remove(tmpl *models.Filter) (rows int64, err error)
- func (s *FilterDao) RemoveById(id uint64) (rows int64, err error)
- func (s *FilterDao) Update(in *models.Filter) (rows int64, err error)
- func (s *FilterDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type HookDao
- func (s *HookDao) AddOrUpdate1(in *models.Hook) (ret *models.Hook, err error)
- func (s *HookDao) Get(tmpl *models.Hook) (ret *models.Hook, err error)
- func (s *HookDao) GetById(id uint64) (ret *models.Hook, err error)
- func (s *HookDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.Hook, err error)
- func (s *HookDao) Remove(tmpl *models.Hook) (rows int64, err error)
- func (s *HookDao) RemoveById(id uint64) (rows int64, err error)
- func (s *HookDao) Update(in *models.Hook) (rows int64, err error)
- func (s *HookDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type MemberDao
- func (s *MemberDao) AddOrUpdate1(in *models.Member) (ret *models.Member, err error)
- func (s *MemberDao) Get(tmpl *models.Member) (ret *models.Member, err error)
- func (s *MemberDao) GetById(id uint64) (ret *models.Member, err error)
- func (s *MemberDao) LazyLoad(model *models.Member) (ret *v10.Member, err error)
- func (s *MemberDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.Member, err error)
- func (s *MemberDao) Remove(tmpl *models.Member) (rows int64, err error)
- func (s *MemberDao) RemoveById(id uint64) (rows int64, err error)
- func (s *MemberDao) Update(in *models.Member) (rows int64, err error)
- func (s *MemberDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type MsgDao
- func (s *MsgDao) AddOrUpdate1(in *models.Msg) (ret *models.Msg, err error)
- func (s *MsgDao) AddTo(in *models.Msg, deviceId, parentId, orgId uint64) (toUsers []uint64, err error)
- func (s *MsgDao) Get(tmpl *models.Msg) (ret *models.Msg, err error)
- func (s *MsgDao) GetById(id uint64) (ret *models.Msg, err error)
- func (s *MsgDao) List(limit int, start int, query interface{}, args ...interface{}) (ret []*models.Msg, err error)
- func (s *MsgDao) ListBy(autoAck bool, userId, topicId uint64, limit int, ...) (ret []*models.Msg, err error)
- func (s *MsgDao) ListFromParent(parent *models.Msg, topicId uint64) (ret []*models.Msg, err error)
- func (s *MsgDao) ListFromParentId(parentId uint64, topicId uint64) (ret []*models.Msg, err error)
- func (s *MsgDao) MsgAcked(memberId, topicId uint64, count, distance int, msgIds ...uint64) (err error)
- func (s *MsgDao) Remove(tmpl *models.Msg) (err error)
- func (s *MsgDao) RemoveById(id uint64) (err error)
- func (s *MsgDao) Update(in *models.Msg) (err error)
- func (s *MsgDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type OrgDao
- func (s *OrgDao) AddOrUpdate(in *models.Organization, parentId uint64) (ret *models.Organization, err error)
- func (s *OrgDao) AddTo1(in *models.Organization, parentId uint64) (err error)
- func (s *OrgDao) Get(tmpl *models.Organization) (ret *models.Organization, err error)
- func (s *OrgDao) GetById(id uint64) (ret *models.Organization, err error)
- func (s *OrgDao) LazyLoad(model *models.Organization) (ret *v10.Organization, err error)
- func (s *OrgDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.Organization, err error)
- func (s *OrgDao) ListFromParent(parent *models.Organization) (ret []*models.Organization, err error)
- func (s *OrgDao) ListFromParentId(parentId uint64) (ret []*models.Organization, err error)
- func (s *OrgDao) Remove(tmpl *models.Organization) (rows int64, err error)
- func (s *OrgDao) RemoveById(id uint64) (rows int64, err error)
- func (s *OrgDao) Update(in *models.Organization) (err error)
- func (s *OrgDao) UpdateAttrs(attrs ...interface{}) (err error)
- func (s *OrgDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type TopicAppDao
- func (s *TopicAppDao) AddOrUpdate(in *models.TopicApp) (ret *models.TopicApp, err error)
- func (s *TopicAppDao) Get(tmpl *models.TopicApp) (ret *models.TopicApp, err error)
- func (s *TopicAppDao) GetById(id uint64) (ret *models.TopicApp, err error)
- func (s *TopicAppDao) GetByIdEager(id uint64) (ret *models.TopicApp, err error)
- func (s *TopicAppDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.TopicApp, err error)
- func (s *TopicAppDao) ListEager(query interface{}, args ...interface{}) (ret []*models.TopicApp, err error)
- func (s *TopicAppDao) Remove(tmpl *models.TopicApp) (rows int64, err error)
- func (s *TopicAppDao) RemoveById(id uint64) (rows int64, err error)
- func (s *TopicAppDao) Update(in *models.TopicApp) (rows int64, err error)
- func (s *TopicAppDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type TopicDao
- func (s *TopicDao) Add(in *models.Topic, parentId uint64) (err error)
- func (s *TopicDao) CreateRoomOrDirectMessage(orgId, moderator uint64, others ...uint64) (topicId uint64, out *models.Topic, err error)
- func (s *TopicDao) Get(tmpl *models.Topic) (ret *models.Topic, err error)
- func (s *TopicDao) GetById(id uint64) (ret *models.Topic, err error)
- func (s *TopicDao) GetMemberPkIds(topicId uint64) (ret []uint64, err error)
- func (s *TopicDao) GetMemberUserIds(topicId uint64) (ret []uint64, err error)
- func (s *TopicDao) GetMemberUserIdsNotIn(topicId uint64, notInUsers []uint64) (ret []uint64, err error)
- func (s *TopicDao) GetMembers(topicId uint64) (ret []models.Member, err error)
- func (s *TopicDao) LazyLoad(model *models.Topic) (ret *v10.Topic, err error)
- func (s *TopicDao) List(limit, start int64, orderBy string, query interface{}, args ...interface{}) (ret []*models.Topic, err error)
- func (s *TopicDao) ListFromParent(parent *models.Topic) (ret []*models.Topic, err error)
- func (s *TopicDao) ListFromParentId(parentId uint64) (ret []*models.Topic, err error)
- func (s *TopicDao) Remove(tmpl *models.Topic) (rows int64, err error)
- func (s *TopicDao) RemoveById(id uint64) (err error)
- func (s *TopicDao) Update(in *models.Topic) (err error)
- func (s *TopicDao) Where(query interface{}, args ...interface{}) *gorm.DB
- type UserDao
- func (s *UserDao) Add(in *models.User) (id uint64, err error)
- func (s *UserDao) Get(tmpl *models.User) (ret *models.User, err error)
- func (s *UserDao) GetById(id uint64) (ret *models.User, err error)
- func (s *UserDao) List(tmpl *models.User) (ret []*models.User, err error)
- func (s *UserDao) Remove(tmpl *models.User) (rows int64, err error)
- func (s *UserDao) RemoveById(id uint64) (rows int64, err error)
- func (s *UserDao) Update(in *models.User) (ret *models.User, rows int64, err error)
Constants ¶
const UserRelationTableName = "t_user_relation"
Variables ¶
This section is empty.
Functions ¶
func AddContactFromUser ¶
func AddFriend ¶
func AddFriend(relation *v10.Relation) (ret *v10.FriendUserInfo, err error)
* ** 添加好友 ** return userInfo *
func AddFriend2 ¶
func AddFriend2(relation *v10.Relation) (ret *v10.FriendUserInfo, err error)
func GetContact ¶
func GetContact(req *v10.GetContactReq) (res *v10.GetContactReply, err error)
func GetFriendList ¶
func GetFriendList(autoId int64, uid string) ([]*v10.FriendUserInfo, error)
* 获取好友列表
func GetUserDdevices ¶
func GetUserDdevices(uid int64) (ret []*v10.DeviceUserRelation, err error)
func GetUserInfoByPhone ¶
验证码验证通过后直接调用该方法登录
func IsExistDevice ¶
func IsExistDevice(uid int64, deviceId string) (yes bool, dur *v10.DeviceUserRelation)
func ListContacts ¶
func ListContacts(uidOwner int64) (res *v10.ContactGroups, err error)
func RemoveContact ¶
func RemoveContact(req *v10.RemoveContactReq) (res *v10.RemoveContactReply, err error)
func SaveOrUpdateDevice ¶
func TxRollback ¶
func UpdateContact ¶
func UpdateContact(req *v10.UpdateContactReq) (res *v10.UpdateContactReply, err error)
func UpdateFriend ¶
* ** 修改朋友信息(增加备注,拉黑名单等) *
func UpdateUserInfo ¶
* ** 修改用户信息 *
func UserLoginByPhoneCode ¶
* ** 验证码验证通过后采用这个登录 *
func UserLoginUsePass ¶
* ** 用户登录(密码方式/Mobile/Phone) *
Types ¶
type AppDao ¶
type AppDao struct{}
func (*AppDao) AddOrUpdate ¶
func (*AppDao) RemoveById ¶
Soft Delete
type FilterDao ¶
type FilterDao struct{}
func NewFilterDao ¶
func NewFilterDao() *FilterDao
func (*FilterDao) AddOrUpdate ¶
not recommended
func (*FilterDao) RemoveById ¶
Soft Delete
type HookDao ¶
type HookDao struct{}
func NewHookDao ¶
func NewHookDao() *HookDao
func (*HookDao) AddOrUpdate1 ¶
not recommended
func (*HookDao) RemoveById ¶
Soft Delete
type MemberDao ¶
type MemberDao struct{}
func NewMemberDao ¶
func NewMemberDao() *MemberDao
func (*MemberDao) AddOrUpdate1 ¶
not recommended
func (*MemberDao) RemoveById ¶
Soft Delete
type MsgDao ¶
type MsgDao struct {
// contains filtered or unexported fields
}
func (*MsgDao) AddOrUpdate1 ¶
don't use this func because it's not completed on the internal affairs, such as updateing MsgLastPt, notifying others, pre/post filter, ...
func (*MsgDao) AddTo ¶
func (s *MsgDao) AddTo(in *models.Msg, deviceId, parentId, orgId uint64) (toUsers []uint64, err error)
for api.SendMsg: AddTo() append/insert an `in` msg into `t_msg` table.
if in.TopicId == 0, AddTo() will create a Room/DirectMessage as an new Topic. Room is a special Topic, just like conversation group for multiple users/members. DirectMessage is a peer-to-peer Topic, it's special for two peers conversation.
func (*MsgDao) ListFromParent ¶
ListFromParent 列出给定上级msg的全部下级msg, 包含该上级
func (*MsgDao) ListFromParentId ¶
ListFromParentId 列出给定上级msg的全部下级msg, 包含该上级 parentId=0 时列出给定 topic 中的全部msgs
type OrgDao ¶
type OrgDao struct {
// contains filtered or unexported fields
}
func (*OrgDao) AddOrUpdate ¶
func (s *OrgDao) AddOrUpdate(in *models.Organization, parentId uint64) (ret *models.Organization, err error)
func (*OrgDao) AddTo1 ¶
func (s *OrgDao) AddTo1(in *models.Organization, parentId uint64) (err error)
func (*OrgDao) Get ¶
func (s *OrgDao) Get(tmpl *models.Organization) (ret *models.Organization, err error)
func (*OrgDao) LazyLoad ¶
func (s *OrgDao) LazyLoad(model *models.Organization) (ret *v10.Organization, err error)
load the lazy objects
func (*OrgDao) ListFromParent ¶
func (s *OrgDao) ListFromParent(parent *models.Organization) (ret []*models.Organization, err error)
ListFromParent 列出给定上级组织的全部下级组织
func (*OrgDao) ListFromParentId ¶
func (s *OrgDao) ListFromParentId(parentId uint64) (ret []*models.Organization, err error)
ListFromParentId 列出给定上级组织的全部下级组织
func (*OrgDao) RemoveById ¶
Soft Delete
func (*OrgDao) UpdateAttrs ¶
type TopicAppDao ¶
type TopicAppDao struct{}
func NewTopicAppDao ¶
func NewTopicAppDao() *TopicAppDao
func (*TopicAppDao) AddOrUpdate ¶
func (*TopicAppDao) GetById ¶
func (s *TopicAppDao) GetById(id uint64) (ret *models.TopicApp, err error)
func (*TopicAppDao) GetByIdEager ¶
func (s *TopicAppDao) GetByIdEager(id uint64) (ret *models.TopicApp, err error)
func (*TopicAppDao) ListEager ¶
func (s *TopicAppDao) ListEager(query interface{}, args ...interface{}) (ret []*models.TopicApp, err error)
func (*TopicAppDao) Remove ¶
func (s *TopicAppDao) Remove(tmpl *models.TopicApp) (rows int64, err error)
func (*TopicAppDao) RemoveById ¶
func (s *TopicAppDao) RemoveById(id uint64) (rows int64, err error)
Soft Delete
func (*TopicAppDao) Update ¶
func (s *TopicAppDao) Update(in *models.TopicApp) (rows int64, err error)
func (*TopicAppDao) Where ¶
func (s *TopicAppDao) Where(query interface{}, args ...interface{}) *gorm.DB
type TopicDao ¶
type TopicDao struct {
// contains filtered or unexported fields
}
func NewTopicDao ¶
func NewTopicDao() *TopicDao
func (*TopicDao) CreateRoomOrDirectMessage ¶
func (s *TopicDao) CreateRoomOrDirectMessage(orgId, moderator uint64, others ...uint64) (topicId uint64, out *models.Topic, err error)
Room/DirectMessage 没有专设bot,所以不要创建一个botUser。 但 FxBot 仍然自动属于一个 Room/DirectMessage,因此系统级的消息分发依然有效,而 Room 管理员无法通过自动化工具进行消息分发。
func (*TopicDao) GetMemberPkIds ¶
func (*TopicDao) GetMemberUserIds ¶
func (*TopicDao) GetMemberUserIdsNotIn ¶
func (*TopicDao) GetMembers ¶
func (*TopicDao) ListFromParent ¶
ListFromParent 列出给定上级话题的全部下级话题
func (*TopicDao) ListFromParentId ¶
ListFromParentId 列出给定上级话题的全部下级话题