From 8c28f3ba8b15309de5dbe6a90e427d697717aac9 Mon Sep 17 00:00:00 2001 From: optrader Date: Mon, 13 Oct 2025 18:31:51 +0900 Subject: [PATCH] =?UTF-8?q?[251013]=20chore(config):=20[251013]=20appinfo.?= =?UTF-8?q?webos.json=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 10. 13. 18:31:49 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 2๊ฐœ โ€ข ์ถ”๊ฐ€: +53์ค„ โ€ข ์‚ญ์ œ: -6์ค„ ๐Ÿ“ ์ถ”๊ฐ€๋œ ํŒŒ์ผ: + com.twin.app.shoptime/webos-meta/appinfo.webos.json ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/hooks/useReviews/useReviews.js ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ํ•ต์‹ฌ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ๊ฐœ์„  โ€ข ์†Œ๊ทœ๋ชจ ๊ธฐ๋Šฅ ๊ฐœ์„  --- .../src/hooks/useReviews/useReviews.js | 59 +++++++++++++++++-- .../webos-meta/appinfo.webos.json | 29 +++++++++ 2 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 com.twin.app.shoptime/webos-meta/appinfo.webos.json diff --git a/com.twin.app.shoptime/src/hooks/useReviews/useReviews.js b/com.twin.app.shoptime/src/hooks/useReviews/useReviews.js index 7eec359c..83706b21 100644 --- a/com.twin.app.shoptime/src/hooks/useReviews/useReviews.js +++ b/com.twin.app.shoptime/src/hooks/useReviews/useReviews.js @@ -232,8 +232,40 @@ const useReviews = (prdtId, patnrId) => { }; } + // ๋ณ„์ ์ด ์—†๋Š” ๋ฆฌ๋ทฐ๋“ค ์ฐพ๊ธฐ + const noStarReviews = allReviews.filter((review) => { + const rating = review.rvwScr || review.rvwRtng || review.rating; + return !rating || rating === 0; + }); + + // ๋ณ„์ ์ด ์—†๋Š” ๋ฆฌ๋ทฐ๋“ค ๋กœ๊ทธ ์ถœ๋ ฅ + if (noStarReviews.length > 0) { + console.log('[UserReviews]-NoStar ๋ณ„์  ์—†๋Š” ๋ฆฌ๋ทฐ๋“ค:', { + totalReviews: allReviews.length, + noStarCount: noStarReviews.length, + noStarReviews: noStarReviews.map((review) => ({ + rvwId: review.rvwId, + rvwScr: review.rvwScr, + rvwRtng: review.rvwRtng, + rating: review.rating, + rvwCtnt: review.rvwCtnt?.substring(0, 50) + '...', + wrtrNknm: review.wrtrNknm, + })), + }); + } + + // ๋ณ„์ ์ด ์žˆ๋Š” ๋ฆฌ๋ทฐ๋งŒ ์นด์šดํŠธ (1~5์ ) + let ratingSum = 0; + for (let i = 1; i <= 5; i++) { + const count = allReviews.filter((review) => { + const rating = review.rvwScr || review.rvwRtng || review.rating || 0; + return Math.round(rating) === i; + }).length; + ratingSum += count; + } + const counts = { - rating: { all: allReviews.length }, + rating: { all: ratingSum }, // ๋ณ„์ ์ด ์žˆ๋Š” ๋ฆฌ๋ทฐ๋งŒ ์นด์šดํŠธ keyword: {}, sentiment: {}, }; @@ -290,7 +322,11 @@ const useReviews = (prdtId, patnrId) => { switch (currentFilter.type) { case 'rating': if (currentFilter.value === 'all' || currentFilter.value === null) { - result = [...allReviews]; // ์ „์ฒด ํ‘œ์‹œ + // 'all' ํ•„ํ„ฐ: ๋ณ„์ ์ด ์žˆ๋Š” ๋ฆฌ๋ทฐ๋งŒ ํ‘œ์‹œ (๋ณ„์  ์—†๋Š” ๋ฆฌ๋ทฐ ์ œ์™ธ) + result = allReviews.filter((review) => { + const rating = review.rvwScr || review.rvwRtng || review.rating; + return rating && rating > 0; + }); } else { result = allReviews.filter((review) => { const rating = review.rvwScr || review.rvwRtng || review.rating || 0; @@ -498,9 +534,21 @@ const useReviews = (prdtId, patnrId) => { // ํ†ต๊ณ„ ์ •๋ณด const stats = useMemo(() => { + // API์™€ ์‹ค์ œ ๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜ ๋ถˆ์ผ์น˜ ํ™•์ธ + const apiTotalCount = reviewDetail && reviewDetail.totRvwCnt ? reviewDetail.totRvwCnt : 0; + const actualReviewCount = allReviews.length; + + if (apiTotalCount > actualReviewCount && actualReviewCount > 0) { + console.log('[UserReviews]-API Mismatch API ๊ฐœ์ˆ˜์™€ ์‹ค์ œ ๊ฐœ์ˆ˜ ๋ถˆ์ผ์น˜:', { + apiTotalCount, + actualReviewCount, + difference: apiTotalCount - actualReviewCount, + reason: 'API๊ฐ€ ์ตœ๋Œ€ 100๊ฐœ๋งŒ ๋ฐ˜ํ™˜ํ•˜๋Š” ํŽ˜์ด์ง• ์ œํ•œ', + }); + } + return { - totalReviews: - reviewDetail && reviewDetail.totRvwCnt ? reviewDetail.totRvwCnt : allReviews.length, // ์ „์ฒด ๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜ + totalReviews: actualReviewCount, // ์‹ค์ œ๋กœ ๋ฐ›์€ ๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜ ์‚ฌ์šฉ (API ์ œํ•œ ๋ฐ˜์˜) filteredCount: filteredReviews.length, // ํ•„ํ„ฐ๋ง๋œ ๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜ displayedCount: displayReviews.length, // ํ˜„์žฌ ํ‘œ์‹œ ์ค‘์ธ ๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜ averageRating: @@ -509,8 +557,7 @@ const useReviews = (prdtId, patnrId) => { : reviewDetail && reviewDetail.avgRvwScr ? reviewDetail.avgRvwScr : 0, - totalRatingCount: - reviewDetail && reviewDetail.totRvwCnt ? reviewDetail.totRvwCnt : allReviews.length, + totalRatingCount: actualReviewCount, // ์‹ค์ œ๋กœ ๋ฐ›์€ ๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜ ์‚ฌ์šฉ }; }, [allReviews.length, filteredReviews.length, displayReviews.length, reviewDetail]); diff --git a/com.twin.app.shoptime/webos-meta/appinfo.webos.json b/com.twin.app.shoptime/webos-meta/appinfo.webos.json new file mode 100644 index 00000000..70d0755f --- /dev/null +++ b/com.twin.app.shoptime/webos-meta/appinfo.webos.json @@ -0,0 +1,29 @@ +{ + "id": "com.twin.voiceapp", + "version": "1.0", + "vendor": "T-Win", + "type": "web", + "main": "index.html", + "title": "Voice Auto App", + "icon": "icon.png", + "largeIcon": "largeIcon.png", + "handlesRelaunch": true, + "requiredPermissions": [ + "time.query", + "device.info", + "applications.query", + "settings.read", + "applications.operation" + ], + "inAppVoiceIntent": { + "contentTarget": { + "intent": "$INTENT", + "intentParam": "$INTENT_PARAM", + "languageCode": "$LANG_CODE" + }, + "voiceConfig": { + "supportedIntent": ["UseIME", "SearchContent"], + "supportedVoiceLanguage": ["ko-KR", "en-US"] + } + } + } \ No newline at end of file