Documentation
¶
Index ¶
- type Asset
- type AssetService
- type GoogleMail
- type Group
- func (g *Group) AddUser(group *model.Group, userID string) bool
- func (g *Group) Create(name, description, userID, logo, bgLogo string, isPrivate bool) (group *model.Group)
- func (g *Group) FindByGroupID(groupID string) *model.Group
- func (g *Group) HasUser(group *model.Group, userID string) bool
- func (g *Group) QueryGroupByName(name string) (group *model.Group)
- func (g *Group) QueryUserGroups(user *model.User) (groups []*model.Group)
- type GroupService
- type MailService
- type Point
- func (p *Point) AddPoints(userId, invitedBy string, bonusPoints uint64) (isValidInvite bool)
- func (p *Point) DeletePoints(userId string)
- func (p *Point) ExchangePoints(privateKey, userId string, bonusPoints uint64) bool
- func (p *Point) GetUserLeaderboard() []*model.Point
- func (p *Point) GetUserPoints(userId string) *model.Point
- func (p *Point) UpdatePoints(userId string, bonusPoints uint64)
- type PointService
- type Post
- func (p *Post) Comment(post *model.Post, content, creator string) (comment *model.Comment)
- func (p *Post) CommentLike(comment *model.Comment, user *model.User)
- func (p *Post) Create(title, content, creator string, images, topics []string, group *model.Group) (post *model.Post)
- func (p *Post) Edit(post *model.Post, title, content string, images, topics []string)
- func (p *Post) IsCommentLiked(comment *model.Comment, user *model.User) bool
- func (p *Post) IsLiked(post *model.Post, user *model.User) bool
- func (p *Post) IsShared(post *model.Post, user *model.User) bool
- func (p *Post) Like(post *model.Post, user *model.User)
- func (p *Post) Posts(userID string, cond builder.Cond, orderBy string, size int) (posts []*model.Post, nextID string)
- func (p *Post) QueryCommentByUuid(uuid string) (comment *model.Comment)
- func (p *Post) QueryComments(post *model.Post, currentComment *model.Comment, size int) (comments []*model.Comment, nextID string)
- func (p *Post) QueryPostByUuid(uuid string) (post *model.Post)
- func (p *Post) QueryPostGroupMap(posts []*model.Post) (groups map[string]*model.Group)
- func (p *Post) QueryReplies(post *model.Post, comments []*model.Comment) (replies map[string][]*model.Comment)
- func (p *Post) QueryUserCommentLikes(user *model.User, commentIDList []string) (likes map[string]bool)
- func (p *Post) QueryUserPostLikes(user *model.User, postUuidList []string) (likes map[string]bool)
- func (p *Post) QueryUserPostShares(user *model.User, postUuidList []string) (shares map[string]bool)
- func (p *Post) Reply(post *model.Post, parentComment *model.Comment, content, creator string) (comment *model.Comment)
- func (p *Post) Share(post *model.Post, user *model.User)
- func (p *Post) View(post *model.Post)
- type PostService
- type SigNonce
- type SigNonceService
- type Topic
- type TopicService
- type User
- func (u *User) EditUser(user *model.User) bool
- func (u *User) FindUserByEmail(email string) (user *model.User)
- func (u *User) FindUserByEthAddress(ethAddress string) (user *model.User)
- func (u *User) FindUserByUuid(uuid string) (user *model.User)
- func (u *User) FindUsersByUuid(uuids []string) (users []*model.User)
- func (u *User) FollowUser(user *model.User, follower *model.User) bool
- func (u *User) IsFollowed(user, queryUser *model.User) bool
- func (u *User) IsFollower(user, queryUser *model.User) bool
- func (u *User) QueryFollowedUsers(uuid string) (users []*model.User)
- func (u *User) QueryFollowerUsers(uuid string) (users []*model.User)
- func (u *User) QueryUserMap(uuids []string) (result map[string]*model.User)
- func (u *User) Register(user model.User) bool
- type UserService
- type VerificationCode
- type VerificationCodeService
- type VerificationMail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetService ¶
type AssetService interface { Create(uuid, cosPath string) (asset *model.Asset) QueryByUuid(uuid string) (asset *model.Asset) }
func NewAsset ¶
func NewAsset(xorm *xorm.Engine) AssetService
type GoogleMail ¶
type GoogleMail struct {
// contains filtered or unexported fields
}
func (*GoogleMail) SendVerificationCode ¶
func (m *GoogleMail) SendVerificationCode(mailTo, code string, expired uint) bool
type GroupService ¶
type GroupService interface { FindByGroupID(groupID string) (group *model.Group) HasUser(group *model.Group, userID string) bool Create(name, description, userID, logo, bgLogo string, isPrivate bool) (group *model.Group) QueryGroupByName(name string) (group *model.Group) AddUser(group *model.Group, userID string) bool QueryUserGroups(user *model.User) (groups []*model.Group) }
func NewGroup ¶
func NewGroup(xorm *xorm.Engine) GroupService
type MailService ¶
func NewGoogleMail ¶
func NewGoogleMail() MailService
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func (*Point) DeletePoints ¶
func (*Point) ExchangePoints ¶
func (*Point) GetUserLeaderboard ¶
func (*Point) UpdatePoints ¶
type PointService ¶
type PointService interface { AddPoints(userId, invitedBy string, bonusPoints uint64) bool UpdatePoints(userId string, bonusPoints uint64) DeletePoints(userId string) GetUserPoints(userId string) *model.Point // 获取用户排行榜,按积分降序排列 GetUserLeaderboard() []*model.Point ExchangePoints(privateKey, userId string, bonusPoints uint64) bool }
func NewPoint ¶
func NewPoint(xorm *xorm.Engine) PointService
type Post ¶
type Post struct {
// contains filtered or unexported fields
}
func (*Post) IsCommentLiked ¶
func (*Post) QueryCommentByUuid ¶
func (*Post) QueryComments ¶
func (*Post) QueryPostGroupMap ¶
func (*Post) QueryReplies ¶
func (p *Post) QueryReplies(post *model.Post, comments []*model.Comment) (replies map[string][]*model.Comment)
填充每个评论的子评论
func (*Post) QueryUserCommentLikes ¶
func (*Post) QueryUserPostLikes ¶
查询帖子列表中,当前用户点赞的情况
func (*Post) QueryUserPostShares ¶
type PostService ¶
type PostService interface { Create(title, content, creator string, images, topics []string, group *model.Group) (post *model.Post) Edit(post *model.Post, title, content string, images, topics []string) QueryPostByUuid(uuid string) (post *model.Post) QueryCommentByUuid(uuid string) (comment *model.Comment) Comment(post *model.Post, content, creator string) (comment *model.Comment) Reply(post *model.Post, parentComment *model.Comment, content, creator string) (comment *model.Comment) Posts(userID string, cond builder.Cond, orderBy string, size int) (posts []*model.Post, nextID string) QueryComments(post *model.Post, currentComment *model.Comment, size int) (comments []*model.Comment, nextID string) QueryReplies(post *model.Post, comments []*model.Comment) (replies map[string][]*model.Comment) QueryPostGroupMap(posts []*model.Post) (groups map[string]*model.Group) Like(post *model.Post, user *model.User) View(post *model.Post) IsLiked(post *model.Post, user *model.User) bool QueryUserPostLikes(user *model.User, postUuidList []string) map[string]bool QueryUserCommentLikes(user *model.User, commentIDList []string) (likes map[string]bool) CommentLike(comment *model.Comment, user *model.User) IsCommentLiked(comment *model.Comment, user *model.User) bool }
func NewPost ¶
func NewPost(xorm *xorm.Engine) PostService
type SigNonce ¶
type SigNonce struct {
// contains filtered or unexported fields
}
func (*SigNonce) CreateNonce ¶
func (*SigNonce) FindSigNonceByEthAddress ¶
type SigNonceService ¶
type SigNonceService interface { CreateNonce(ethAddress string) (nonce string, err error) FindSigNonceByEthAddress(ethAddress string) *model.SigNonce ReGenerate(sigNonce *model.SigNonce) string UseNonce(sigNonce *model.SigNonce) bool }
func NewNonce ¶
func NewNonce(xorm *xorm.Engine) SigNonceService
type TopicService ¶
func NewTopic ¶
func NewTopic(xorm *xorm.Engine) TopicService
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) FindUserByEthAddress ¶
func (*User) FollowUser ¶
FollowUser 关注用户
func (*User) QueryFollowedUsers ¶
QueryFollowedUsers 被关注列表
func (*User) QueryFollowerUsers ¶
QueryFollowerUsers 关注列表
func (*User) QueryUserMap ¶
type UserService ¶
type UserService interface { FindUserByEmail(email string) (user *model.User) FindUserByEthAddress(ethAddress string) (user *model.User) FindUserByUuid(uuid string) (user *model.User) FindUsersByUuid(uuids []string) (users []*model.User) Register(user model.User) bool QueryFollowerUsers(uuid string) (users []*model.User) QueryFollowedUsers(uuid string) (users []*model.User) FollowUser(user *model.User, follower *model.User) bool QueryUserMap(uuids []string) (result map[string]*model.User) IsFollower(user, queryUser *model.User) bool IsFollowed(user, queryUser *model.User) bool EditUser(user *model.User) bool }
func NewUser ¶
func NewUser(xorm *xorm.Engine) UserService
type VerificationCode ¶
type VerificationCode struct { Mail MailService Redis *redis.Client // contains filtered or unexported fields }
func (*VerificationCode) Run ¶
func (v *VerificationCode) Run() error
func (*VerificationCode) SendLoginVerificationCode ¶
func (v *VerificationCode) SendLoginVerificationCode(to string)
This function is used to send a login verification code to the user's email address.
func (*VerificationCode) VerifyEmailCode ¶
func (v *VerificationCode) VerifyEmailCode(to string, code string) bool
type VerificationCodeService ¶
type VerificationCodeService interface { SendLoginVerificationCode(to string) VerifyEmailCode(to string, code string) bool Run() error }
func NewVerificationCode ¶
func NewVerificationCode() VerificationCodeService
type VerificationMail ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.