service

package
v0.0.0-...-f9e9924 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionAddComment    = 1
	ActionDeleteComment = 2
)
View Source
const (
	ActionFav   = 1
	ActionUnFav = 2
)
View Source
const (
	ActionFollow   = 1
	ActionUnfollow = 2
)
View Source
const (
	StatusSuccess = 0
	StatusFailed  = 1
)

Variables

This section is empty.

Functions

func CommentAction

func CommentAction(c *gin.Context)

CommentAction 发表评论、删除评论

func CommentList

func CommentList(c *gin.Context)

CommentList 获取评论列表

func FavoriteAction

func FavoriteAction(c *gin.Context)

FavoriteAction 点赞操作

func FavoriteList

func FavoriteList(c *gin.Context)

FavoriteList 获取点赞视频列表 由于前端无法从点赞列表中查看视频详情,因此无需考虑作者等信息

func Feed

func Feed(c *gin.Context)

Feed 获取视频流,总体分为三步:获取视频信息(包含作者信息)、获取点赞信息、获取作者关注信息 其中每步还需要先从 Redis 查询,未命中再查询 MySQL

func FollowList

func FollowList(c *gin.Context)

FollowList 展示查询用户的关注列表

func FollowerList

func FollowerList(c *gin.Context)

FollowerList 展示查询用户的粉丝列表

func GenToken

func GenToken(userId int64) (string, error)

GenToken 根据用户 id 生成 token,由于前端未对 token 过期作特殊处理,暂不加入过期时间

func Login

func Login(c *gin.Context)

func Publish

func Publish(c *gin.Context)

Publish 前端传入视频、token

func PublishList

func PublishList(c *gin.Context)

PublishList 获取当前用户的视频列表

func Register

func Register(c *gin.Context)

func RelationAction

func RelationAction(c *gin.Context)

RelationAction 关注取关操作

func ResponseFailed

func ResponseFailed(c *gin.Context, msg string)

func ResponseSuccess

func ResponseSuccess(c *gin.Context, msg string)

func UserInfo

func UserInfo(c *gin.Context)

UserInfo 查看某用户的信息

Types

type CommentListResponse

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

type FavoriteListResponse

type FavoriteListResponse struct {
	Response
	VideoList []dal.Video `json:"video_list"`
}

type FeedResponse

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

type Response

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

type UserListResponse

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

type UserLoginResponse

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

type UserResponse

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

type VideoListResponse

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

Jump to

Keyboard shortcuts

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