Documentation ¶
Index ¶
- Variables
- func ACollectAdd(aHashId string, uHashId string, tag string) error
- func ACollectCtGet(aHashId string) (error, int64)
- func ACollectCtGetByAids(aHashIds []string) (error, map[string]int64)
- func ACollectDel(aHashId string, uHashId string) error
- func ACollectDelByAid(aHashId string) error
- func ACollectExist(aHashId string, uHashId string) (error, bool)
- func AFavorite(aHashId string, uHashId string, status int32) error
- func AFavoriteCtGet(aHashId string) (error, int64)
- func AFavoriteCtGetByAids(aHashIds []string) (error, map[string]int64)
- func AFavoriteDeleteByAid(aHashId string) error
- func AFavoriteExist(aHashId string, uHashId string) (err error, exSignal int32)
- func AFavoriteStatusFlush(aHashId string, uHashId string, fluSignal int32) error
- func AddNewComment(ctx context.Context, comment *mymongo.Comment) error
- func AddNewFollow(follow *orm_gen.Follow) error
- func CheckArticleExistByHashId(ahashId string) (bool, error)
- func CheckArticleExistById(aid int64) (bool, error)
- func CheckCmtExistById(ctx context.Context, cHashId string) (exist bool, err error)
- func CheckUserExistByHashId(hashId string) (bool, error)
- func CheckUserExistById(userId int64) (bool, error)
- func CheckUserExistByUname(username string) (bool, error)
- func CmtFavorieExist(UHashId string, CHashId string) (error, bool)
- func CmtFavoriteAction(UHashId string, CHashId string, AHashId string, actionTp int32) error
- func CmtFavoriteFlushByArticleId(AHashId string) error
- func CmtFavoriteFlushByCmtId(CHashId string) error
- func CmtFavoriteStatus(UHashId string, CHashId string) (error, int32)
- func CmtFavoriteStatusFlush(UHashId string, CHashId string) error
- func CreateArticle(aInfo *orm_gen.Article, aContent string) error
- func CreateUser(user *orm_gen.User) error
- func DelCommentByAid(ctx context.Context, aHashId string) error
- func DelCommentByHashID(ctx context.Context, cHashId string, aHashId string) error
- func DeleteArticle(aInfo *orm_gen.Article) (err error)
- func DeleteFollow(follow *orm_gen.Follow) error
- func GetArticleInfos(uid string, offset int) (aInfos []*orm_gen.Article, err error)
- func GetCmtCountByAid(ctx context.Context, aHashId string) (error, int64)
- func GetCmtCtByAids(ctx context.Context, aHashIds []string) (error, map[string]int64)
- func GetCmtFavoriteCtMap(cids []string) (error, map[string]int64)
- func GetCmtFavoriteStatusMap(CHashIds []string, UHashId string) (error, map[string]int32)
- func GetCommentByCmtID(ctx context.Context, cHashId string) (cmt *mymongo.Comment, err error)
- func GetCommentListByArticleID(ctx context.Context, aHashId string) ([]*mymongo.CommentItem, error)
- func GetCommentListByTopCommentID(ctx context.Context, aHashId string, cHashId string) (cmtList []*mymongo.CommentItem, err error)
- func GetFollowCount(uHashId string) (int64, error)
- func GetFollowIdList(uHashId string) ([]string, error)
- func GetFollowerCount(uHashId string) (int64, error)
- func GetFollowerIdList(uHashId string) ([]string, error)
- func GetWorkCount(uHashId string) (count int64, err error)
- func Init()
- func ModifyArticle(aInfo *orm_gen.Article, aContent string) (hashAid string, err error)
- func QueryFollowExist(uHashId, fUHashId string) (bool, error)
- func QueryUser(userName string) (*orm_gen.User, error)
- func QueryUserByHashId(uHashId string) (*orm_gen.User, error)
- func QueryUserByHashIds(uids []string) (uMaps map[string]*orm_gen.User, err error)
- func QueryUserById(userId int64) (*orm_gen.User, error)
- func QueryUserByIds(uids []int64) (map[int64]*orm_gen.User, error)
- func StartPeriodicSyncForViewCt()
- func TakeArticle(aHashID string) (aInfo *orm_gen.Article, content string, err error)
- func UserProfileModify(user_id int64, payload map[string]interface{}) error
- func UserPwdModify(uid int64, new_pwd string) error
- func VerifyUser(userName string, password string) (int64, string, error)
- func ViewCountDel(ahashId string) error
- func ViewCountExist(ahashId string) (error, bool)
- func ViewCountGet(ahashId string) (error, int64)
- func ViewCountGets(ahashId []string) (error, map[string]int64)
- func ViewCountIncr(ahashId string) error
- func ViewCountInit(ahashId string) error
Constants ¶
This section is empty.
Variables ¶
var DB *gorm.DB
var QDB *query.Query
Functions ¶
func ACollectCtGet ¶
func ACollectDel ¶
func ACollectDelByAid ¶
func AFavoriteDeleteByAid ¶
func AFavoriteExist ¶
func AFavoriteStatusFlush ¶
func AddNewComment ¶
AddNewComment add a comment
func AddNewFollow ¶
func CheckArticleExistByHashId ¶
CheckArticleExistByHashId 根据文章的hash_id 字段查找文章
func CheckArticleExistById ¶
CheckArticleExistById query if video exist
func CheckCmtExistById ¶
func CheckUserExistByHashId ¶
func CheckUserExistById ¶
CheckUserExistById find if user exists
func CheckUserExistByUname ¶
func CmtFavoriteAction ¶
func CmtFavoriteFlushByArticleId ¶
CmtFavoriteFlushByArticleId 删除文章的时候,调用该函数
func CmtFavoriteFlushByCmtId ¶
CmtFavoriteFlushByCmtId 删除评论的时候,调用该函数
func CmtFavoriteStatusFlush ¶
func DelCommentByAid ¶
DelCommentByAid 删除文章前,调用该函数
func DelCommentByHashID ¶
DelCommentByHashID DeleteCommentById delete comment by comment id
func DeleteArticle ¶
func DeleteFollow ¶
DeleteFollow delete follow relation in db and update redis
func GetArticleInfos ¶
GetArticleInfos: 获取一系列的文章卡片
func GetCmtCtByAids ¶
GetCmtCtByAids 通过文章id获取该文章的评论数
func GetCmtFavoriteStatusMap ¶
func GetCommentByCmtID ¶
GetCommentByCmtID GetCommentByTopCmtID 根据comment hashid 获取评论
func GetCommentListByArticleID ¶
GetCommentListByArticleID 通过文章id获取所有的一级评论
func GetFollowCount ¶
GetFollowCount query the number of users following
func GetFollowIdList ¶
getFollowIdList find user_id follow id list in db
func GetFollowerCount ¶
GetFollowerCount query the number of followers of a user
func GetFollowerIdList ¶
getFollowerIdList get follower id list in db
func GetWorkCount ¶
GetWorkCount get the num of video published by the user
func ModifyArticle ¶
func QueryFollowExist ¶
QueryFollowExist check the relation of user and follower
func QueryUserByHashIds ¶
func QueryUserById ¶
QueryUserById get user in the database by user id
func QueryUserByIds ¶
map[user id] : user payload
func StartPeriodicSyncForViewCt ¶
func StartPeriodicSyncForViewCt()
StartPeriodicSyncForViewCt 定期任务,每 10 分钟将 Redis 中的view count数据同步到 MySQL
func TakeArticle ¶
TakeArticle: 获取文章info以及内容
func UserProfileModify ¶
func UserPwdModify ¶
func VerifyUser ¶
VerifyUser verify username and password in the db
func ViewCountExist ¶
func ViewCountGet ¶
func ViewCountIncr ¶
func ViewCountInit ¶
ViewCountInit 在创建文章后调用该函数,在redis里初始化文章阅读数记录
Types ¶
This section is empty.