34 lines
964 B
Go
34 lines
964 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
|
|
"openreplay/backend/pkg/conditions"
|
|
"openreplay/backend/pkg/logger"
|
|
"openreplay/backend/pkg/server/api"
|
|
"openreplay/backend/pkg/token"
|
|
)
|
|
|
|
type handlersImpl struct {
|
|
log logger.Logger
|
|
responser *api.Responser
|
|
}
|
|
|
|
func NewHandlers(log logger.Logger, responser *api.Responser, tokenizer *token.Tokenizer, conditions conditions.Conditions) (api.Handlers, error) {
|
|
return &handlersImpl{
|
|
log: log,
|
|
responser: responser,
|
|
}, nil
|
|
}
|
|
|
|
func (e *handlersImpl) GetAll() []*api.Description {
|
|
return []*api.Description{
|
|
{"GET", "/v1/web/conditions/{project}", e.getConditions, api.NoPermissions, api.DoNotTrack},
|
|
{"GET", "/v1/mobile/conditions/{project}", e.getConditions, api.NoPermissions, api.DoNotTrack},
|
|
}
|
|
}
|
|
|
|
func (e *handlersImpl) getConditions(w http.ResponseWriter, r *http.Request) {
|
|
e.responser.ResponseWithError(e.log, r.Context(), w, http.StatusNotImplemented, nil, time.Now(), r.URL.Path, 0)
|
|
}
|