wip: add api auth and /resume endpoint
This commit is contained in:
parent
22e2f6005f
commit
aaec8ec08d
23 changed files with 1244 additions and 271 deletions
24
internal/delivery/http/v1/resume.go
Normal file
24
internal/delivery/http/v1/resume.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.roboces.dev/catalin/cvvvvv/internal/domain"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ResumeResponse struct {
|
||||
Resume domain.Resume `json:"resume"`
|
||||
}
|
||||
|
||||
func (h *Handler) getResume(ctx *gin.Context) {
|
||||
|
||||
_, err := h.VerifyAuthentication(ctx)
|
||||
if err != nil {
|
||||
newResponse(ctx, http.StatusUnauthorized, "Api key not provided or invalid")
|
||||
return
|
||||
}
|
||||
ctx.JSON(http.StatusOK, ResumeResponse{
|
||||
Resume: h.services.Resumes.Get(),
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue