Bladeren bron

GNB 검색키워드 추가

bin2107 4 jaren geleden
bovenliggende
commit
3a7dcfb621

+ 11 - 0
src/main/java/com/style24/front/biz/dao/TsfDisplayDao.java

@@ -16,6 +16,7 @@ import com.style24.persistence.domain.GnbTab;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.MainLayout;
 import com.style24.persistence.domain.Popup;
+import com.style24.persistence.domain.SearchKeyword;
 import com.style24.persistence.domain.searchengine.Filter;
 import com.style24.persistence.domain.searchengine.SearchEngine;
 
@@ -235,4 +236,14 @@ public interface TsfDisplayDao {
 	 * @since 2021. 4. 14
 	 */
 	Collection<Contents> getGnbTabBannerList(Contents contents);
+
+	/**
+	 * 검색키워드 조회
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author bin2107
+	 * @since 2021. 7. 2
+	 */
+	Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword);
 }

+ 23 - 11
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -3,17 +3,6 @@ package com.style24.front.biz.service;
 import java.util.ArrayList;
 import java.util.Collection;
 
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.stereotype.Service;
-
-import com.style24.core.biz.service.TscEnvsetService;
-import com.style24.core.support.env.TscConstants;
-import com.style24.front.biz.dao.TsfDisplayDao;
-import com.style24.front.biz.dao.TsfGoodsDao;
-import com.style24.front.support.env.TsfConstants;
-import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.BrandGroup;
 import com.style24.persistence.domain.Cate1;
 import com.style24.persistence.domain.Cate2;
@@ -28,6 +17,18 @@ import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.Login;
 import com.style24.persistence.domain.MainLayout;
 import com.style24.persistence.domain.Popup;
+import com.style24.persistence.domain.SearchKeyword;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+
+import com.style24.core.biz.service.TscEnvsetService;
+import com.style24.core.support.env.TscConstants;
+import com.style24.front.biz.dao.TsfDisplayDao;
+import com.style24.front.biz.dao.TsfGoodsDao;
+import com.style24.front.support.env.TsfConstants;
+import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.searchengine.Filter;
 import com.style24.persistence.domain.searchengine.SearchEngine;
 
@@ -842,4 +843,15 @@ public class TsfDisplayService {
 		return goodsDao.getContentsCategoryGoodsCount(cate4Srch);
 	}
 
+	/**
+	 * 검색키워드 조회
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author bin2107
+	 * @since 2021. 7. 2
+	 */
+	public Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword) {
+		return displayDao.getSearchKeywordList(searchKeyword);
+	}
 }

+ 14 - 0
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -54,6 +54,7 @@ import com.style24.persistence.domain.searchengine.Filter;
 import com.style24.persistence.domain.searchengine.GoodsListResponse;
 import com.style24.persistence.domain.searchengine.PlanningResponse;
 import com.style24.persistence.domain.searchengine.SearchEngine;
+import com.style24.persistence.domain.SearchKeyword;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -1192,4 +1193,17 @@ public class TsfDisplayController extends TsfBaseController {
 		return eigeneaiApi.getWeeklySellBestGoodsList(30);
 	}
 
+	/**
+	 * 검색키워드 조회
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author bin2107
+	 * @since 2021. 7. 2
+	 */
+	@GetMapping("/search/keyword/list")
+	@ResponseBody
+	public Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword) {
+		return displayService.getSearchKeywordList(searchKeyword);
+	}
 }

+ 24 - 0
src/main/java/com/style24/persistence/domain/SearchKeyword.java

@@ -0,0 +1,24 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 검색키워드  Domain
+ *
+ * @author bin2107
+ * @since 2021. 07. 02
+ */
+@SuppressWarnings("serial")
+@Data
+public class SearchKeyword extends TscBaseDomain {
+
+	private Integer keywordSq;
+	private String keyword;
+	private String linkUrl;
+	private String dispStdt;
+	private String dispEddt;
+	private String stDate;
+	private String edDate;
+
+}

+ 15 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -1238,5 +1238,20 @@
 			LIMIT #{maxRow}
 		</if>
 	</select>
+
+	<select id="getSearchKeywordList" parameterType="SearchKeyword" resultType="SearchKeyword">
+		/* TsfDisplay.getSearchKeywordList */
+		SELECT
+		       KEYWORD_SQ
+		     , KEYWORD
+		     , LINK_URL
+		     , DISP_STDT
+		     , DISP_EDDT
+		FROM TB_SEARCH_KEYWORD
+		WHERE 1=1
+		AND NOW() BETWEEN DISP_STDT AND DISP_EDDT
+		ORDER BY KEYWORD_SQ
+		LIMIT 1
+	</select>
 	
 </mapper>

+ 29 - 3
src/main/webapp/WEB-INF/views/web/common/fragments/GnbWeb.html

@@ -108,9 +108,9 @@
 			<!-- search -->
 			<div class="search">
 				<!-- 프로모션 문구 노출 검색용-->
-				<div class="area">
-					<p class="promotion_search">모이몰론, 남들보다 빠르게! 신상 check</p>
-					<button type="button" class="btn_sch_promotion" id="btnGnbSearch" onclick="cfnSearchLayer();"><i class="ico ico_search"><em>프로모션 검색 바로가기</em></i></button>
+				<div class="area" id="searchArea">
+<!--					<p class="promotion_search">모이몰론, 남들보다 빠르게! 신상 check</p>-->
+<!--					<button type="button" class="btn_sch_promotion" id="btnGnbSearch" onclick="cfnSearchLayer();"><i class="ico ico_search"><em>프로모션 검색 바로가기</em></i></button>-->
 				</div>
 				<!-- //프로모션 문구 노출 검색용-->
 				<!-- 통합검색 -->
@@ -507,6 +507,29 @@
 			}
 		});
 	}
+
+	// 검색키워드 조회
+	var fnCreateSearchArea = function (){
+		var url = '/display/search/keyword/list';
+		let html = '';
+		$.getJSON(url, function (result, status){
+			if(result.length>0){
+				$.each(result, function (idx, item) {
+					html += '<p class="promotion_search">'+item.keyword+'</p>\n';
+					html += '<button type="button" class="btn_sch_promotion" id="btnGnbSearch" onclick="fnGotoLink(\''+item.linkUrl+'\');"><i class="ico ico_search"><em>프로모션 검색 바로가기</em></i></button>';
+				});
+			}else{
+				html += '<p class="promotion_search"></p>\n';
+				html += '<button type="button" class="btn_sch_promotion" id="btnGnbSearch" onclick="cfnSearchLayer();"><i class="ico ico_search"><em>프로모션 검색 바로가기</em></i></button>\n';
+			}
+			$("#searchArea").append(html);
+		});
+	}
+
+	// 검색 키워드 링크 연결
+	let fnGotoLink = function (linkUrl){
+		document.location.href = linkUrl;
+	}
 	
 	// gnb overs show/hide
 	function fnui_gnbOvers() {
@@ -626,6 +649,9 @@
 
 		// 띠배너 조회
 		fnCreateTopBanner();
+
+		// 검색키워드 조회
+		fnCreateSearchArea();
 	});
 /*]]>*/
 </script>