Compare commits
3 Commits
56770955d4
...
53da1eee2a
| Author | SHA1 | Date | |
|---|---|---|---|
| 53da1eee2a | |||
| 20ea6c4a27 | |||
| 0e557c3f89 |
@@ -29,6 +29,14 @@ type PostListDTO struct {
|
|||||||
Offset int `json:"offset"`
|
Offset int `json:"offset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SearchPostListDTO struct {
|
||||||
|
Posts []PostDTO `json:"posts"`
|
||||||
|
Count int `json:"count"`
|
||||||
|
Query string `json:"query"`
|
||||||
|
Limit int `json:"limit"`
|
||||||
|
Offset int `json:"offset"`
|
||||||
|
}
|
||||||
|
|
||||||
func ToPostDTO(post *database.Post) PostDTO {
|
func ToPostDTO(post *database.Post) PostDTO {
|
||||||
if post == nil {
|
if post == nil {
|
||||||
return PostDTO{}
|
return PostDTO{}
|
||||||
|
|||||||
@@ -74,3 +74,19 @@ func ToSanitizedUserDTOs(users []database.User) []SanitizedUserDTO {
|
|||||||
}
|
}
|
||||||
return dtos
|
return dtos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RegistrationResponseDTO struct {
|
||||||
|
User UserDTO `json:"user"`
|
||||||
|
VerificationSent bool `json:"verification_sent"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToRegistrationResponseDTO(user *database.User, verificationSent bool) RegistrationResponseDTO {
|
||||||
|
return RegistrationResponseDTO{
|
||||||
|
User: ToUserDTO(user),
|
||||||
|
VerificationSent: verificationSent,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type AccountDeletionResponseDTO struct {
|
||||||
|
PostsDeleted bool `json:"posts_deleted"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,3 +41,14 @@ func ToVoteDTOs(votes []database.Vote) []VoteDTO {
|
|||||||
}
|
}
|
||||||
return dtos
|
return dtos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type VoteResponseDTO struct {
|
||||||
|
HasVote bool `json:"has_vote"`
|
||||||
|
Vote *VoteDTO `json:"vote,omitempty"`
|
||||||
|
IsAnonymous bool `json:"is_anonymous"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type VoteListDTO struct {
|
||||||
|
Votes []VoteDTO `json:"votes"`
|
||||||
|
Count int `json:"count"`
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user