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.
OneAuth/oa/internal/handler/app/loginhandler.go

30 lines
541 B
Go

package app
import (
1 month ago
"fmt"
"net/http"
"oa/errs"
"oa/internal/logic/app"
"oa/internal/svc"
"oa/internal/types"
1 month ago
"github.com/zeromicro/go-zero/rest/httpx"
)
func LoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.AppReq
if err := httpx.Parse(r, &req); err != nil {
errs.Response(w, nil, err)
return
}
1 month ago
fmt.Printf("\n|%v|\n", req)
l := app.NewLoginLogic(r.Context(), svcCtx)
resp, err := l.Login(&req)
errs.Response(w, resp, err)
}
}