controller

package
v0.0.0-...-6db71ed Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DemoComments = []models.Comment{
	{
		Id:         1,
		User:       DemoUser,
		Content:    "Test Comment",
		CreateDate: "05-01",
	},
}
View Source
var DemoUser = models.UserInfo{
	Id:            1,
	Name:          "TestUser",
	FollowCount:   0,
	FollowerCount: 0,
	IsFollow:      false,
}
View Source
var DemoVideos = []models.Video{
	{
		Id:            1,
		Author:        DemoUser,
		PlayUrl:       "https://www.w3schools.com/html/movie.mp4",
		CoverUrl:      "https://cdn.pixabay.com/photo/2016/03/27/18/10/bear-1283347_1280.jpg",
		FavoriteCount: 0,
		CommentCount:  0,
		IsFavorite:    false,
	},
}

Functions

func FavoriteAction

func FavoriteAction(c *gin.Context)

FavoriteAction no practical effect, just check if token is valid

func FavoriteList

func FavoriteList(c *gin.Context)

FavoriteList all users have same favorite video list

func Feed

func Feed(c *gin.Context)

Feed same demo video list for every request

func FollowList

func FollowList(c *gin.Context)

FollowList all users have same follow list

func FollowerList

func FollowerList(c *gin.Context)

FollowerList all users have same follower list

func FriendList

func FriendList(c *gin.Context)

FriendList all users have same friend list

func Login

func Login(c *gin.Context)

func MessageAction

func MessageAction(c *gin.Context)

MessageAction no practical effect, just check if token is valid

func MessageChat

func MessageChat(c *gin.Context)

MessageChat all users have same follow list

func Publish

func Publish(c *gin.Context)

Publish check token then save upload file to public directory

func PublishList

func PublishList(c *gin.Context)

PublishList all users have same publish video list

func Register

func Register(c *gin.Context)

func RelationAction

func RelationAction(c *gin.Context)

RelationAction no practical effect, just check if token is valid

func UserInfo

func UserInfo(c *gin.Context)

Types

type ChatResponse

type ChatResponse struct {
	models.CommonResponse
	MessageList []models.Message `json:"message_list"`
}

type FeedResponse

type FeedResponse struct {
	models.CommonResponse
	VideoList []models.Video `json:"video_list,omitempty"`
	NextTime  int64          `json:"next_time,omitempty"`
}

type UserListResponse

type UserListResponse struct {
	models.CommonResponse
	UserList []models.UserInfo `json:"user_list"`
}

type UserLoginResponse

type UserLoginResponse struct {
	models.CommonResponse
	UserId int64  `json:"user_id,omitempty"`
	Token  string `json:"token"`
}

type UserResponse

type UserResponse struct {
	models.CommonResponse
	User models.User `json:"user"`
}

type VideoListResponse

type VideoListResponse struct {
	models.CommonResponse
	VideoList []models.Video `json:"video_list"`
}

Jump to

Keyboard shortcuts

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