controller

package
v0.0.0-...-8f4e997 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DemoComments = []Comment{
	{
		ID:         1,
		User:       DemoUser,
		Content:    "Test Comment",
		CreateDate: "05-01",
	},
}

nolint:all

View Source
var DemoUser = User{
	ID:            1,
	Name:          "TestUser",
	FollowCount:   0,
	FollowerCount: 0,
	IsFollow:      false,
}

nolint:all

View Source
var DemoVideos = []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,
	},
}

nolint:all

Functions

func CommentAction

func CommentAction(ctx context.Context, c *app.RequestContext)

func CommentList

func CommentList(ctx context.Context, c *app.RequestContext)

func FavoriteAction

func FavoriteAction(ctx context.Context, c *app.RequestContext)

func FavoriteList

func FavoriteList(ctx context.Context, c *app.RequestContext)

func Feed

func Feed(ctx context.Context, c *app.RequestContext)

func FollowList

func FollowList(ctx context.Context, c *app.RequestContext)

func FollowerList

func FollowerList(ctx context.Context, c *app.RequestContext)

func FriendList

func FriendList(ctx context.Context, c *app.RequestContext)

func Login

func Login(ctx context.Context, c *app.RequestContext)

func MessageAction

func MessageAction(ctx context.Context, c *app.RequestContext)

MessageAction no practical effect, just check if token is valid.

func MessageChat

func MessageChat(ctx context.Context, c *app.RequestContext)

MessageChat all users have same follow list.

func Publish

func Publish(ctx context.Context, c *app.RequestContext)

Publish check token then save upload file to public directory.

func PublishList

func PublishList(ctx context.Context, c *app.RequestContext)

PublishList all users have same publish video list.

func Register

func Register(ctx context.Context, c *app.RequestContext)

func RelationAction

func RelationAction(ctx context.Context, c *app.RequestContext)

func UserInfo

func UserInfo(ctx context.Context, c *app.RequestContext)

Types

type ChatResponse

type ChatResponse struct {
	Response
	MessageList []Message `json:"message_list"`
}

type Comment

type Comment struct {
	ID         int64  `json:"id,omitempty"`
	User       User   `json:"user"`
	Content    string `json:"content,omitempty"`
	CreateDate string `json:"create_date,omitempty"`
}

type CommentActionResponse

type CommentActionResponse struct {
	Response
	Comment Comment `json:"comment,omitempty"`
}

type CommentListResponse

type CommentListResponse struct {
	Response
	CommentList []Comment `json:"comment_list,omitempty"`
}

type FeedResponse

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

type Message

type Message struct {
	ID         int64  `json:"id,omitempty"`
	Content    string `json:"content,omitempty"`
	CreateTime string `json:"create_time,omitempty"`
}

type MessagePushEvent

type MessagePushEvent struct {
	FromUserID int64  `json:"user_id,omitempty"`
	MsgContent string `json:"msg_content,omitempty"`
}

type MessageSendEvent

type MessageSendEvent struct {
	UserID     int64  `json:"user_id,omitempty"`
	ToUserID   int64  `json:"to_user_id,omitempty"`
	MsgContent string `json:"msg_content,omitempty"`
}

type Response

type Response struct {
	StatusCode int32  `json:"status_code"`
	StatusMsg  string `json:"status_msg,omitempty"`
}

type User

type User struct {
	ID            int64  `json:"id,omitempty"`
	Name          string `json:"name,omitempty"`
	FollowCount   int64  `json:"follow_count,omitempty"`
	FollowerCount int64  `json:"follower_count,omitempty"`
	IsFollow      bool   `json:"is_follow,omitempty"`
}

type UserListResponse

type UserListResponse struct {
	Response
	UserList []User `json:"user_list"`
}

type UserLoginResponse

type UserLoginResponse struct {
	Response
	UserID int64  `json:"user_id,omitempty"`
	Token  string `json:"token"`
}

type UserResponse

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

type Video

type Video struct {
	ID            int64  `json:"id,omitempty"`
	Author        User   `json:"author"`
	PlayURL       string `json:"play_url,omitempty"`
	CoverURL      string `json:"cover_url,omitempty"`
	FavoriteCount int64  `json:"favorite_count,omitempty"`
	CommentCount  int64  `json:"comment_count,omitempty"`
	IsFavorite    bool   `json:"is_favorite,omitempty"`
}

type VideoListResponse

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

Jump to

Keyboard shortcuts

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