This commit is contained in:
laodaming
2023-06-14 16:04:43 +08:00
parent 83e45f26b2
commit f7da17778e
5 changed files with 12 additions and 10 deletions

View File

@@ -7,14 +7,16 @@ import (
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
"fusenapi/utils/auth"
"fusenapi/utils/basic"
"fusenapi/server/map_library/internal/logic"
"fusenapi/server/map_library/internal/svc"
"fusenapi/utils/auth"
)
func GetMapLibraryListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
/*// 解析jwtToken
// 解析jwtToken
claims, err := svcCtx.ParseJwtToken(r)
// 如果解析出错则返回未授权的JSON响应并记录错误消息
if err != nil {
@@ -36,10 +38,10 @@ func GetMapLibraryListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
})
logx.Info("unauthorized:", err.Error())
return
}*/
}
l := logic.NewGetMapLibraryListLogic(r.Context(), svcCtx)
resp := l.GetMapLibraryList(&auth.UserInfo{86})
resp := l.GetMapLibraryList(userinfo)
// 如果响应不为nil则使用httpx.OkJsonCtx方法返回JSON响应;
// 否则发送500内部服务器错误的JSON响应并记录错误消息logx.Error。
if resp != nil {