Added migrations
This commit is contained in:
parent
4a16acc87e
commit
5b18009658
34 changed files with 929 additions and 154 deletions
13
internal/interfaces/api/responses/error_response.go
Normal file
13
internal/interfaces/api/responses/error_response.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package responses
|
||||
|
||||
type ErrorResponse struct {
|
||||
ErrorCode int `json:"error_code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func CreateErrorResponse(code int, msg string) ErrorResponse {
|
||||
return ErrorResponse{
|
||||
ErrorCode: code,
|
||||
Message: msg,
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package responses
|
||||
|
||||
type GetListPostResponseItem struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type GetListPostResponse []GetListPostResponseItem
|
||||
15
internal/interfaces/api/responses/post_response.go
Normal file
15
internal/interfaces/api/responses/post_response.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package responses
|
||||
|
||||
import "time"
|
||||
|
||||
type PostResponse struct {
|
||||
Id string `json:"id"`
|
||||
UserId string `json:"userId"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type PostResponseList []*PostResponse
|
||||
Loading…
Add table
Add a link
Reference in a new issue