Documentation ¶
Overview ¶
* @Author: alexander.huang * @Date: 2022-05-26 12:44:17 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-26 12:44:17
* @Author: alexander.huang * @Date: 2022-05-26 12:44:17 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-26 12:44:17
* @Author: alexander.huang * @Date: 2022-05-25 02:53:50 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-25 02:53:50
* @Author: alexander.huang * @Date: 2022-05-25 22:53:50 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-25 22:53:50
* @Author: alexander.huang * @Date: 2022-05-26 12:44:17 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-26 12:44:17
* @Author: alexander.huang * @Date: 2022-05-19 03:10:11 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-23 21:40:51
* @Author: alexander.huang * @Date: 2022-05-19 20:14:50 * @Last Modified by: alexander.huang * @Last Modified time: 2022-05-23 21:40:51
Index ¶
- Variables
- func BusinessFail(c *gin.Context, msg string)
- func Fail(c *gin.Context, errorCode int, msg string)
- func FailByError(c *gin.Context, error global.CustomError)
- func InfoFail(c *gin.Context, errorCode int, msg string)
- func InfoSuccess(c *gin.Context, user models.User)
- func LoginFail(c *gin.Context, errorCode int, msg string)
- func LoginSuccess(c *gin.Context, user models.User)
- func RegisterFail(c *gin.Context, errorCode int, msg string)
- func RegisterSuccess(c *gin.Context, user models.User)
- func ServerError(c *gin.Context, err interface{})
- func Success(c *gin.Context, data interface{})
- func TokenFail(c *gin.Context)
- func ValidateFail(c *gin.Context, msg string)
- type Comment
- type CommentListResponse
- type CommentResponse
- type FavoriteListResponse
- type FeedResponse
- type InfoResponse
- type PublishListResponse
- type RegisterLoginResponse
- type RelationFollowListResponse
- type RelationFollowerListResponse
- type Response
- type UserAPI
- type VideoAuthorApi
Constants ¶
This section is empty.
Variables ¶
var ResponseSuccess = Response{
0,
"ok",
}
Functions ¶
func FailByError ¶
func FailByError(c *gin.Context, error global.CustomError)
FailByError 失败响应 返回自定义错误的错误码、错误信息
func ServerError ¶
Types ¶
type CommentListResponse ¶
type CommentResponse ¶
type FavoriteListResponse ¶
type FavoriteListResponse struct { Response VideoList []*VideoAuthorApi `json:"video_list"` }
type FeedResponse ¶
type FeedResponse struct { Response NextTime int64 `json:"next_time"` VideoList []*VideoAuthorApi `json:"video_list"` }
type InfoResponse ¶
type PublishListResponse ¶
type PublishListResponse struct { Response VideoList []*VideoAuthorApi `json:"video_list"` }
type RegisterLoginResponse ¶
type RelationFollowListResponse ¶
type RelationFollowListResponse struct { Response UserList []*UserAPI `json:"user_list"` // 用户信息列表 }
RelationFollowListResponse 获取关注列表响应
type RelationFollowerListResponse ¶
type RelationFollowerListResponse struct { Response UserList []*UserAPI `json:"user_list"` // 用户信息列表 }
RelationFollowerListResponse 获取粉丝列表响应
type Response ¶
type Response struct { ErrorCode int `json:"status_code"` // 自定义错误码 Message string `json:"status_msg"` // 信息 }
响应结构体
type VideoAuthorApi ¶
type VideoAuthorApi struct { ID uint64 `json:"id"` Author *UserAPI `json:"author" gorm:"embedded;embeddedPrefix:author_"` PlayURL string `json:"play_url"` CoverURL string `json:"cover_url"` FavoriteCount uint64 `json:"favorite_count"` CommentCount uint64 `json:"comment_count"` IsFavorite bool `json:"is_favorite"` }