Frontend: - Implementar máscara de entrada de telefone para números BR ((XX) XXXXX-XXXX). - Atualizar formulário de cadastro para enviar dados completos do perfil do candidato (endereço, formação, habilidades, etc.). - Corrigir problemas de idioma misto na página de Detalhes da Vaga e adicionar traduções faltantes. Backend: - Atualizar modelo de Usuário, Entidade e DTOs para incluir campos de perfil (Data de Nascimento, Endereço, Formação, etc.). - Atualizar UserRepository para persistir e recuperar os dados estendidos do usuário no PostgreSQL. - Atualizar RegisterCandidateUseCase para mapear campos de entrada para a entidade Usuário.
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package handlers
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"github.com/rede5/gohorsejobs/backend/internal/api/middleware"
|
|
)
|
|
|
|
// GetMyApplications lists applications for the authenticated user
|
|
// @Summary Get My Applications
|
|
// @Description List all applications for the logged-in user
|
|
// @Tags Applications
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Success 200 {array} models.ApplicationWithDetails
|
|
// @Failure 401 {string} string "Unauthorized"
|
|
// @Failure 500 {string} string "Internal Server Error"
|
|
// @Router /api/v1/applications/me [get]
|
|
func (h *ApplicationHandler) GetMyApplications(w http.ResponseWriter, r *http.Request) {
|
|
// Get user ID from context (set by authMiddleware)
|
|
userID, ok := r.Context().Value(middleware.ContextUserID).(string)
|
|
if !ok || userID == "" {
|
|
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
|
return
|
|
}
|
|
|
|
userIDStr := userID
|
|
|
|
apps, err := h.Service.GetApplicationsByUser(userIDStr)
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
json.NewEncoder(w).Encode(apps)
|
|
}
|