info get profile

This commit is contained in:
eson
2023-09-28 13:25:06 +08:00
parent 31b712784f
commit d92c77766c
11 changed files with 81 additions and 278 deletions

View File

@@ -17,36 +17,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/api/user/fonts",
Handler: UserFontsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/api/user/get-type",
Handler: UserGetTypeHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/user/basic-info",
Handler: UserSaveBasicInfoHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/api/user/status-config",
Handler: UserStatusConfigHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/api/user/basic-info",
Handler: UserBasicInfoHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/api/user/address-list",
Handler: UserAddressListHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/user/add-address",
Handler: UserAddAddressHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/user/contact-service",

View File

@@ -1,35 +0,0 @@
package handler
import (
"net/http"
"reflect"
"fusenapi/utils/basic"
"fusenapi/server/home-user-auth/internal/logic"
"fusenapi/server/home-user-auth/internal/svc"
"fusenapi/server/home-user-auth/internal/types"
)
func UserAddAddressHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.RequestAddAddress
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewUserAddAddressLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.UserAddAddress(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)
}
}
}

View File

@@ -1,35 +0,0 @@
package handler
import (
"net/http"
"reflect"
"fusenapi/utils/basic"
"fusenapi/server/home-user-auth/internal/logic"
"fusenapi/server/home-user-auth/internal/svc"
"fusenapi/server/home-user-auth/internal/types"
)
func UserAddressListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewUserAddressListLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.UserAddressList(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)
}
}
}