Documentation ¶
Overview ¶
定义 Gin HTTP API 的 handler
Index ¶
- func CommentAction(c *gin.Context)
- func CommentList(c *gin.Context)
- func FavoriteAction(c *gin.Context)
- func FavoriteList(c *gin.Context)
- func GetUserById(c *gin.Context)
- func GetUserFeed(c *gin.Context)
- func Login(c *gin.Context)
- func PublishAction(c *gin.Context)
- func PublishList(c *gin.Context)
- func Register(c *gin.Context)
- func RelationAction(c *gin.Context)
- func RelationFollowList(c *gin.Context)
- func RelationFollowerList(c *gin.Context)
- func SendResponse(c *gin.Context, response interface{})
- type CommentActionParam
- type CommentListParam
- type FavoriteActionParam
- type FeedParam
- type PublishActionParam
- type RelationActionParam
- type UserParam
- type UserRegisterParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentAction ¶
传递 评论操作 的上下文至 Comment 服务的 RPC 客户端, 并获取相应的响应.
func CommentList ¶
传递 获取评论列表操作 的上下文至 Comment 服务的 RPC 客户端, 并获取相应的响应.
func FavoriteAction ¶
传递 点赞操作 的上下文至 Favorite 服务的 RPC 客户端, 并获取相应的响应.
func FavoriteList ¶
传递 获取点赞列表操作 的上下文至 Favorite 服务的 RPC 客户端, 并获取相应的响应.
func GetUserById ¶
传递 获取注册用户`UserID`操作 的上下文至 User 服务的 RPC 客户端, 并获取相应的响应.
func PublishAction ¶
传递 发布视频操作 的上下文至 Publish 服务的 RPC 客户端, 并获取相应的响应.
func PublishList ¶
传递 获取视频列表操作 的上下文至 Publish 服务的 RPC 客户端, 并获取相应的响应.
func RelationAction ¶
传递 关注操作 的上下文至 Relation 服务的 RPC 客户端, 并获取相应的响应.
func RelationFollowList ¶
传递 获取正在关注列表操作 的上下文至 Relation 服务的 RPC 客户端, 并获取相应的响应.
func RelationFollowerList ¶
传递 获取粉丝列表操作 的上下文至 Relation 服务的 RPC 客户端, 并获取相应的响应.
func SendResponse ¶
SendResponse pack response
Types ¶
type CommentActionParam ¶
type CommentActionParam struct { UserId int64 `json:"user_id,omitempty"` // 用户id Token string `json:"token,omitempty"` // 用户鉴权token VideoId int64 `json:"video_id,omitempty"` // 视频id ActionType int32 `json:"action_type,omitempty"` // 1-发布评论,2-删除评论 CommentText *string `json:"comment_text,omitempty"` // 用户填写的评论内容,在action_type=1的时候使用 CommentId *int64 `json:"comment_id,omitempty"` // 要删除的评论id,在action_type=2的时候使用 }
评论操作 handler 输入参数
type CommentListParam ¶
type CommentListParam struct { Token string `json:"token,omitempty"` // 用户鉴权token VideoId int64 `json:"video_id,omitempty"` // 视频id }
获取评论列表 handler 输入参数
type FavoriteActionParam ¶
type FavoriteActionParam struct { UserId int64 `json:"user_id,omitempty"` // 用户id Token string `json:"token,omitempty"` // 用户鉴权token VideoId int64 `json:"video_id,omitempty"` // 视频id ActionType int32 `json:"action_type,omitempty"` // 1-点赞,2-取消点赞 }
点赞操作 handler 输入参数
type FeedParam ¶
type FeedParam struct { LatestTime *int64 `json:"latest_time,omitempty"` // 可选参数,限制返回视频的最新投稿时间戳,精确到秒,不填表示当前时间 Token *string `json:"token,omitempty"` // 可选参数,登录用户设置 }
视频流 handler 输入参数
type PublishActionParam ¶
type PublishActionParam struct { Token string `json:"token,omitempty"` // 用户鉴权token Data []byte `json:"data,omitempty"` // 视频数据 Title string `json:"title,omitempty"` // 视频标题 }
发布视频操作 handler 输入参数
type RelationActionParam ¶
type RelationActionParam struct { UserId int64 `json:"user_id,omitempty"` // 用户id Token string `json:"token,omitempty"` // 用户鉴权token ToUserId int64 `json:"to_user_id,omitempty"` // 对方用户id ActionType int32 `json:"action_type,omitempty"` // 1-关注,2-取消关注 }
关注操作 handler 输入参数
type UserParam ¶
type UserParam struct { UserId int64 `json:"user_id,omitempty"` // 用户id Token string `json:"token,omitempty"` // 用户鉴权token }
用户信息 输出参数
type UserRegisterParam ¶
type UserRegisterParam struct { UserName string `json:"username"` // 用户名 PassWord string `json:"password"` // 用户密码 }
用户注册 handler 输入参数