-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin.go
43 lines (32 loc) 路 1018 Bytes
/
admin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package route
import (
"encoding/json"
"github.com/airstrik/airstrik/src/service"
"github.com/airstrik/gobase/pkg/config"
error2 "github.com/airstrik/gobase/pkg/server/error"
"github.com/airstrik/gobase/pkg/utils"
"net/http"
)
type SignUp struct {
MobileNo string
EmailId string
FirstName string
LastName string
}
func SignUpMobile(w http.ResponseWriter, r *http.Request) {
ctx := r.Context().Value("AccountCtx").(*config.Context)
var signUp SignUp
err := json.NewDecoder(r.Body).Decode(&signUp)
utils.HandleCustomError(err, error2.JsonParseFailure)
user := service.CreateUserByMobileNo(ctx, signUp.MobileNo, signUp.FirstName, signUp.LastName)
json.NewEncoder(w).Encode(user)
}
func SignUpWithEmail(w http.ResponseWriter, r *http.Request) {
//Check is this Mobile No or EMail based Sign in
}
func SignUserNamePassword(w http.ResponseWriter, r *http.Request) {
}
func SignGoogle(w http.ResponseWriter, r *http.Request) {
}
func CallbackGoogle(w http.ResponseWriter, r *http.Request) {
}