|
|
@ -16,6 +16,7 @@ import (
|
|
|
|
type Service interface {
|
|
|
|
type Service interface {
|
|
|
|
HandleStaticPage(w io.Writer, view string, ctx Context) error
|
|
|
|
HandleStaticPage(w io.Writer, view string, ctx Context) error
|
|
|
|
HandleUtenti() ([]*model.User, error)
|
|
|
|
HandleUtenti() ([]*model.User, error)
|
|
|
|
|
|
|
|
HandleListaUtenti() ([]website.UserInfo, error)
|
|
|
|
HandleStoriaPage(w io.Writer, ctx Context) error
|
|
|
|
HandleStoriaPage(w io.Writer, ctx Context) error
|
|
|
|
HandleQueryAppunti(w io.Writer, query string, ctx Context) error
|
|
|
|
HandleQueryAppunti(w io.Writer, query string, ctx Context) error
|
|
|
|
HandleNewsPage(w io.Writer, ctx Context) error
|
|
|
|
HandleNewsPage(w io.Writer, ctx Context) error
|
|
|
@ -61,6 +62,15 @@ func (h *DefaultHandler) HandleUtenti() ([]*model.User, error) {
|
|
|
|
return utenti, nil
|
|
|
|
return utenti, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (h *DefaultHandler) HandleListaUtenti() ([]website.UserInfo, error) {
|
|
|
|
|
|
|
|
utenti, err := h.ListaUtenti.GetUtenti()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return utenti, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (h *DefaultHandler) HandleStoriaPage(w io.Writer, ctx Context) error {
|
|
|
|
func (h *DefaultHandler) HandleStoriaPage(w io.Writer, ctx Context) error {
|
|
|
|
storia, err := h.Storia.GetStoria()
|
|
|
|
storia, err := h.Storia.GetStoria()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|