feat: initial commit

This commit is contained in:
2025-02-22 09:42:15 +01:00
parent ee4a65b345
commit e6e5c9b04d
43 changed files with 1191 additions and 247 deletions

View File

@ -2,10 +2,13 @@ package issue
import (
"net/http"
"forge.cadoles.com/wpetit/clearcase/internal/core/service"
)
type Handler struct {
mux *http.ServeMux
mux *http.ServeMux
issueManager *service.IssueManager
}
// ServeHTTP implements http.Handler.
@ -13,12 +16,14 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.mux.ServeHTTP(w, r)
}
func NewHandler() *Handler {
func NewHandler(issueManager *service.IssueManager) *Handler {
h := &Handler{
mux: http.NewServeMux(),
mux: http.NewServeMux(),
issueManager: issueManager,
}
h.mux.HandleFunc("GET /", h.getIssuePage)
h.mux.HandleFunc("POST /", h.handleIssueSummary)
return h
}