Documentation
¶
Index ¶
- func ErrResp(c *gin.Context)
- func ErrRespWithData(c *gin.Context, msg string, data map[string]interface{})
- func ErrRespWithMsg(c *gin.Context, msg string)
- func Msg(code Code) string
- func OKResp(c *gin.Context)
- func OKRespWithData(c *gin.Context, data map[string]interface{})
- type AuthResponse
- type Code
- type CommentResponse
- type FriendUserResponse
- type MessageResponse
- type UserResponse
- type VideoResponse
- func GetFavoriteVideoListResponseByOwnerID(ownerID int64) ([]VideoResponse, error)
- func GetVideoListResponseByID(targetID, ownerID int64) ([]VideoResponse, error)
- func GetVideoListResponseByIDAndLatestTime(targetID, ownerID int64, latestTime string) ([]VideoResponse, error)
- func GetVideoListResponseByOwnerIDAndLatestTime(ownerID int64, latestTime string) ([]VideoResponse, error)
- func GetVideoResponseByVideoAndOwnerID(video *model.Video, ownerID int64) (*VideoResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrRespWithData ¶
func ErrRespWithMsg ¶
func OKRespWithData ¶
Types ¶
type AuthResponse ¶
type CommentResponse ¶
type CommentResponse struct {
CommentID int64 `json:"id"` // 评论ID
User UserResponse `json:"user"` // 评论用户
Content string `json:"content"` // 评论内容
CreateDate string `json:"create_date"` // 评论发布日期,格式 mm-dd
}
type FriendUserResponse ¶
type FriendUserResponse struct {
UserResponse
Message string `json:"message"` // 和该好友的最新聊天消息
MsgType int64 `json:"msg_type"` // message消息的类型,0 => 当前请求用户接收的消息, 1 => 当前请求用户发送的消息
}
type MessageResponse ¶
type UserResponse ¶
type UserResponse struct {
UserID int64 `json:"id"` // 用户ID
Username string `json:"name"` // 用户名
FollowCount int64 `json:"follow_count"` // 该用户关注了多少个其他用户
FollowerCount int64 `json:"follower_count"` // 该用户粉丝总数
IsFollow bool `json:"is_follow"` // true: 已关注 false: 未关注
Avatar string `json:"avatar"` // 头像
BackGroudImage string `json:"background_image"` // 背景大图
Signature string `json:"signature"` // 个人简介
TotalFavorite int64 `json:"total_favorite"` // 该用户获赞总量
WorkCount int64 `json:"work_count"` // 作品数量
FavoriteCount int64 `json:"favorite_count"` // 喜欢的作品数量
}
func GetUserResponseByID ¶
func GetUserResponseByID(targetID int64, ownerID int64) (*UserResponse, error)
GetUserResponseByID 返回用户信息,targetID 为目标用户 id,ownerID 为当前登录用户 id
func GetUserResponseByOwnerId ¶
func GetUserResponseByOwnerId(ownerID int64) (*UserResponse, error)
GetUserResponseByOwnerId 返回用户信息,ownerID 为当前登录用户 id
type VideoResponse ¶
type VideoResponse struct {
VideoID int64 `json:"id"` // 视频唯一标识
Author UserResponse `json:"author"` // 视频作者信息
PlayURL string `json:"play_url"` // 视频播放地址
CoverURL string `json:"cover_url"` // 视频封面地址
FavoriteCount int64 `json:"favorite_count"` // 视频的点赞总数
CommentCount int64 `json:"comment_count"` // 视频的评论总数
IsFavorite bool `json:"is_favorite"` // true-已点赞,false-未点赞
Title string `json:"title"` // 视频标题
}
func GetFavoriteVideoListResponseByOwnerID ¶
func GetFavoriteVideoListResponseByOwnerID(ownerID int64) ([]VideoResponse, error)
GetFavoriteVideoListResponseByOwnerID 根据用户 id 获取喜欢列表
func GetVideoListResponseByID ¶
func GetVideoListResponseByID(targetID, ownerID int64) ([]VideoResponse, error)
GetVideoListResponseByID 根据两个用户 id 来获取视频列表
func GetVideoListResponseByIDAndLatestTime ¶
func GetVideoListResponseByIDAndLatestTime(targetID, ownerID int64, latestTime string) ([]VideoResponse, error)
GetVideoListResponseByIDAndLatestTime 根据两个用户 id 来获取视频列表,如果 targetID 或者 ownerID 为 0,则通过时间戳来获取视频, 即未登录状态
func GetVideoListResponseByOwnerIDAndLatestTime ¶
func GetVideoListResponseByOwnerIDAndLatestTime(ownerID int64, latestTime string) ([]VideoResponse, error)
GetVideoListResponseByOwnerIDAndLatestTime 根据 当前登录用户 id 和 时间戳 来获取视频列表
func GetVideoResponseByVideoAndOwnerID ¶
func GetVideoResponseByVideoAndOwnerID(video *model.Video, ownerID int64) (*VideoResponse, error)
GetVideoResponseByVideoAndOwnerID 根据 video 和 ownerID 来获取视频
Click to show internal directories.
Click to hide internal directories.