Documentation ¶
Index ¶
- Constants
- func TransferUser(input *TransferUserInput) *model.UserInfo
- type Service
- func (s *Service) BatchGetUsers(ctx context.Context, userID uint64, userIDs []uint64) ([]*model.UserInfo, error)
- func (s *Service) CheckLoginVCode(phone int64, vCode int) bool
- func (s *Service) Close()
- func (s *Service) EmailLogin(ctx context.Context, email, password string) (tokenStr string, err error)
- func (s *Service) Follow(ctx context.Context, userID uint64, followedUID uint64) error
- func (s *Service) GenLoginVCode(phone string) (int, error)
- func (s *Service) GetFollowerUserList(ctx context.Context, userID uint64, lastID uint64, limit int) ([]*model.UserFansModel, error)
- func (s *Service) GetFollowingUserList(ctx context.Context, userID uint64, lastID uint64, limit int) ([]*model.UserFollowModel, error)
- func (s *Service) GetLoginVCode(phone int64) (int, error)
- func (s *Service) GetUserByEmail(ctx context.Context, email string) (*model.UserBaseModel, error)
- func (s *Service) GetUserByID(ctx context.Context, id uint64) (*model.UserBaseModel, error)
- func (s *Service) GetUserByPhone(ctx context.Context, phone int64) (*model.UserBaseModel, error)
- func (s *Service) GetUserInfoByID(ctx context.Context, id uint64) (*model.UserInfo, error)
- func (s *Service) IsFollowing(ctx context.Context, userID uint64, followedUID uint64) bool
- func (s *Service) LoginByPhone(ctx context.Context, req *v1.PhoneLoginRequest) (reply *v1.PhoneLoginReply, err error)
- func (s *Service) PhoneLogin(ctx context.Context, phone int64, verifyCode int) (tokenStr string, err error)
- func (s *Service) Ping() error
- func (s *Service) Register(ctx context.Context, username, email, password string) error
- func (s *Service) SendSMS(phoneNumber string, verifyCode int) error
- func (s *Service) Unfollow(ctx context.Context, userID uint64, followedUID uint64) error
- func (s *Service) UpdateUser(ctx context.Context, id uint64, userMap map[string]interface{}) error
- type TransferUserInput
Constants ¶
View Source
const ( // FollowStatusNormal 关注状态-正常 FollowStatusNormal int = 1 // 正常 // FollowStatusDelete 关注状态-删除 FollowStatusDelete = 0 // 删除 )
View Source
const ( // DefaultLimit 默认分页数 DefaultLimit = 50 // MaxID 最大id MaxID = 0xffffffffffff // DefaultAvatar 默认头像 key DefaultAvatar = "default_avatar.png" )
Variables ¶
This section is empty.
Functions ¶
func TransferUser ¶ added in v1.3.1
func TransferUser(input *TransferUserInput) *model.UserInfo
TransferUser 组装数据并输出 对外暴露的user结构,都应该经过此结构进行转换
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service struct
func (*Service) BatchGetUsers ¶ added in v1.3.1
func (s *Service) BatchGetUsers(ctx context.Context, userID uint64, userIDs []uint64) ([]*model.UserInfo, error)
BatchGetUsers 批量获取用户信息 1. 处理关注和被关注状态 2. 获取关注和粉丝数据
func (*Service) CheckLoginVCode ¶ added in v1.3.1
CheckLoginVCode 验证校验码是否正确
func (*Service) EmailLogin ¶ added in v1.3.1
func (s *Service) EmailLogin(ctx context.Context, email, password string) (tokenStr string, err error)
EmailLogin 邮箱登录
func (*Service) GenLoginVCode ¶ added in v1.3.1
GenLoginVCode 生成校验码
func (*Service) GetFollowerUserList ¶ added in v1.3.1
func (s *Service) GetFollowerUserList(ctx context.Context, userID uint64, lastID uint64, limit int) ([]*model.UserFansModel, error)
GetFollowerUserList 获取粉丝用户列表
func (*Service) GetFollowingUserList ¶ added in v1.3.1
func (s *Service) GetFollowingUserList(ctx context.Context, userID uint64, lastID uint64, limit int) ([]*model.UserFollowModel, error)
GetFollowingUserList 获取正在关注的用户列表
func (*Service) GetLoginVCode ¶ added in v1.3.1
GetLoginVCode 获得校验码
func (*Service) GetUserByEmail ¶ added in v1.3.1
func (*Service) GetUserByID ¶ added in v1.3.1
GetUserByID 获取单条用户信息
func (*Service) GetUserByPhone ¶ added in v1.3.1
func (*Service) GetUserInfoByID ¶ added in v1.3.1
GetUserInfoByID 获取组装好的用户数据
func (*Service) IsFollowing ¶ added in v1.3.1
IsFollowing 是否正在关注某用户
func (*Service) LoginByPhone ¶ added in v1.3.1
func (s *Service) LoginByPhone(ctx context.Context, req *v1.PhoneLoginRequest) (reply *v1.PhoneLoginReply, err error)
LoginByPhone phone login, grpc wrapper
func (*Service) PhoneLogin ¶ added in v1.3.1
func (s *Service) PhoneLogin(ctx context.Context, phone int64, verifyCode int) (tokenStr string, err error)
PhoneLogin 邮箱登录
type TransferUserInput ¶ added in v1.3.1
type TransferUserInput struct { CurUser *model.UserBaseModel User *model.UserBaseModel UserStat *model.UserStatModel IsFollow int `json:"is_follow"` IsFans int `json:"is_fans"` }
TransferUserInput 转换输入字段
Click to show internal directories.
Click to hide internal directories.