add color to svg
This commit is contained in:
@@ -27,9 +27,10 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
malformedCustomerId = "malformed customer id"
|
||||
malformedUserEmail = "malformed user email"
|
||||
malformedSessionId = "malformed session id"
|
||||
malformedCustomerId = "malformed customer id"
|
||||
malformedUserEmail = "malformed user email"
|
||||
malformedSessionId = "malformed session id"
|
||||
invalidKeypadDimensions = "invalid keypad dimensions"
|
||||
)
|
||||
|
||||
func (h *NKodeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -99,7 +100,7 @@ func (h *NKodeHandler) GenerateSignupResetInterfaceHandler(w http.ResponseWriter
|
||||
NumbOfKeys: signupResetPost.NumbOfKeys,
|
||||
}
|
||||
if err := kp.IsValidKeypadDimension(); err != nil {
|
||||
badRequest(w, "invalid keypad dimensions")
|
||||
badRequest(w, invalidKeypadDimensions)
|
||||
return
|
||||
}
|
||||
customerId, err := uuid.Parse(signupResetPost.CustomerId)
|
||||
@@ -179,7 +180,7 @@ func (h *NKodeHandler) ConfirmNKodeHandler(w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
|
||||
func (h *NKodeHandler) GetLoginInterfaceHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
log.Print("get login interface")
|
||||
if r.Method != http.MethodPost {
|
||||
methodNotAllowed(w)
|
||||
return
|
||||
@@ -207,6 +208,7 @@ func (h *NKodeHandler) GetLoginInterfaceHandler(w http.ResponseWriter, r *http.R
|
||||
}
|
||||
|
||||
func (h *NKodeHandler) LoginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("login")
|
||||
if r.Method != http.MethodPost {
|
||||
methodNotAllowed(w)
|
||||
return
|
||||
@@ -257,6 +259,7 @@ func (h *NKodeHandler) RenewAttributesHandler(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (h *NKodeHandler) RandomSvgInterfaceHandler(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("random svg interface")
|
||||
if r.Method != http.MethodGet {
|
||||
methodNotAllowed(w)
|
||||
}
|
||||
@@ -265,7 +268,12 @@ func (h *NKodeHandler) RandomSvgInterfaceHandler(w http.ResponseWriter, r *http.
|
||||
handleError(w, err)
|
||||
return
|
||||
}
|
||||
respBody := RandomSvgInterfaceResp{Svgs: svgs}
|
||||
|
||||
respBody := RandomSvgInterfaceResp{
|
||||
Svgs: svgs,
|
||||
Colors: SetColors,
|
||||
}
|
||||
|
||||
marshalAndWriteBytes(w, respBody)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user