Documentation
¶
Index ¶
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 ¶
func TransferUser(input *TransferUserInput) *model.UserInfo
TransferUser 组装数据并输出 对外暴露的user结构,都应该经过此结构进行转换
Types ¶
type RelationService ¶
type RelationService interface {
Follow(ctx context.Context, userID uint64, followedUID uint64) error
Unfollow(ctx context.Context, userID uint64, followedUID uint64) error
IsFollowing(ctx context.Context, userID uint64, followedUID uint64) bool
GetFollowingUserList(ctx context.Context, userID uint64, lastID uint64, limit int) ([]*model.UserFollowModel, error)
GetFollowerUserList(ctx context.Context, userID uint64, lastID uint64, limit int) ([]*model.UserFansModel, error)
}
RelationService .
type SMSService ¶
SMSService define interface func
type Service ¶
type Service interface {
Users() UserService
Relations() RelationService
SMS() SMSService
VCode() VCodeService
}
Service define all service
var Svc Service
Svc global var
type TransferUserInput ¶
type TransferUserInput struct {
CurUser *model.UserBaseModel
User *model.UserBaseModel
UserStat *model.UserStatModel
IsFollow int `json:"is_follow"`
IsFans int `json:"is_fans"`
}
TransferUserInput 转换输入字段
type UserService ¶
type UserService interface {
Register(ctx context.Context, username, email, password string) error
EmailLogin(ctx context.Context, email, password string) (tokenStr string, err error)
PhoneLogin(ctx context.Context, phone int64, verifyCode int) (tokenStr string, err error)
GetUserByID(ctx context.Context, id uint64) (*model.UserBaseModel, error)
GetUserInfoByID(ctx context.Context, id uint64) (*model.UserInfo, error)
GetUserByPhone(ctx context.Context, phone int64) (*model.UserBaseModel, error)
GetUserByEmail(ctx context.Context, email string) (*model.UserBaseModel, error)
UpdateUser(ctx context.Context, id uint64, userMap map[string]interface{}) error
BatchGetUsers(ctx context.Context, userID uint64, userIDs []uint64) ([]*model.UserInfo, error)
}
UserService define interface func
Click to show internal directories.
Click to hide internal directories.