mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
494 B
Go
28 lines
494 B
Go
package user
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"oa/errs"
|
|
|
|
"oa/internal/logic/user"
|
|
"oa/internal/svc"
|
|
"oa/internal/types"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
)
|
|
|
|
func RegHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
var req types.RegReq
|
|
if err := httpx.Parse(r, &req); err != nil {
|
|
errs.Response(w, nil, err)
|
|
return
|
|
}
|
|
|
|
l := user.NewRegLogic(r.Context(), svcCtx)
|
|
err := l.Reg(&req)
|
|
errs.Response(w, nil, err)
|
|
}
|
|
}
|