Documentation
¶
Index ¶
- type Controller
- func (ctrl *Controller) HandleCreateRecipe(c echo.Context) error
- func (ctrl *Controller) HandleDeleteRecipe(c echo.Context) error
- func (ctrl *Controller) HandlePing(c echo.Context) error
- func (ctrl *Controller) HandleReadRecipe(c echo.Context) error
- func (ctrl *Controller) HandleReadRecipes(c echo.Context) error
- func (ctrl *Controller) HandleUpdateRecipe(c echo.Context) error
- type Controllers
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller - リクエストを処理しアプリケーションコアに渡す
func NewController ¶
func NewController(p *core.Provider) *Controller
NewController - Controllerのコンストラクタ
func (*Controller) HandleCreateRecipe ¶
func (ctrl *Controller) HandleCreateRecipe(c echo.Context) error
HandleCreateRecipes - レシピを作成する. @Summary レシピを作成する @Description title, making_tike, serves, ingredients, costからレシピを作成する @Accept json @Produce json @Param title query string true "Title" @Param making_time query string true "Making Time" @Param serves query string true "Serves" @Param ingredients query string true "Ingredients" @Param cost query string true "Cost" @Success 200 {object} Response @Failure 400 {object} Response @Failure 500 {object} Response @Router /recipes/ [post]
func (*Controller) HandleDeleteRecipe ¶
func (ctrl *Controller) HandleDeleteRecipe(c echo.Context) error
HandleUpdateRecipe - 指定したIDのレシピを削除. @Summary 指定したIDのレシピを削除 @Description 指定したIDのレシピを削除 @Accept json @Produce json @Param id path string true "Recipe ID" @Success 200 {object} Response @Failure 400 {object} Response @Failure 404 {object} Response @Failure 500 {object} Response @Router /recipes/{id} [delete]
func (*Controller) HandlePing ¶
func (ctrl *Controller) HandlePing(c echo.Context) error
HandleCreateRecipes - Ping用のルート. @Summary Ping用のルート. @Description Getでアクセスすると"OK"を返す @Accept json @Produce json @Success 200 {object} Response @Router /ping [get]
func (*Controller) HandleReadRecipe ¶
func (ctrl *Controller) HandleReadRecipe(c echo.Context) error
HandleReadRecipe - 指定したIDのレシピを取得. @Summary 指定したIDのレシピを取得 @Description 指定したIDのレシピを取得 @Accept json @Produce json @Param id path string true "Recipe ID" @Success 200 {object} Response @Failure 404 {object} Response @Failure 500 {object} Response @Router /recipes/{id} [get]
func (*Controller) HandleReadRecipes ¶
func (ctrl *Controller) HandleReadRecipes(c echo.Context) error
HandleReadRecipes - レシピを全て取得. @Summary レシピを全て取得 @Description レシピを全て取得し、配列にする @Accept json @Produce json @Success 200 {object} Response @Failure 500 {object} Response @Router /recipes/ [get]
func (*Controller) HandleUpdateRecipe ¶
func (ctrl *Controller) HandleUpdateRecipe(c echo.Context) error
HandleUpdateRecipe - 指定したIDのレシピを更新. @Summary 指定したIDのレシピを更新 @Description 指定したIDのレシピを更新 @Accept json @Produce json @Param id path string true "Recipe ID" @Param title query string true "Title" @Param making_time query string true "Making Time" @Param serves query string true "Serves" @Param ingredients query string true "Ingredients" @Param cost query string true "Cost" @Success 200 {object} Response @Failure 400 {object} Response @Failure 500 {object} Response @Router /recipes/{id} [patch]
type Controllers ¶
type Controllers struct {
Ctrl *Controller
}
Controllers - コントローラをまとめた構造体. DIで利用.
func NewControllers ¶
func NewControllers(ctrl *Controller) *Controllers
NewControllers - コントローラをまとめた構造体のコンストラクタ.