handler

package
v0.0.0-...-be974dd Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublishCommentType = "1"
	DeleteCommentType  = "2"
	MaxCommentLen      = 500
)
View Source
const (
	FeedLimit = 30
)

Variables

This section is empty.

Functions

func CommentHandler

func CommentHandler(c *gin.Context)

func CommentListHandler

func CommentListHandler(c *gin.Context)

func DeleteCommentHandler

func DeleteCommentHandler(c *gin.Context)

func FollowActionHandler

func FollowActionHandler(c *gin.Context)

func GetFollowListHandler

func GetFollowListHandler(c *gin.Context)

func GetFollowerListHandler

func GetFollowerListHandler(c *gin.Context)

func GetFriendListHandler

func GetFriendListHandler(c *gin.Context)

GetFriendListHandler 好友就是 我的粉丝

func GetUserInfoHandler

func GetUserInfoHandler(c *gin.Context)

func LoginHandler

func LoginHandler(c *gin.Context)

func Ping

func Ping(c *gin.Context)

func PublishCommentHandler

func PublishCommentHandler(c *gin.Context, userId int64)

func Register

func Register(r *gin.Engine)

func RegisterHandler

func RegisterHandler(c *gin.Context)

func VideoFavoriteHandler

func VideoFavoriteHandler(c *gin.Context)

点赞操作:

1: 点赞,直接在favorite表创建 userId与favoriteId进行关联的数据,同时更新video表中 FavoriteCount 属性值
2: 取消点赞,直接删除favorite表中这条记录,同时更新video表中 FavoriteCount 属性值

actionTYpe == 1 点赞

  1. 先查询有无favorite record,无则创建,有则delete_time = 0

actionType == 2 取消点赞

  1. delete_time = now()

func VideoFavoriteListHandler

func VideoFavoriteListHandler(c *gin.Context)
	返回点赞list
 	1. 从favorite表中找出 userId= ?? 符合所有的favorite记录存储在favoriteList中
	2. 遍历favoriteList得到videoList

func VideoFeedHandler

func VideoFeedHandler(c *gin.Context)

func VideoPublishHandler

func VideoPublishHandler(c *gin.Context)

func VideoPublishedListHandler

func VideoPublishedListHandler(c *gin.Context)

Types

type RegisterReq

type RegisterReq struct {
	Username string `validate:"required,max=32"`
	Password string `validate:"required,min=6,max=32"`
}

type RelationReq

type RelationReq struct {
	UserID     int64
	ToUserID   int64
	ActionType string
}

Jump to

Keyboard shortcuts

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