Files
shoptime/com.twin.app.shoptime/src/actions/brandActions.js
optrader 741c4338ca [251124] fix: Log정리-5
🕐 커밋 시간: 2025. 11. 24. 12:43:58

📊 변경 통계:
  • 총 파일: 40개
  • 추가: +774줄
  • 삭제: -581줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/actions/appDataActions.js
  ~ com.twin.app.shoptime/src/actions/billingActions.js
  ~ com.twin.app.shoptime/src/actions/brandActions.js
  ~ com.twin.app.shoptime/src/actions/cancelActions.js
  ~ com.twin.app.shoptime/src/actions/cardActions.js
  ~ com.twin.app.shoptime/src/actions/cartActions.js
  ~ com.twin.app.shoptime/src/actions/checkoutActions.js
  ~ com.twin.app.shoptime/src/actions/commonActions.js
  ~ com.twin.app.shoptime/src/actions/convertActions.js
  ~ com.twin.app.shoptime/src/actions/couponActions.js
  ~ com.twin.app.shoptime/src/actions/deviceActions.js
  ~ com.twin.app.shoptime/src/actions/empActions.js
  ~ com.twin.app.shoptime/src/actions/eventActions.js
  ~ com.twin.app.shoptime/src/actions/forYouActions.js
  ~ com.twin.app.shoptime/src/actions/homeActions.js
  ~ com.twin.app.shoptime/src/actions/logActions.js
  ~ com.twin.app.shoptime/src/actions/mediaActions.js
  ~ com.twin.app.shoptime/src/actions/mockCartActions.js
  ~ com.twin.app.shoptime/src/actions/myPageActions.js
  ~ com.twin.app.shoptime/src/actions/onSaleActions.js
  ~ com.twin.app.shoptime/src/actions/orderActions.js
  ~ com.twin.app.shoptime/src/actions/panelActions.js
  ~ com.twin.app.shoptime/src/actions/panelNavigationActions.js
  ~ com.twin.app.shoptime/src/actions/pinCodeActions.js
  ~ com.twin.app.shoptime/src/actions/productActions.js
  ~ com.twin.app.shoptime/src/actions/queuedPanelActions.js
  ~ com.twin.app.shoptime/src/actions/searchActions.js
  ~ com.twin.app.shoptime/src/actions/shippingActions.js
  ~ com.twin.app.shoptime/src/actions/voiceActions.js
  ~ com.twin.app.shoptime/src/actions/webSpeechActions.js
  ~ com.twin.app.shoptime/src/reducers/localSettingsReducer.js
  ~ com.twin.app.shoptime/src/reducers/mediaOverlayReducer.js
  ~ com.twin.app.shoptime/src/reducers/mockCartReducer.js
  ~ com.twin.app.shoptime/src/reducers/playReducer.js
  ~ com.twin.app.shoptime/src/reducers/productReducer.js
  ~ com.twin.app.shoptime/src/reducers/videoOverlayReducer.js
  ~ com.twin.app.shoptime/src/views/UserReview/ShowUserReviews.jsx
  ~ com.twin.app.shoptime/src/views/UserReview/UserReviewPanel.jsx
  ~ com.twin.app.shoptime/src/views/UserReview/components/UserReviewsList.jsx
  ~ com.twin.app.shoptime/src/views/UserReview/components/VirtualScrollBar.jsx

🔧 함수 변경 내용:
  📊 Function-level changes summary across 40 files:
    • Functions added: 14
    • Functions modified: 34
    • Functions deleted: 18
  📋 By language:
    • javascript: 40 files, 66 function changes

🔧 주요 변경 내용:
  • 핵심 비즈니스 로직 개선
  • 로깅 시스템 개선
  • 설정 관리 시스템 개선
  • UI 컴포넌트 아키텍처 개선
2025-11-24 12:47:57 +09:00

472 lines
12 KiB
JavaScript

import { URLS } from '../api/apiConfig';
import { TAxios } from '../api/TAxios';
import { types } from './actionTypes';
import { changeAppStatus } from './commonActions';
import { createDebugHelpers } from '../utils/debug';
// 디버그 헬퍼 설정
const DEBUG_MODE = false;
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
// Featured Brands 정보 조회 IF-LGSP-304
export const getBrandList = () => (dispatch, getState) => {
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandList onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_LIST,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandList onFail', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_LIST, {}, {}, onSuccess, onFail);
};
// Featured Brands LAYOUT (shelf) 정보 조회 IF-LGSP-305
export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandLayoutInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_LAYOUT_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandLayoutInfo onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_LAYOUT_INFO, { patnrId }, {}, onSuccess, onFail);
};
// Featured Brands Live 채널 정보 조회 IF-LGSP-306
export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandLiveChannelInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_LIVE_CHANNEL_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandLiveChannelInfo onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
{ patnrId },
{},
onSuccess,
onFail
);
};
export const getBrandChanInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
const onSuccess = (response) => {
// dlog("getBrandChanInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CHAN_INFO,
payload: {
data: response.data.data,
},
});
};
const onFail = (error) => {
derror('getBrandChanInfo onFail ', error);
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
{ patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brands Today's Deals 정보 조회 IF-LGSP-307
export const getBrandTSVInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandTSVInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_TSV_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandTSVInfo onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_TSV_INFO, { patnrId }, {}, onSuccess, onFail);
};
// Featured Brand Recommended Show 정보 조회 IF-LGSP-308
export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
const { catCd, patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandRecommendedShowInfo onSuccess", response.data);
dispatch({
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandRecommendedShowInfo onFail', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_RECOMMENDED_SHOW_INFO,
{ catCd, patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brands Featured Creators 정보 조회 IF-LGSP-309
export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
const { hstNm, patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandCreatorsInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CREATORS_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandCreatorsInfo onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_CREATORS_INFO,
{ hstNm, patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brands Series 정보 조회 IF-LGSP-310
export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
const { patnrId, seriesId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandSeriesInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_SERIES_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandSeriesInfo onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_SERIES_INFO,
{ patnrId, seriesId },
{},
onSuccess,
onFail
);
};
// Featured Brands 카테고리별 상품 조회 IF-LGSP-311
export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
const { catCdLv1, catCdLv2, patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandCategoryInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CATEGORY_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
derror('getBrandCategoryInfo onFail ', error);
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_CATEGORY_INFO,
{ catCdLv1, catCdLv2, patnrId },
{},
onSuccess,
onFail
);
};
export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
const { catCdLv1, catCdLv2, patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandCategoryProductInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CATEGORY_PRODUCT_INFO,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandCategoryProductInfo onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_CATEGORY_INFO,
{ catCdLv1, catCdLv2, patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brand Best Seller 상품 목록 조회 IF-LGSP-312
export const getBrandBestSeller = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandBestSeller onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_BEST_SELLER,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandBestSeller onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_BEST_SELLER, { patnrId }, {}, onSuccess, onFail);
};
// Featured Brands Showroom 조회 IF-LGSP-372
export const getBrandShowroom = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
const onSuccess = (response) => {
// dlog("getBrandShowroom onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_SHOWROOM,
payload: {
data: response.data.data,
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
derror('getBrandShowroom onFail ', error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_SHOWROOM, { patnrId }, {}, onSuccess, onFail);
};
// Featured Brands Recently Aired 조회 IF-LGSP-373
export const getBrandRecentlyAired = (props) => (dispatch, getState) => {
const { patnrId } = props;
const onSuccess = (response) => {
// dlog("getBrandRecentlyAired onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_RECENTLY_AIRED,
payload: {
data: response.data.data,
},
});
};
const onFail = (error) => {
derror('getBrandRecentlyAired onFail ', error);
// dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
dispatch,
getState,
'get',
URLS.GET_BRAND_RECENTLY_AIRED,
{ patnrId },
{},
onSuccess,
onFail
);
};
export const setBrandLiveChannelUpcoming = (props) => (dispatch, getState) => {
const { showId, strtDt } = props;
const storedBrandLiveChannelUpcoming =
getState().brand.brandLiveChannelInfoData.data.brandLiveChannelUpcoming;
const brandLiveChannelUpcoming = storedBrandLiveChannelUpcoming //
.map((item) => {
if (item.showId === showId && item.strtDt === strtDt) {
item.alamDispFlag = item.alamDispFlag === 'Y' ? 'N' : 'Y';
}
return item;
});
dispatch({
type: types.SET_BRAND_LIVE_CHANNEL_UPCOMING,
payload: {
...getState().brand.brandLiveChannelInfoData,
data: {
...getState().brand.brandLiveChannelInfoData.data,
brandLiveChannelUpcoming,
},
},
});
};
export const setBrandChanInfo = (props) => (dispatch, getState) => {
const { showId, strtDt } = props;
const storedBrandLiveChanInfo = getState().brand.brandLiveChannelInfoData.data.brandChanInfo;
const brandChanInfo = storedBrandLiveChanInfo.map((item) => {
if (item.showId === showId && item.strtDt === strtDt) {
item.alamDispFlag = item.alamDispFlag === 'Y' ? 'N' : 'Y';
}
return item;
});
dispatch({
type: types.SET_BRAND_CHAN_INFO,
payload: {
...getState().brand.brandLiveChannelInfoData,
data: {
...getState().brand.brandLiveChannelInfoData.data,
brandChanInfo,
},
},
});
};