UPDATE: Historian module
All checks were successful
Build and Release / release (push) Successful in 1m20s

This commit is contained in:
2026-04-12 00:35:14 +07:00
parent af76d2a26a
commit 03415782d1
38 changed files with 2759 additions and 231 deletions

View File

@@ -14,12 +14,18 @@ import (
type UserController struct {
service services.UserService
mediaService services.MediaService
verificationService services.VerificationService
}
func NewUserController(svc services.UserService, mediaSvc services.MediaService) *UserController {
func NewUserController(
svc services.UserService,
mediaSvc services.MediaService,
verificationSvc services.VerificationService,
) *UserController {
return &UserController{
service: svc,
mediaService: mediaSvc,
verificationService: verificationSvc,
}
}
@@ -106,6 +112,33 @@ func (h *UserController) GetMediaByUserID(c fiber.Ctx) error {
})
}
// GetApplicationUserID godoc
// @Summary Get user's media by user ID
// @Description Retrieve media list by specific user ID
// @Tags Users
// @Accept json
// @Produce json
// @Param id path string true "User ID"
// @Success 200 {object} response.CommonResponse
// @Failure 500 {object} response.CommonResponse
// @Router /users/{id}/application [get]
func (h *UserController) GetVerificationByUserID(c fiber.Ctx) error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
userId := c.Params("id")
res, err := h.verificationService.GetVerificationByUserID(ctx, userId)
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,
})
}
// UpdateProfile godoc
// @Summary Update user profile
// @Description Update the profile details of the currently authenticated user