controller

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminController added in v1.1.0

type AdminController struct {
	AdminService *service.AdminService
	Core         *core.Core
}

func (*AdminController) CreateCategory added in v1.1.0

func (c *AdminController) CreateCategory(ctx *fiber.Ctx) error

Create Category godoc @Summary Create category @Description Create fasting category @Tags Admin @Accept json @Produce json @param payload body requests.CategoryRequest true "JSON payload" @Success 200 {object} utils.JSONResponse{data=transformer.CategoryTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/categories [post] @Security BasicAuth

func (*AdminController) CreateFasting added in v1.1.0

func (c *AdminController) CreateFasting(ctx *fiber.Ctx) error

Create Fasting godoc @Summary Create fasting @Description Create fasting @Tags Admin @Accept json @Produce json @param payload body requests.FastingCreateUpdateRequest true "JSON payload" @Success 200 {object} utils.JSONResponse{data=transformer.FastingTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/fastings [post] @Security BasicAuth

func (*AdminController) CreateSource added in v1.1.0

func (c *AdminController) CreateSource(ctx *fiber.Ctx) error

Create Source godoc @Summary Create source @Description Create fasting source @Tags Admin @Accept json @Produce json @param payload body requests.SourceRequest true "JSON payload" @Success 200 {object} utils.JSONResponse{data=transformer.SourceTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/sources [post] @Security BasicAuth

func (*AdminController) CreateType added in v1.1.0

func (c *AdminController) CreateType(ctx *fiber.Ctx) error

Create Type godoc @Summary Create type @Description Create fasting type @Tags Admin @Accept json @Produce json @param payload body requests.TypeRequest true "JSON payload" @Success 200 {object} utils.JSONResponse{data=transformer.TypeTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/types [post] @Security BasicAuth

func (*AdminController) DeleteCategory added in v1.2.2

func (c *AdminController) DeleteCategory(ctx *fiber.Ctx) error

Delete Category godoc @Summary Delete category @Description Delete fasting category @Tags Admin @Accept json @Produce json @Param id path int true "Category ID" @Success 200 {object} utils.JSONResponse{} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/categories/:id [delete] @Security BasicAuth

func (*AdminController) DeleteFasting added in v1.2.2

func (c *AdminController) DeleteFasting(ctx *fiber.Ctx) error

Delete Fasting godoc @Summary Delete fasting @Description Delete fasting @Tags Admin @Accept json @Produce json @Param id path int true "Fasting ID" @Success 200 {object} utils.JSONResponse{} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/fastings/:id [delete] @Security BasicAuth

func (*AdminController) DeleteSource added in v1.2.2

func (c *AdminController) DeleteSource(ctx *fiber.Ctx) error

Delete Source godoc @Summary Delete source @Description Delete fasting source @Tags Admin @Accept json @Produce json @Param id path int true "Source ID" @Success 200 {object} utils.JSONResponse{} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/sources/:id [delete] @Security BasicAuth

func (*AdminController) DeleteType added in v1.2.2

func (c *AdminController) DeleteType(ctx *fiber.Ctx) error

Delete Type godoc @Summary Delete type @Description Delete fasting type @Tags Admin @Accept json @Produce json @Param id path int true "Type ID" @Success 200 {object} utils.JSONResponse{} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/types/:id [delete] @Security BasicAuth

func (*AdminController) UpdateCategory added in v1.1.0

func (c *AdminController) UpdateCategory(ctx *fiber.Ctx) error

Update Category godoc @Summary Update category @Description Update fasting category @Tags Admin @Accept json @Produce json @param payload body requests.CategoryRequest true "JSON payload" @Param id path int true "Category ID" @Success 200 {object} utils.JSONResponse{data=transformer.CategoryTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/categories/:id [put] @Security BasicAuth

func (*AdminController) UpdateFasting added in v1.1.0

func (c *AdminController) UpdateFasting(ctx *fiber.Ctx) error

Update Fasting godoc @Summary Update fasting @Description Update fasting @Tags Admin @Accept json @Produce json @param payload body requests.FastingCreateUpdateRequest true "JSON payload" @Param id path int true "Fasting ID" @Success 200 {object} utils.JSONResponse{data=transformer.FastingTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/fastings/:id [put] @Security BasicAuth

func (*AdminController) UpdateSource added in v1.1.0

func (c *AdminController) UpdateSource(ctx *fiber.Ctx) error

Update Source godoc @Summary Update source @Description Update fasting source @Tags Admin @Accept json @Produce json @param payload body requests.SourceRequest true "JSON payload" @Param id path int true "Source ID" @Success 200 {object} utils.JSONResponse{data=transformer.SourceTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/sources/:id [put] @Security BasicAuth

func (*AdminController) UpdateType added in v1.1.0

func (c *AdminController) UpdateType(ctx *fiber.Ctx) error

Update Type godoc @Summary Update type @Description Update fasting type @Tags Admin @Accept json @Produce json @param payload body requests.TypeRequest true "JSON payload" @Param id path int true "Type ID" @Success 200 {object} utils.JSONResponse{data=transformer.TypeTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/admin/types/:id [put] @Security BasicAuth

type CategoryController

type CategoryController struct {
	CategoryService *service.CategoryService
}

func (*CategoryController) Index

func (c *CategoryController) Index(ctx *fiber.Ctx) error

ListCategory godoc @Summary List Categories @Description Get list of categories @Tags Categories @Accept json @Produce json @Success 200 {object} utils.JSONResponse{data=[]transformer.CategoryTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/categories [get]

type ControllerStruct

type ControllerStruct struct {
	Core               *core.Core
	SourceController   *SourceController
	TypesController    *TypesController
	CategoryController *CategoryController
	FastingController  *FastingController
	AdminController    *AdminController
}

func NewController

func NewController(
	c *core.Core,
	sourceService *service.SourceService,
	typesService *service.TypesService,
	categoryService *service.CategoryService,
	fastingService *service.FastingService,
	adminService *service.AdminService,
) *ControllerStruct

type FastingController

type FastingController struct {
	FastingService *service.FastingService
}

func (*FastingController) Index

func (c *FastingController) Index(ctx *fiber.Ctx) error

ListFasting godoc @Summary List Sunnah Fastings @Description Get list of sunnah fasting @Tags Fastings @Accept json @Produce json @Param type_id query int false "Type ID" @Param day query int false "Day in month" @Param month query int false "Month" @Param Year query int false "Year" @Success 200 {object} utils.JSONResponse{data=[]transformer.FastingTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/fastings [get]

type SourceController

type SourceController struct {
	SourceService *service.SourceService
}

func (*SourceController) Index

func (c *SourceController) Index(ctx *fiber.Ctx) error

ListSource godoc @Summary List Sources @Description Get list of sources @Tags Sources @Accept json @Produce json @Success 200 {object} utils.JSONResponse{data=[]transformer.SourceTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/sources [get]

type TypesController

type TypesController struct {
	TypesService *service.TypesService
}

func (*TypesController) Index

func (c *TypesController) Index(ctx *fiber.Ctx) error

ListTypes godoc @Summary List Types @Description Get list of types @Tags Types @Accept json @Produce json @Success 200 {object} utils.JSONResponse{data=[]transformer.TypeTransformer} "desc" @Failure 400 {object} utils.JSONResponse @Router /api/v1/types [get]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL