🏗️ microservice fabric splitting
This commit is contained in:
28
app/auth/api/internal/handler/oauth/qq_callback_handler.go
Normal file
28
app/auth/api/internal/handler/oauth/qq_callback_handler.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package oauth
|
||||
|
||||
import (
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"net/http"
|
||||
"schisandra-album-cloud-microservices/app/auth/api/internal/logic/oauth"
|
||||
"schisandra-album-cloud-microservices/app/auth/api/internal/svc"
|
||||
"schisandra-album-cloud-microservices/app/auth/api/internal/types"
|
||||
"schisandra-album-cloud-microservices/common/xhttp"
|
||||
)
|
||||
|
||||
func QqCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.OAuthCallbackRequest
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := oauth.NewQqCallbackLogic(r.Context(), svcCtx)
|
||||
data, err := l.QqCallback(r, &req)
|
||||
if err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
} else {
|
||||
xhttp.OkHTML(w, data)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user