|
|
@@ -3,15 +3,24 @@ package com.style24.front.support.interceptor;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
|
|
|
|
|
+import com.style24.front.biz.service.TsfGoodsService;
|
|
|
+import com.style24.front.support.env.TsfConstants;
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
+import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.gagaframework.web.parameter.GagaParameterUtil;
|
|
|
+import com.gagaframework.web.util.GagaCookieUtil;
|
|
|
+
|
|
|
/**
|
|
|
* 상품뷰 Interceptor
|
|
|
- *
|
|
|
+ *
|
|
|
* @author gagamel
|
|
|
* @since 2020. 9. 11
|
|
|
*/
|
|
|
@@ -19,37 +28,37 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
@Slf4j
|
|
|
public class TsfGoodsViewInterceptor extends HandlerInterceptorAdapter {
|
|
|
|
|
|
-// @Value("${has-ssl}")
|
|
|
-// private String hasSsl;
|
|
|
+ @Value("${has-ssl}")
|
|
|
+ private String hasSsl;
|
|
|
|
|
|
-// @Autowired
|
|
|
-// private WfoGoodsService goodsService;
|
|
|
+ @Autowired
|
|
|
+ private TsfGoodsService goodsService;
|
|
|
|
|
|
@Override
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
|
-// // Parameter
|
|
|
-// GagaMap params = GagaParameterUtil.getParameterMap(request);
|
|
|
-//
|
|
|
-// // 상품뷰이력 생성
|
|
|
-// goodsService.createGoodsViewHistory(params.getString("goodsCd"), params.getString("ithrCd"));
|
|
|
-//
|
|
|
-// // SSL Server
|
|
|
-// boolean isSslServer = Boolean.parseBoolean(hasSsl);
|
|
|
-// log.debug("isSslServer: [{}]", isSslServer);
|
|
|
-//
|
|
|
-// if (isSslServer) {
|
|
|
-// // 상품유입경로 쿠키 설정
|
|
|
-// GagaCookieUtil.setSecureCookie(response, FoConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
|
|
|
-//
|
|
|
-// // 컨텐츠위치코드 쿠키 설정
|
|
|
-// GagaCookieUtil.setSecureCookie(response, FoConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
|
|
|
-// } else {
|
|
|
-// // 상품유입경로 쿠키 설정
|
|
|
-// GagaCookieUtil.setCookie(response, FoConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
|
|
|
-//
|
|
|
-// // 컨텐츠위치코드 쿠키 설정
|
|
|
-// GagaCookieUtil.setCookie(response, FoConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
|
|
|
-// }
|
|
|
+ // Parameter
|
|
|
+ GagaMap params = GagaParameterUtil.getParameterMap(request);
|
|
|
+
|
|
|
+ // 상품뷰이력 생성
|
|
|
+ goodsService.createGoodsViewHst(params.getString("goodsCd"), params.getString("ithrCd"));
|
|
|
+
|
|
|
+ // SSL Server
|
|
|
+ boolean isSslServer = Boolean.parseBoolean(hasSsl);
|
|
|
+ log.debug("isSslServer: [{}]", isSslServer);
|
|
|
+
|
|
|
+ if (isSslServer) {
|
|
|
+ // 상품유입경로 쿠키 설정
|
|
|
+ GagaCookieUtil.setSecureCookie(response, TsfConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
|
|
|
+
|
|
|
+ // 컨텐츠위치코드 쿠키 설정
|
|
|
+ GagaCookieUtil.setSecureCookie(response, TsfConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
|
|
|
+ } else {
|
|
|
+ // 상품유입경로 쿠키 설정
|
|
|
+ GagaCookieUtil.setCookie(response, TsfConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
|
|
|
+
|
|
|
+ // 컨텐츠위치코드 쿠키 설정
|
|
|
+ GagaCookieUtil.setCookie(response, TsfConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
|
|
|
+ }
|
|
|
|
|
|
return super.preHandle(request, response, handler);
|
|
|
}
|