first commit
This commit is contained in:
30
apps/gateway/internal/handler/user/enterpriseauthhandler.go
Normal file
30
apps/gateway/internal/handler/user/enterpriseauthhandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"tianyuan-api/apps/gateway/internal/logic/user"
|
||||
"tianyuan-api/apps/gateway/internal/svc"
|
||||
"tianyuan-api/apps/gateway/internal/types"
|
||||
|
||||
xhttp "github.com/zeromicro/x/http"
|
||||
)
|
||||
|
||||
func EnterpriseAuthHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.EnterpriseAuthReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewEnterpriseAuthLogic(r.Context(), svcCtx)
|
||||
err := l.EnterpriseAuth(&req)
|
||||
if err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
} else {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
21
apps/gateway/internal/handler/user/getsecretinfohandler.go
Normal file
21
apps/gateway/internal/handler/user/getsecretinfohandler.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
xhttp "github.com/zeromicro/x/http"
|
||||
"tianyuan-api/apps/gateway/internal/logic/user"
|
||||
"tianyuan-api/apps/gateway/internal/svc"
|
||||
)
|
||||
|
||||
func GetSecretInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := user.NewGetSecretInfoLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetSecretInfo()
|
||||
if err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
} else {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
21
apps/gateway/internal/handler/user/getuserinfohandler.go
Normal file
21
apps/gateway/internal/handler/user/getuserinfohandler.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
xhttp "github.com/zeromicro/x/http"
|
||||
"tianyuan-api/apps/gateway/internal/logic/user"
|
||||
"tianyuan-api/apps/gateway/internal/svc"
|
||||
)
|
||||
|
||||
func GetUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := user.NewGetUserInfoLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetUserInfo()
|
||||
if err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
} else {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
xhttp "github.com/zeromicro/x/http"
|
||||
"tianyuan-api/apps/gateway/internal/logic/user"
|
||||
"tianyuan-api/apps/gateway/internal/svc"
|
||||
)
|
||||
|
||||
func UploadBusinessLicenseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := user.NewUploadBusinessLicenseLogic(r.Context(), svcCtx)
|
||||
resp, err := l.UploadBusinessLicense(r)
|
||||
if err != nil {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
||||
} else {
|
||||
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user