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

27 lines
503 B
Go

package app
import (
"net/http"
"oa/errs"
"github.com/zeromicro/go-zero/rest/httpx"
"oa/internal/logic/app"
"oa/internal/svc"
"oa/internal/types"
)
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
}
l := app.NewLoginLogic(r.Context(), svcCtx)
resp, err := l.Login(&req)
errs.Response(w, resp, err)
}
}