mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fmt.
This commit is contained in:
parent
85bb26d77c
commit
900ae006b8
@ -1,16 +1,16 @@
|
|||||||
package members
|
package members
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"demodesk/neko/internal/types"
|
"demodesk/neko/internal/types"
|
||||||
"demodesk/neko/internal/utils"
|
"demodesk/neko/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MemberDataPayload struct {
|
type MemberDataPayload struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Profile types.MemberProfile `json:"profile"`
|
Profile types.MemberProfile `json:"profile"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MemberCreatePayload struct {
|
type MemberCreatePayload struct {
|
||||||
@ -65,7 +65,7 @@ func (h *MembersHandler) membersCreate(w http.ResponseWriter, r *http.Request) {
|
|||||||
CanAccessClipboard: true,
|
CanAccessClipboard: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if !utils.HttpJsonRequest(w, r, data) {
|
if !utils.HttpJsonRequest(w, r, data) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ func (h *MembersHandler) membersCreate(w http.ResponseWriter, r *http.Request) {
|
|||||||
utils.HttpInternalServerError(w, err)
|
utils.HttpInternalServerError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.HttpSuccess(w, MemberDataPayload{
|
utils.HttpSuccess(w, MemberDataPayload{
|
||||||
ID: id,
|
ID: id,
|
||||||
Profile: data.Profile,
|
Profile: data.Profile,
|
||||||
|
@ -61,7 +61,7 @@ func (provider *MemberProviderCtx) Insert(username string, password string, prof
|
|||||||
entries[id] = MemberEntry{
|
entries[id] = MemberEntry{
|
||||||
// TODO: Use hash function.
|
// TODO: Use hash function.
|
||||||
Password: password,
|
Password: password,
|
||||||
Profile: profile,
|
Profile: profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
return id, provider.serialize(entries)
|
return id, provider.serialize(entries)
|
||||||
|
@ -36,7 +36,7 @@ func New(sessions types.SessionManager, config *config.Member) *MemberManagerCtx
|
|||||||
default:
|
default:
|
||||||
manager.provider = dummy.New()
|
manager.provider = dummy.New()
|
||||||
}
|
}
|
||||||
|
|
||||||
return manager
|
return manager
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ func (provider *MemberProviderCtx) Insert(username string, password string, prof
|
|||||||
provider.entries[id] = &MemberEntry{
|
provider.entries[id] = &MemberEntry{
|
||||||
// TODO: Use hash function.
|
// TODO: Use hash function.
|
||||||
Password: password,
|
Password: password,
|
||||||
Profile: profile,
|
Profile: profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
return id, nil
|
return id, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user