Skip to content

Instantly share code, notes, and snippets.

@chebykinn
Created February 13, 2023 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chebykinn/e49b483330ea7c84a1b8082b0a86fc01 to your computer and use it in GitHub Desktop.
Save chebykinn/e49b483330ea7c84a1b8082b0a86fc01 to your computer and use it in GitHub Desktop.
Mify todo handler stub
package api_todos
import (
"errors"
"net/http"
"example.com/namespace/todo-app/go-services/internal/todo-backend/generated/api"
"example.com/namespace/todo-app/go-services/internal/todo-backend/generated/core"
)
type TodosApiService struct{}
// NewTodosApiService creates a default api service
func NewTodosApiService() openapi.TodosApiServicer {
return &TodosApiService{}
}
// TodosPost - Add new todo note
func (s *TodosApiService) TodosPost(ctx *core.MifyRequestContext, todoNoteCreateRequest openapi.TodoNoteCreateRequest) (openapi.ServiceResponse, error) {
// TODO: add handler logic
//TODO: Uncomment the next line to return response Response(200, TodoNote{}) or use other options such as http.Ok
//return openapi.Response(200, TodoNote{}), nil
//TODO: Uncomment the next line to return response Response(500, Error{}) or use other options such as http.Ok
//return openapi.Response(500, Error{}), nil
return openapi.Response(http.StatusNotImplemented, nil), errors.New("TodosPost method not implemented")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment