fix: some api bug

This commit is contained in:
wwweww
2026-03-31 22:12:06 +08:00
parent c5ff4f0216
commit e7970ac25f
219 changed files with 16195 additions and 2126 deletions
@@ -4,17 +4,12 @@
package shop
import (
"errors"
"juwan-backend/common/utils/contextj"
"juwan-backend/common/utils/httpj"
"juwan-backend/common/utils/responses"
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"juwan-backend/app/shop/api/internal/logic/shop"
"juwan-backend/app/shop/api/internal/svc"
"juwan-backend/app/shop/api/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
// 接受邀请
@@ -26,12 +21,7 @@ func AcceptInvitationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return
}
userId, err := httpj.GetUserIdFromHeader(r.Header)
if err != nil {
httpx.ErrorCtx(r.Context(), w, responses.NewErrorResp(403, errors.New("forbidden: user not authenticated")))
}
ctx := contextj.WithUserID(r.Context(), userId)
l := shop.NewAcceptInvitationLogic(ctx, svcCtx)
l := shop.NewAcceptInvitationLogic(r.Context(), svcCtx)
resp, err := l.AcceptInvitation(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)