2020-10-30 18:16:21 +01:00
|
|
|
package member
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/go-chi/chi"
|
|
|
|
|
2020-10-31 12:27:55 +01:00
|
|
|
"demodesk/neko/internal/api/utils"
|
2020-10-30 18:16:21 +01:00
|
|
|
"demodesk/neko/internal/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MemberHandler struct {
|
2020-11-01 16:54:06 +01:00
|
|
|
sessions types.SessionManager
|
2020-10-30 18:16:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func New(
|
|
|
|
sessions types.SessionManager,
|
|
|
|
) *MemberHandler {
|
|
|
|
// Init
|
|
|
|
|
|
|
|
return &MemberHandler{
|
2020-11-01 16:54:06 +01:00
|
|
|
sessions: sessions,
|
2020-10-30 18:16:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-31 10:48:24 +01:00
|
|
|
func (h *MemberHandler) Router(
|
2020-10-31 12:27:55 +01:00
|
|
|
usersOnly utils.HttpMiddleware,
|
|
|
|
adminsOnly utils.HttpMiddleware,
|
2020-10-31 10:48:24 +01:00
|
|
|
) *chi.Mux {
|
2020-10-30 18:16:21 +01:00
|
|
|
r := chi.NewRouter()
|
|
|
|
|
|
|
|
return r
|
|
|
|
}
|