controller

package
v0.0.0-...-50df04f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentAction

func CommentAction(c *gin.Context)

评论操作,路由

func CommentList

func CommentList(c *gin.Context)

评论列表,路由

func FavoriteAction

func FavoriteAction(c *gin.Context)

用户赞操作函数,路由

func FavoriteList

func FavoriteList(c *gin.Context)

用户喜欢列表函数,路由

func Feed

func Feed(c *gin.Context)

视频流接口,路由

func FollowList

func FollowList(c *gin.Context)

关注列表函数,路由

func FollowerList

func FollowerList(c *gin.Context)

粉丝列表函数,路由

func FriendList

func FriendList(c *gin.Context)

好友列表函数,路由

func JobSaveRedis

func JobSaveRedis()

定时任务:将Redis数据保存到MySQL

func Login

func Login(c *gin.Context)

用户登录函数,路由

func MessageAction

func MessageAction(c *gin.Context)

聊天记录函数,路由

func MessageChat

func MessageChat(c *gin.Context)

发送消息函数,路由

func Publish

func Publish(c *gin.Context)

投稿接口,用户发布视频,路由

func PublishList

func PublishList(c *gin.Context)

发布列表的接口,路由

func Register

func Register(c *gin.Context)

用户注册函数,路由

func RelationAction

func RelationAction(c *gin.Context)

关注操作函数,路由

func SaveRedisToMySQL

func SaveRedisToMySQL()

将Redis数据保存到MySQL

func UpdateUserFollow

func UpdateUserFollow(user *model.User)

更新用户的关注数和粉丝数

func UpdateUserFollowStatus

func UpdateUserFollowStatus(userID int64, to_user *model.User)

更新 关注列表或者粉丝列表的用户的关注状态

func UserInfo

func UserInfo(c *gin.Context)

输入为用户id和鉴权token,获取该用户信息 注意:有中间件已处理

Types

type CommentListResponse

type CommentListResponse struct {
	util.Response
	CommentList []model.Comment `json:"comment_list"`
}

评论列表返回的结构体

type CommentResponse

type CommentResponse struct {
	util.Response
	Comment model.Comment
}

评论操作的返回结构体

type FeedResponse

type FeedResponse struct {
	util.Response               //标准响应体
	VideoList     []model.Video `json:"video_list"`          //视频列表
	NextTime      int64         `json:"next_time,omitempty"` //本次返回的视频中,发布最早的时间,作为下次请求的Latest_time
}

/feed接口的响应体

type FollowListResponse

type FollowListResponse struct {
	util.Response
	UserList []model.User `json:"user_list"`
}

关注/粉丝功能 的响应结构体

type FriendListResponse

type FriendListResponse struct {
	util.Response
	FriendList []model.Friend `json:"user_list"`
}

好友列表的响应体

type MessageListResponse

type MessageListResponse struct {
	util.Response
	MessageList []model.Message `json:"message_list"`
}

消息列表响应体

type UserLoginResponse

type UserLoginResponse struct {
	util.Response
	UserId int64  `json:"user_id"`
	Token  string `json:"token"`
}

用户登录的响应体

type UserResponse

type UserResponse struct {
	util.Response
	User model.User `json:"user"`
}

用户信息响应体

type VideoListResponse

type VideoListResponse struct {
	util.Response
	VideoList []model.Video `json:"video_list"`
}

视频列表的响应体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL