Documentation ¶
Index ¶
- func NewResponse(code ResponseCode, message string, data ...interface{}) interface{}
- type BasicResponse
- type CommentDetailResponse
- type CommentListResponse
- type CommentUserStatusResponse
- type CreateCommentResponse
- type CreatePostResponse
- type DataResponse
- type FollowListResponse
- type PostDetailResponse
- type PostListResponse
- type PostUserStatus
- type ReplyDetailResponse
- type ReplyListResponse
- type ResponseCode
- type UploadPostImageResponse
- type UserProfileData
- type UserToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResponse ¶
func NewResponse(code ResponseCode, message string, data ...interface{}) interface{}
Types ¶
type BasicResponse ¶
type BasicResponse struct { Code ResponseCode `json:"code"` Message string `json:"message"` }
type CommentDetailResponse ¶
type CommentDetailResponse struct { CommentID uint64 `json:"comment_id"` PostID uint64 `json:"post_id"` PosterUID uint64 `json:"poster_uid"` PostTimestamp int64 `json:"post_timestamp"` Content string `json:"content"` Likes int64 `json:"likes"` Replies int `json:"replies"` Is_liked bool `json:"is_liked"` Is_disliked bool `json:"is_disliked"` }
func NewCommentDetailResponse ¶
func NewCommentDetailResponse(comment models.CommentInfo, likeCount int64) *CommentDetailResponse
type CommentListResponse ¶
type CommentListResponse struct {
IDs []uint64 `json:"ids"`
}
func NewCommentListResponse ¶
func NewCommentListResponse(commentInfos []models.CommentInfo) CommentListResponse
type CommentUserStatusResponse ¶
type CommentUserStatusResponse struct { IsLiked bool `json:"is_liked"` IsDisliked bool `json:"is_disliked"` }
func NewCommentUserStatusResponse ¶
func NewCommentUserStatusResponse(isLiked, isDisliked bool) CommentUserStatusResponse
type CreateCommentResponse ¶
type CreateCommentResponse struct {
ID uint64 `json:"id"`
}
func NewCreateCommentResponse ¶
func NewCreateCommentResponse(commentID uint64) CreateCommentResponse
type CreatePostResponse ¶
type CreatePostResponse struct {
ID uint64 `json:"id"`
}
func NewCreatePostResponse ¶
func NewCreatePostResponse(postInfo models.PostInfo) CreatePostResponse
type DataResponse ¶
type DataResponse struct { Code ResponseCode `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
type FollowListResponse ¶
type FollowListResponse struct {
IDs []uint64 `json:"ids"`
}
func NewFollowListResponse ¶
func NewFollowListResponse(followInfos []models.FollowInfo) FollowListResponse
func NewFollowerListResponse ¶
func NewFollowerListResponse(followInfos []models.FollowInfo) FollowListResponse
type PostDetailResponse ¶
type PostDetailResponse struct { CommentID uint64 `json:"comment_id"` UID uint64 `json:"uid"` Timestamp int64 `json:"timestamp"` Title string `json:"title"` Content string `json:"content"` ParentPostID *uint64 `json:"parent_post_id"` Images []string `json:"images"` Like int64 `json:"like"` Favourite int64 `json:"favourite"` Farward int `json:"farward"` }
func NewPostDetailResponse ¶
func NewPostDetailResponse(post models.PostInfo, likeCount, favouriteCount int64) *PostDetailResponse
type PostListResponse ¶
type PostListResponse struct {
IDs []int64 `json:"ids"`
}
func NewPostListResponse ¶
func NewPostListResponse(posts []int64) *PostListResponse
type PostUserStatus ¶
type PostUserStatus struct { PostID uint64 `json:"post_id"` UID uint64 `json:"uid"` Like bool `json:"like"` Favourite bool `json:"favourite"` }
func NewPostUserStatus ¶
func NewPostUserStatus(postID uint64, uid uint64, like bool, favourite bool) PostUserStatus
type ReplyDetailResponse ¶
type ReplyDetailResponse struct { CreateTime int64 `json:"create_time"` CommentID uint64 `json:"comment_id"` UID uint64 `json:"uid"` ParentReplyID *uint64 `json:"parent_reply_id"` ParentReplyUID *uint64 `json:"parent_reply_uid"` Content string `json:"content"` }
func NewReplyDetailResponse ¶
func NewReplyDetailResponse(reply models.ReplyInfo) ReplyDetailResponse
type ReplyListResponse ¶
type ReplyListResponse struct {
IDs []uint64 `json:"ids"`
}
func NewReplyListResponse ¶
func NewReplyListResponse(replies []uint64) ReplyListResponse
type ResponseCode ¶
type ResponseCode uint64
type UploadPostImageResponse ¶
type UploadPostImageResponse struct {
UUID string `json:"uuid"`
}
func NewUploadPostImageResponse ¶
func NewUploadPostImageResponse(uuid string) UploadPostImageResponse
type UserProfileData ¶
type UserProfileData struct { UID uint64 `json:"uid"` Username string `json:"username"` Nickname string `json:"nickname"` Avatar string `json:"avatar_url"` Birth *int64 `json:"birth"` Gender *string `json:"gender"` Level uint64 `json:"level"` }
func NewUserProfileData ¶
func NewUserProfileData(model *models.UserInfo) *UserProfileData
Click to show internal directories.
Click to hide internal directories.