types

package
v0.0.0-...-611b6d6 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID         int64  `json:"id"`          // 评论id
	Content    string `json:"content"`     // 评论内容
	CreateDate string `json:"create_date"` // 评论发布日期,格式 mm-dd
	User       *User  `json:"user"`        // 评论用户信息
}

Comment 评论

type CommentActionReq

type CommentActionReq struct {
	Token       string `query:"token" form:"token"`               // 用户鉴权token
	VideoID     int64  `query:"video_id" form:"video_id"`         // 视频id
	ActionType  int32  `query:"action_type" form:"action_type"`   // 1-发布评论,2-删除评论
	CommentText string `query:"comment_text" form:"comment_text"` // 用户填写的评论内容,在action_type=1的时候使用
	CommentID   int64  `query:"comment_id" form:"comment_id"`     // 要删除的评论id,在action_type=2的时候使用
}

CommentActionReq 评论操作请求

type CommentActionResp

type CommentActionResp struct {
	StatusCode int32    `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string   `json:"status_msg"`  // 返回状态描述
	Comment    *Comment `json:"comment"`     // 评论成功返回评论内容,不需要重新拉取整个列表
}

CommentActionResp 评论操作响应

type CommentListReq

type CommentListReq struct {
	Token   string `json:"token" query:"token" form:"token"`          // 用户鉴权token
	VideoID int64  `json:"video_id" query:"video_id" form:"video_id"` // 视频id
}

CommentListReq 评论列表请求

type CommentListResp

type CommentListResp struct {
	StatusCode  int32      `json:"status_code"`  // 状态码,0-成功,其他值-失败
	StatusMsg   string     `json:"status_msg"`   // 返回状态描述
	CommentList []*Comment `json:"comment_list"` // 评论列表
}

CommentListResp 评论列表响应

type FavoriteActionReq

type FavoriteActionReq struct {
	Token      string `query:"token" json:"token" form:"token" mapstructure:"token"`                         // 用户鉴权token
	VideoID    int64  `query:"video_id" json:"video_id" form:"video_id" mapstructure:"video_id"`             // 视频id
	ActionType int32  `query:"action_type" json:"action_type" form:"action_type" mapstructure:"action_type"` // 1-点赞,2-取消点赞
}

FavoriteActionReq 用户点赞请求

type FavoriteActionResp

type FavoriteActionResp struct {
	StatusCode int32  `json:"status_code"`          // 状态码,0-成功,其他值-失败
	StatusMsg  string `json:"status_msg,omitempty"` // 返回状态描述
}

FavoriteActionResp 用户点赞响应

type FavoriteListReq

type FavoriteListReq struct {
	UserID int64  `query:"user_id"` // 用户id
	Token  string `query:"token"`   // 用户鉴权token
}

FavoriteListReq 用户点赞列表请求

type FavoriteListResp

type FavoriteListResp struct {
	StatusCode int32    `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string   `json:"status_msg"`  // 返回状态描述
	VideoList  []*Video `json:"video_list"`  // 用户点赞视频列表
}

FavoriteListResp 用户点赞列表响应

type FeedReq

type FeedReq struct {
	LatestTime int64  `form:"latest_time" json:"latest_time,omitempty" query:"latest_time"` //可选参数,限制返回视频的最新投稿时间戳,精确到秒,不填表示当前时间
	Token      string `form:"token" json:"token,omitempty" query:"token"`                   // 登录状态则有
}

FeedReq is the request of feed api

type FeedResp

type FeedResp struct {
	Response
	NextTime  int64    `json:"next_time"`  // 本次返回的视频中,发布最早的时间,作为下次请求时的latest_time
	VideoList []*Video `json:"video_list"` // 视频列表
}

FeedResp is the response of feed api

type FriendUserResp

type FriendUserResp struct {
	User
	Message string `json:"message,omitempty"` // 和该好友的最新聊天消息
	MsgType int64  `json:"msg_type"`          // message消息的类型,0 => 当前请求用户接收的消息, 1 => 当前请求用户发送的消息
}

FriendUserResp 好友用户信息

type Message

type Message struct {
	ID         int64  `json:"id"`           // 消息id
	ToUserID   int64  `json:"to_user_id"`   // 该消息接收者的id
	FromUserID int64  `json:"from_user_id"` // 该消息发送者的id
	Content    string `json:"content"`      // 消息内容
	CreateTime string `json:"create_time"`  // 消息创建时间
}

Message 消息

type MessageActionReq

type MessageActionReq struct {
	Token      string `json:"token" query:"token"`             // 用户鉴权token
	ToUserID   int64  `json:"to_user_id" query:"to_user_id"`   // 对方用户id
	ActionType int32  `json:"action_type" query:"action_type"` // 1-发送消息
	Content    string `json:"content" query:"content"`         // 消息内容
}

MessageActionReq chat action request

type MessageActionResp

type MessageActionResp struct {
	StatusCode int32  `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string `json:"status_msg"`  // 返回状态描述
}

MessageActionResp chat action response

type MessageListReq

type MessageListReq struct {
	Token    string `json:"token" query:"token"`           // 用户鉴权token
	ToUserID int64  `json:"to_user_id" query:"to_user_id"` // 对方用户id
}

MessageListReq chat message list request

type MessageListResp

type MessageListResp struct {
	StatusCode  int32      `json:"status_code"`  // 状态码,0-成功,其他值-失败
	StatusMsg   string     `json:"status_msg"`   // 返回状态描述
	MessageList []*Message `json:"message_list"` // 消息列表
}

MessageListResp chat message list response

type PublishListReq

type PublishListReq struct {
	Token  string `query:"token" form:"token" json:"token"`       // token
	UserID int64  `query:"user_id" form:"user_id" json:"user_id"` // user id
}

PublishListReq is the request of publish list api

type PublishListResp

type PublishListResp struct {
	Response
	VideoList []*Video `json:"video_list"` // 用户发布的视频列表
}

PublishListResp is the response of publish list api

type RelationActionReq

type RelationActionReq struct {
	Token      string `json:"token"`       // 用户鉴权 token
	ToUserID   int64  `json:"to_user_id"`  // 对方用户 id
	ActionType int32  `json:"action_type"` // 1-关注,2-取消关注
}

RelationActionReq 关系操作请求

type RelationActionResp

type RelationActionResp struct {
	StatusCode int32  `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string `json:"status_msg"`  // 返回状态描述
}

RelationActionResp 关系操作响应

type RelationFollowListReq

type RelationFollowListReq struct {
	UserID int64  `json:"user_id"` // 用户id
	Token  string `json:"token"`   // 用户鉴权token
}

RelationFollowListReq 用于获取关注列表请求

type RelationFollowListResp

type RelationFollowListResp struct {
	StatusCode int32   `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string  `json:"status_msg"`  // 返回状态描述
	UserList   []*User `json:"user_list"`   // 用户信息列表
}

RelationFollowListResp 用于获取关注列表响应

type RelationFollowerListReq

type RelationFollowerListReq struct {
	UserID int64  `json:"user_id"` // 用户id
	Token  string `json:"token"`   // 用户鉴权token
}

RelationFollowerListReq 用于获取粉丝列表请求

type RelationFollowerListResp

type RelationFollowerListResp struct {
	StatusCode int32   `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string  `json:"status_msg"`  // 返回状态描述
	UserList   []*User `json:"user_list"`   // 用户信息列表
}

RelationFollowerListResp 用于获取粉丝列表响应

type RelationFriendListReq

type RelationFriendListReq struct {
	UserID int64  `json:"user_id"` // 用户id
	Token  string `json:"token"`   // 用户鉴权token
}

RelationFriendListReq 用于获取好友列表请求

type RelationFriendListResp

type RelationFriendListResp struct {
	StatusCode int32            `json:"status_code"` // 状态码,0-成功,其他值-失败
	StatusMsg  string           `json:"status_msg"`  // 返回状态描述
	UserList   []FriendUserResp `json:"user_list"`   // 用户信息列表
}

RelationFriendListResp 用于获取好友列表响应

type Response

type Response struct {
	Code int64  `json:"status_code"` // 状态码,0-成功,其他值-失败
	Msg  string `json:"status_msg"`  // 返回状态描述
}

Response 基础响应

type UploadReq

type UploadReq struct {
	Title    string `form:"title" json:"title"`
	FileName string
	Data     io.Reader
}

UploadReq is the request of upload api /publish/action/

type UploadResp

type UploadResp struct {
	Response
}

UploadResp is the response of upload api /publish/action/

type User

type User struct {
	ID              int64  `json:"id"`               // 用户id
	Username        string `json:"name"`             // 用户名称
	Avatar          string `json:"avatar"`           // 用户头像 URL
	FollowCount     int64  `json:"follow_count"`     // 关注总数
	FollowerCount   int64  `json:"follower_count"`   // 粉丝总数
	BackgroundImage string `json:"background_image"` // 用户个人页顶部大图
	Signature       string `json:"signature"`        // 个人简介
	TotalFavorites  int64  `json:"total_favorited"`  // 获赞数量
	WorkCount       int64  `json:"work_count"`       // 作品数量
	FavoriteCount   int64  `json:"favorite_count"`   // 点赞数量
	IsFollow        bool   `json:"is_follow"`        // true-已关注,false-未关注
}

User 用户信息

type UserInfoReq

type UserInfoReq struct {
	UserID int64  `query:"user_id" binding:"required"`
	Token  string `query:"token" binding:"required"`
}

UserInfoReq is the request of user info api

type UserInfoResp

type UserInfoResp struct {
	Response
	User *User `json:"user,omitempty"` // 用户信息
}

UserInfoResp is the response of user info api

type UserReq

type UserReq struct {
	Username string `form:"username" json:"username" query:"username" validate:"required,printascii,min=1,max=16"` // 用户名
	Password string `form:"password" json:"password" query:"password" validate:"required,printascii,min=6,max=16"` // 密码
}

UserReq is the request of user register/login api

type UserResp

type UserResp struct {
	Response
	Token  string `json:"token"`   // 用户鉴权token
	UserID int64  `json:"user_id"` // 用户id
}

UserResp is the response of user register/login api

type Video

type Video struct {
	ID            int64  `json:"id"`             // 视频唯一标识
	Author        *User  `json:"author"`         // 视频作者信息
	CommentCount  int64  `json:"comment_count"`  // 视频的评论总数
	CoverURL      string `json:"cover_url"`      // 视频封面地址
	FavoriteCount int64  `json:"favorite_count"` // 视频的点赞总数
	IsFavorite    bool   `json:"is_favorite"`    // true-已点赞,false-未点赞
	PlayURL       string `json:"play_url"`       // 视频播放地址
	Title         string `json:"title"`          // 视频标题
}

Video 视频信息

Jump to

Keyboard shortcuts

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