Documentation ¶
Index ¶
- type DiariesController
- func (u *DiariesController) CreateDiary(c *fiber.Ctx) error
- func (u *DiariesController) DeleteDiary(c *fiber.Ctx) error
- func (u *DiariesController) GetDiaryById(c *fiber.Ctx) error
- func (u *DiariesController) ListAllDiaries(c *fiber.Ctx) error
- func (u *DiariesController) UpdateDiary(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiariesController ¶
type DiariesController struct {
DiariesServices diaries.DiariesServicesInterface
}
func (*DiariesController) CreateDiary ¶
func (u *DiariesController) CreateDiary(c *fiber.Ctx) error
Create Diary godoc @Summary Create Diary @Id CreateDiary @Tags Diaries @Security Token @Param create body models.ReqCreateDiary true "all fields mandatory. for datePost (ex: DD-MM-YYYY)" @Success 200 {object} models.ResponseSuccess "Diary Successfully Created" @Failure 422 {object} models.ResponseErrors "code: 422, message: "Invalid request" " @Failure 401 {object} models.ResponseErrors "code: 401, message: "JWT Token is not valid" " @Router /api/v1/diary/create [post]
func (*DiariesController) DeleteDiary ¶
func (u *DiariesController) DeleteDiary(c *fiber.Ctx) error
DeleteDiary godoc @Summary Delete Diary @Id DeleteDiary @Tags Diaries @Security Token @Param id path integer true "Diary ID" @Success 200 {object} models.ResponseSuccess "Diary Successfully Deleted" " @Failure 422 {object} models.ResponseErrors "code: 422, message: "Invalid request" " @Failure 401 {object} models.ResponseErrors "code: 401, message: "Username or password not valid, please try again" " @Router /api/v1/diary/delete/{id} [delete]
func (*DiariesController) GetDiaryById ¶
func (u *DiariesController) GetDiaryById(c *fiber.Ctx) error
GetDiaryById godoc @Summary Get Diary By Id @Id GetDiaryById @Tags Diaries @Security Token @Success 200 {object} entity.UserDiary "entity.UserDiary" @Failure 422 {object} models.ResponseErrors "code: 422, message: "Invalid request" " @Failure 401 {object} models.ResponseErrors "code: 401, message: "Username or password not valid, please try again" " @Router /api/v1/diary/{id} [get]
func (*DiariesController) ListAllDiaries ¶
func (u *DiariesController) ListAllDiaries(c *fiber.Ctx) error
ListAllDiaries godoc @Summary List All Diaries @Id ListAllDiaries @Tags Diaries @Security Token @Param page query string false " " @Param limit query string false " " @Param year query string true "year of posted diaries" @param quarter query string true "Quarter of diaries: ex (1 : January - March, 2: April - June, 3: July - September, 4: October - December)" @Success 200 {object} models.ResponseSuccess "models.Pagination" @Failure 422 {object} models.ResponseErrors "code: 422, message: "Invalid request" " @Failure 401 {object} models.ResponseErrors "code: 401, message: "Username or password not valid, please try again" " @Router /api/v1/diary/listall [get]
func (*DiariesController) UpdateDiary ¶
func (u *DiariesController) UpdateDiary(c *fiber.Ctx) error
UpdateDiary godoc @Summary Update Diary @Id UpdateDiary @Tags Diaries @Security Token @Param id path integer true "Diary ID" @Param update body models.ReqUpdateDiary true "all fields mandatory. for datePost (ex: DD-MM-YYYY)" @Success 200 {object} models.ResponseSuccess "Diary Successfully Updated" @Failure 422 {object} models.ResponseErrors "code: 422, message: "Invalid request" " @Failure 401 {object} models.ResponseErrors "code: 401, message: "Invalid ID" " @Router /api/v1/diary/update/{id} [put]