feat: initial commit
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user