Documentation ¶
Index ¶
- func CancelFavorite(ctx context.Context, uid, vid int64) error
- func CancelFollow(ctx context.Context, uid, targetID int64) error
- func CreateComment(ctx context.Context, uid, vid int64, content string) error
- func CreateVideo(ctx context.Context, uid int64, video model.Video) error
- func DeleteComment(ctx context.Context, uid, cid int64) error
- func Favorite(ctx context.Context, uid, vid int64) error
- func FillVideoList(ctx context.Context, curID int64, videos []dao.Video, user *model.User, ...) error
- func Follow(ctx context.Context, uid, targetID int64) error
- func IsUserExist(ctx context.Context, username string) (bool, error)
- func Login(ctx context.Context, name string, password string) (*model.UserLoginResponse, error)
- func MGetVideosByUIDNoCache(ctx context.Context, uid, targetID int64, res *FeedResponse) error
- func MGetVideosNoCache(ctx context.Context, curID, nextTime int64, res *FeedResponse) error
- func QueryFollowInfo(ctx context.Context, user *model.User, curID, targetID int64)
- func QueryUser(ctx context.Context, curID, targetID int64) (*model.User, error)
- func Register(ctx context.Context, name string, password string) (*model.UserLoginResponse, error)
- type CommentListResponse
- type FeedResponse
- type UserListResponse
- type VideoListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateVideo ¶
CreateVideo create a single video
func FillVideoList ¶
func FillVideoList(ctx context.Context, curID int64, videos []dao.Video, user *model.User, res *FeedResponse) error
FillVideoList 对mysql数据库的查出来的video信息进行填充:Author,id,FavoriteCount,CommentCount 传入user的目的是判断调用的接口方是否是查询个人的,如果是个人直接填充
func IsUserExist ¶
IsUserExist 判断用户名是否存在
func MGetVideosByUIDNoCache ¶
func MGetVideosByUIDNoCache(ctx context.Context, uid, targetID int64, res *FeedResponse) error
MGetVideosByUIDNoCache 个人视频中没有缓存的情况:从mysql取出来,并进行缓存
func MGetVideosNoCache ¶
func MGetVideosNoCache(ctx context.Context, curID, nextTime int64, res *FeedResponse) error
MGetVideosNoCache 没有缓存的情况:从Mysql数据库中获取全部的视频流信息 -> 存入redis缓存
func QueryFollowInfo ¶
Types ¶
type CommentListResponse ¶
type CommentListResponse struct { app.Response CommentList []model.Comment `json:"comment_list,omitempty"` }
func MGetComments ¶
func MGetComments(ctx context.Context, uid, vid int64) (*CommentListResponse, error)
type FeedResponse ¶
type FeedResponse struct { app.Response VideoList []model.Video `json:"video_list,omitempty"` NextTime int64 `json:"next_time,omitempty"` }
func MGetVideos ¶
func MGetVideos(ctx context.Context, curID, nextTime int64) (*FeedResponse, error)
MGetVideos 返回视频列表 根据目前我们这个业务场景来讲取视频一次取30个,并且视频发布不是很频繁的情况下, 考虑在第一次查询的时候直接搞30分钟的cache,如果cache不存在的情况下,进行Mysql的读取
func MGetVideosByUID ¶
func MGetVideosByUID(ctx context.Context, uid, targetID int64) (*FeedResponse, error)
MGetVideosByUID 获取某一用户的所有视频列表,同样是判断个人投稿的缓存是否存在 -> 如果没缓存去mysql中寻找
type UserListResponse ¶
func GetFollowOrFans ¶
type VideoListResponse ¶
func GetFavoriteList ¶
func GetFavoriteList(ctx context.Context, uid, targetID int64) (*VideoListResponse, error)
Click to show internal directories.
Click to hide internal directories.