UPDATE: Add some api
This commit is contained in:
@@ -85,6 +85,34 @@ func (h *UserController) GetUserMedia(c fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetUserApplication godoc
|
||||||
|
// @Summary Get current user's application
|
||||||
|
// @Description Retrieve application list of the currently authenticated user
|
||||||
|
// @Tags Users
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Success 200 {object} response.CommonResponse
|
||||||
|
// @Failure 500 {object} response.CommonResponse
|
||||||
|
// @Router /users/current/application [get]
|
||||||
|
func (h *UserController) GetUserApplication(c fiber.Ctx) error {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
res, err := h.verificationService.GetVerificationByUserID(ctx, c.Locals("uid").(string))
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(response.CommonResponse{
|
||||||
|
Status: false,
|
||||||
|
Message: err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Status(fiber.StatusOK).JSON(response.CommonResponse{
|
||||||
|
Status: true,
|
||||||
|
Data: res,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// GetMediaByUserID godoc
|
// GetMediaByUserID godoc
|
||||||
// @Summary Get user's media by user ID
|
// @Summary Get user's media by user ID
|
||||||
// @Description Retrieve media list by specific user ID
|
// @Description Retrieve media list by specific user ID
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ func UserRoutes(app *fiber.App, controller *controllers.UserController, userRepo
|
|||||||
controller.GetUserMedia,
|
controller.GetUserMedia,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
route.Get(
|
||||||
|
"/current/application",
|
||||||
|
middlewares.JwtAccess(userRepo),
|
||||||
|
controller.GetUserApplication,
|
||||||
|
)
|
||||||
|
|
||||||
route.Get(
|
route.Get(
|
||||||
"/:id",
|
"/:id",
|
||||||
middlewares.JwtAccess(userRepo),
|
middlewares.JwtAccess(userRepo),
|
||||||
|
|||||||
Reference in New Issue
Block a user