-
-
Save chebykinn/702f24abe035cd99dbc06c4447ecc755 to your computer and use it in GitHub Desktop.
Helper for converting todo application model to openapi model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package handlers | |
import ( | |
"example.com/namespace/todo-app/go-services/internal/todo-backend/domain" | |
openapi "example.com/namespace/todo-app/go-services/internal/todo-backend/generated/api" | |
) | |
func MakeAPITodoNote(note domain.TodoNote) openapi.TodoNote { | |
return openapi.TodoNote{ | |
Id: note.ID, | |
Title: note.Title, | |
Description: note.Description, | |
IsCompleted: note.IsCompleted, | |
CreatedAt: note.CreatedAt.Format("2006-01-02 15:04:05"), | |
UpdatedAt: note.UpdatedAt.Format("2006-01-02 15:04:05"), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment