Documentation ¶
Index ¶
- func CreatePost(req CreatePostRequest, uID uint) (bool, error)
- func CreatePostImage(req CreatePostImageRequest) (bool, error)
- func VotePost(req VoteRequest, uID uint)
- type CreatePostImageRequest
- type CreatePostRequest
- type GetPostsResponse
- type ListPostRequest
- type TCircle
- type TUser
- type TVote
- type VotePostRequest
- type VoteRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePost ¶
func CreatePost(req CreatePostRequest, uID uint) (bool, error)
func CreatePostImage ¶
func CreatePostImage(req CreatePostImageRequest) (bool, error)
func VotePost ¶
func VotePost(req VoteRequest, uID uint)
Types ¶
type CreatePostImageRequest ¶
type CreatePostRequest ¶
type CreatePostRequest struct { CircleID uint `json:"circle_id" binding:"required"` Content string `json:"content" binding:"required"` Type string `json:"type"` Vote VoteRequest `json:"vote"` }
type GetPostsResponse ¶
type GetPostsResponse struct { ID uint `json:"id"` Content string `json:"content"` Type string `json:"type"` User TUser `json:"user"` Circle TCircle `json:"circle"` CreateAt time.Time `json:"create_at"` UpdateAt time.Time `json:"update_at"` Images []postimagedao.Image `json:"images"` Vote *TVote `json:"vote"` }
GetPostsResponse post返回结构体
func ListPost ¶
func ListPost(req ListPostRequest, uID uint) ([]GetPostsResponse, error)
ListPost posts列表
type ListPostRequest ¶
ListPostRequest posts请求
type TVote ¶
type TVote struct { Title string `json:"title"` Options []postvotedao.VoteOption `json:"options"` TotalCount uint `json:"total_count"` IsCanVote bool `json:"is_can_vote"` IsVoted bool `json:"is_voted"` IsExpired bool `json:"is_expired"` VotedOptionID uint `json:"vote_option"` CloseDate time.Time `json:"close_date"` }
TVote 投票
type VotePostRequest ¶
Click to show internal directories.
Click to hide internal directories.