feat: add s5 login and register endpoints
This commit is contained in:
parent
13ca22d80e
commit
28444ca456
|
@ -15,4 +15,8 @@ type HTTPService interface {
|
|||
|
||||
type HTTPHandler interface {
|
||||
SmallFileUpload(context *jape.Context)
|
||||
AccountRegisterChallenge(context *jape.Context)
|
||||
AccountRegister(context *jape.Context)
|
||||
AccountLoginChallenge(context *jape.Context)
|
||||
AccountLogin(context *jape.Context)
|
||||
}
|
||||
|
|
|
@ -33,6 +33,10 @@ func (h *HTTPImpl) GetHttpRouter() *httprouter.Router {
|
|||
"GET /s5/version": h.versionHandler,
|
||||
"GET /s5/p2p": h.p2pHandler,
|
||||
"POST /s5/upload": h.uploadHandler,
|
||||
"GET /account/register": h.accountRegisterChallengeHandler,
|
||||
"POST /account/register": h.accountRegisterHandler,
|
||||
"GET /account/login": h.accountLoginChallengeHandler,
|
||||
"POST /account/login": h.accountLoginHandler,
|
||||
})
|
||||
|
||||
return mux
|
||||
|
@ -92,3 +96,15 @@ func (h *HTTPImpl) p2pHandler(ctx jape.Context) {
|
|||
func (h *HTTPImpl) uploadHandler(context jape.Context) {
|
||||
h.handler.SmallFileUpload(&context)
|
||||
}
|
||||
func (h *HTTPImpl) accountRegisterChallengeHandler(context jape.Context) {
|
||||
h.handler.AccountRegisterChallenge(&context)
|
||||
}
|
||||
func (h *HTTPImpl) accountRegisterHandler(context jape.Context) {
|
||||
h.handler.AccountRegisterChallenge(&context)
|
||||
}
|
||||
func (h *HTTPImpl) accountLoginChallengeHandler(context jape.Context) {
|
||||
h.handler.AccountLoginChallenge(&context)
|
||||
}
|
||||
func (h *HTTPImpl) accountLoginHandler(context jape.Context) {
|
||||
h.handler.AccountLoginChallenge(&context)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue