통합로그 API
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
import React, { useCallback, useEffect, useRef } from "react";
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
} from 'react';
|
||||
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
useDispatch,
|
||||
useSelector,
|
||||
} from 'react-redux';
|
||||
|
||||
import platform from "@enact/core/platform";
|
||||
import { Job } from "@enact/core/util";
|
||||
import ThemeDecorator from "@enact/sandstone/ThemeDecorator";
|
||||
import Spotlight from "@enact/spotlight";
|
||||
import platform from '@enact/core/platform';
|
||||
import { Job } from '@enact/core/util';
|
||||
import ThemeDecorator from '@enact/sandstone/ThemeDecorator';
|
||||
import Spotlight from '@enact/spotlight';
|
||||
|
||||
import appinfo from "../../webos-meta/appinfo.json";
|
||||
import appinfo from '../../webos-meta/appinfo.json';
|
||||
import {
|
||||
changeAppStatus,
|
||||
checkFirstLaunch,
|
||||
@@ -21,26 +28,34 @@ import {
|
||||
setDeepLink,
|
||||
setGNBMenu,
|
||||
setSecondLayerInfo,
|
||||
} from "../actions/commonActions";
|
||||
import { getShoptimeTerms } from "../actions/empActions";
|
||||
import { getHomeMenu, getHomeTerms } from "../actions/homeActions";
|
||||
} from '../actions/commonActions';
|
||||
import { getShoptimeTerms } from '../actions/empActions';
|
||||
import {
|
||||
getHomeMenu,
|
||||
getHomeTerms,
|
||||
} from '../actions/homeActions';
|
||||
import {
|
||||
getMyRecommandedKeyword,
|
||||
getMyUpcomingAlertShow,
|
||||
} from "../actions/myPageActions";
|
||||
import { pushPanel } from "../actions/panelActions";
|
||||
import NotSupportedVersion from "../components/NotSupportedVersion/NotSupportedVersion";
|
||||
import usePrevious from "../hooks/usePrevious";
|
||||
import { lunaTest } from "../lunaSend/lunaTest";
|
||||
import { store } from "../store/store";
|
||||
import * as Config from "../utils/Config";
|
||||
import { $L, clearLaunchParams, getLaunchParams } from "../utils/helperMethods";
|
||||
import { SpotlightIds } from "../utils/SpotlightIds";
|
||||
import ErrorBoundary from "../views/ErrorBoundary";
|
||||
import MainView from "../views/MainView/MainView";
|
||||
import css from "./App.module.less";
|
||||
import { handleBypassLink } from "./bypassLinkHandler";
|
||||
import { handleDeepLink } from "./deepLinkHandler";
|
||||
} from '../actions/myPageActions';
|
||||
import { pushPanel } from '../actions/panelActions';
|
||||
import NotSupportedVersion
|
||||
from '../components/NotSupportedVersion/NotSupportedVersion';
|
||||
import usePrevious from '../hooks/usePrevious';
|
||||
import { lunaTest } from '../lunaSend/lunaTest';
|
||||
import { store } from '../store/store';
|
||||
import * as Config from '../utils/Config';
|
||||
import {
|
||||
$L,
|
||||
clearLaunchParams,
|
||||
getLaunchParams,
|
||||
} from '../utils/helperMethods';
|
||||
import { SpotlightIds } from '../utils/SpotlightIds';
|
||||
import ErrorBoundary from '../views/ErrorBoundary';
|
||||
import MainView from '../views/MainView/MainView';
|
||||
import css from './App.module.less';
|
||||
import { handleBypassLink } from './bypassLinkHandler';
|
||||
import { handleDeepLink } from './deepLinkHandler';
|
||||
|
||||
let foreGroundChangeTimer = null;
|
||||
|
||||
@@ -372,10 +387,8 @@ function AppBase(props) {
|
||||
}, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (macAddress) {
|
||||
console.log("#macAddress", macAddress);
|
||||
}
|
||||
}, [macAddress]);
|
||||
console.log("#introTermsAgree", introTermsAgree);
|
||||
}, [introTermsAgree]);
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import { URLS } from "../api/apiConfig";
|
||||
import { TLogEvent } from "../api/TLogEvent";
|
||||
import { LOG_MENU, LOG_TP_NO } from "../utils/Config";
|
||||
import { URLS } from '../api/apiConfig';
|
||||
import { TLogEvent } from '../api/TLogEvent';
|
||||
import {
|
||||
LOG_MENU,
|
||||
LOG_TP_NO,
|
||||
} from '../utils/Config';
|
||||
import {
|
||||
formatGMTString,
|
||||
getTimeDifferenceByMilliseconds,
|
||||
} from "../utils/helperMethods";
|
||||
import { setGNBMenu, setSecondLayerInfo } from "./commonActions";
|
||||
} from '../utils/helperMethods';
|
||||
import {
|
||||
setGNBMenu,
|
||||
setSecondLayerInfo,
|
||||
} from './commonActions';
|
||||
|
||||
export const getUrlByLogTpNo = (logTpNo) => {
|
||||
switch (logTpNo) {
|
||||
@@ -149,12 +155,26 @@ export const getUrlByLogTpNo = (logTpNo) => {
|
||||
// IF-LGSP-LOG-112 / Check out 화면 버튼 클릭 이력
|
||||
case LOG_TP_NO.CHECKOUT_BTN_CLICK:
|
||||
return URLS.LOG_CHECKOUT_BTN_CLICK;
|
||||
case LOG_TP_NO.TOTAL_RECOMMEND:
|
||||
return URLS.LOG_TOTAL_RECOMMEND;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
export const postTotalLog = (params) => (dispatch, getState) => {
|
||||
const onSuccess = (response) => {
|
||||
console.log("Total Log onSuccess.....", response);
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
console.error("totalLog onFail...", error);
|
||||
};
|
||||
|
||||
TLogEvent(dispatch, getState, "post", {}, params, onSuccess, onFail);
|
||||
};
|
||||
|
||||
export const postLog = (params, url) => (dispatch, getState) => {
|
||||
const { logTpNo } = params;
|
||||
|
||||
@@ -1564,3 +1584,22 @@ export const sendLogCheckOutBtnClick = (params) => (dispatch, getState) => {
|
||||
|
||||
dispatch(postLog(newParams));
|
||||
};
|
||||
|
||||
// IF-LGSP-LOG-200 / 통합 추천 로그
|
||||
|
||||
export const sendLogTotalRecommend = (params) => (dispatch, getState) => {
|
||||
const { entryMenu } = getState().common.menu;
|
||||
const { macAddress } = getState().common.macAddress;
|
||||
|
||||
const introTermsAgree = getState().common.introTermsAgree;
|
||||
const deviceEulaFlag = introTermsAgree ? "Y" : "N";
|
||||
|
||||
const newParams = {
|
||||
...params,
|
||||
macAddr: macAddress.wired ? macAddress.wired : macAddress.wifi,
|
||||
deviceEulaFlag: deviceEulaFlag,
|
||||
entryMenu: entryMenu,
|
||||
};
|
||||
|
||||
dispatch(postTotalLog(newParams));
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import axios from 'axios';
|
||||
|
||||
import { getUrl } from "./apiConfig";
|
||||
import { createQueryString } from "../utils/helperMethods";
|
||||
import { createQueryString } from '../utils/helperMethods';
|
||||
import { getUrl } from './apiConfig';
|
||||
|
||||
export const TLogEvent = (
|
||||
dispatch,
|
||||
@@ -21,6 +21,12 @@ export const TLogEvent = (
|
||||
const { deviceId: dvcId } = appStatus;
|
||||
const dvcTp = "tv";
|
||||
|
||||
console.log("#cntry_c", cntryCd);
|
||||
console.log("#play_cd", platCd);
|
||||
console.log("#prodCd", prodCd);
|
||||
|
||||
console.log("#AUTH", AUTHORIZATION);
|
||||
|
||||
if (typeof window === "object") {
|
||||
let url = Array.isArray(baseUrl)
|
||||
? getUrl(getState, baseUrl[0])
|
||||
|
||||
@@ -233,6 +233,9 @@ export const URLS = {
|
||||
|
||||
// IF-LGSP-LOG-112 log checkout btn click controller
|
||||
LOG_CHECKOUT_BTN_CLICK: "/lgsp/v1/log/checkout/btnClick.lge",
|
||||
|
||||
// IF-LGSP-LOG-200
|
||||
LOG_TOTAL_RECOMMEND: "/lgsp/v1/log/recommend.lge",
|
||||
};
|
||||
|
||||
export let countryCode = "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { $L } from "./helperMethods";
|
||||
import { $L } from './helperMethods';
|
||||
|
||||
export const SUPPORT_COUNTRIES = { US: "en", DE: "de", UK: "uk", RU: "ru" };
|
||||
|
||||
@@ -247,6 +247,9 @@ export const LOG_TP_NO = {
|
||||
|
||||
// IF-LGSP-LOG-112 / Check out 화면 버튼 클릭 이력
|
||||
CHECKOUT_BTN_CLICK: "902",
|
||||
|
||||
// IF-LGSP-LOG-200 / 통합 추천 로그
|
||||
TOTAL_RECOMMEND: "606",
|
||||
};
|
||||
|
||||
// TV log update
|
||||
|
||||
Reference in New Issue
Block a user