فهرست منبع

스플래시이미지 관련 수정

gagamel 4 سال پیش
والد
کامیت
e9f1aff505

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

@@ -246,4 +246,14 @@ public interface TsfDisplayDao {
 	 * @since 2021. 7. 2
 	 */
 	Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword);
+
+	/**
+	 * 스플래시 이미지 가져오기
+	 * @param siteCd - 사이트코드
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 5
+	 */
+	String getSplashImage();
+
 }

+ 48 - 26
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -3,6 +3,18 @@ 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.core.env.Environment;
+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;
@@ -18,23 +30,13 @@ 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;
 
 import lombok.extern.slf4j.Slf4j;
 
 import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.util.GagaFileUtil;
 
 /**
  * 전시 Service
@@ -55,6 +57,9 @@ public class TsfDisplayService {
 	@Autowired
 	private TsfGoodsDao goodsDao;
 
+	@Autowired
+	private Environment env;
+
 	/**
 	 * GNB 브랜드그룹 목록
 	 * @param contents - 컨텐츠 정보
@@ -557,15 +562,15 @@ public class TsfDisplayService {
 				data.setBannerList(displayDao.getContentsBannerList(data));
 			}
 			goodsList = (goodsDao.getContentsCategoryGoodsList(tempContents));
-			if("SMM007".equals(data.getContentsLoc())){
+			if ("SMM007".equals(data.getContentsLoc())) {
 				int maxrow = 3;
-				if(goodsList == null || goodsList.size() < 3){
+				if (goodsList == null || goodsList.size() < 3) {
 					Cate4Srch cate = new Cate4Srch();
 					cate.setSiteCd(TscConstants.Site.STYLE24.value());
 					cate.setCateGb(TsfConstants.CateGb.BYITEM.value());
 					cate.setFrontGb(data.getFrontGb());
 					cate.setBrandGroupNo(Integer.parseInt(data.getBrandGroupNo()));
-					cate.setMaxRow(maxrow-goodsList.size());
+					cate.setMaxRow(maxrow - goodsList.size());
 					goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
 				}
 			}
@@ -696,15 +701,15 @@ public class TsfDisplayService {
 		String maxPrice = "0";
 		String minPrice = "0";
 		for (Filter filter : filterList) {
-			if(!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)){
-				if(filter.getFilterGb().equals("PRICE")){
-					if(idx==0){
+			if (!"".equals(filter.getFilterCd()) && !filter.getFilterCd().equals(null)) {
+				if (filter.getFilterGb().equals("PRICE")) {
+					if (idx == 0) {
 						minPrice = filter.getFilterCd();
-					}else{
+					} else {
 						maxPrice = filter.getFilterCd();
 					}
 					idx++;
-				}else{
+				} else {
 					if (filter.getFilterGb().equals(filterGb)) {
 						if ("BENEFIT".equals(filterGb)) {
 							if (!filter.getFilterCd().equals("40")) {
@@ -718,26 +723,26 @@ public class TsfDisplayService {
 			}
 		}
 
-		if(filterGb.equals("PRICE")){
+		if (filterGb.equals("PRICE")) {
 			int sliceVal = (Integer.parseInt(maxPrice) - Integer.parseInt(minPrice)) / 5;
-			int tempPrice = 0 ;
+			int tempPrice = 0;
 			Filter temp = new Filter();
 			Collection<Filter> priceList = new ArrayList<Filter>();
-			for(int i=0; i<6; i++){
+			for (int i = 0; i < 6; i++) {
 				tempPrice = 0;
 				temp = new Filter();
 				temp.setFilterGb("PRICE");
-				if(i==0){
+				if (i == 0) {
 //					tempPrice = (int)Math.floor((Integer.parseInt(minPrice)) / 1000) * 1000 ;
 					tempPrice = (int)Math.floor((Integer.parseInt(minPrice)));
 					temp.setFilterCd(String.valueOf(tempPrice));
 					temp.setFilterNm(String.valueOf(tempPrice));
-				}else if(i==5){
+				} else if (i == 5) {
 					tempPrice = (int)Math.floor((Integer.parseInt(maxPrice)));
 					temp.setFilterCd(String.valueOf(tempPrice));
 					temp.setFilterNm(String.valueOf(tempPrice));
-				}else{
-					tempPrice = (int)Math.floor((Integer.parseInt(minPrice) + sliceVal * i) / 1000) * 1000 ;
+				} else {
+					tempPrice = (int)Math.floor((Integer.parseInt(minPrice) + sliceVal * i) / 1000) * 1000;
 					temp.setFilterCd(String.valueOf(tempPrice));
 					temp.setFilterNm(String.valueOf(tempPrice));
 				}
@@ -854,4 +859,21 @@ public class TsfDisplayService {
 	public Collection<SearchKeyword> getSearchKeywordList(SearchKeyword searchKeyword) {
 		return displayDao.getSearchKeywordList(searchKeyword);
 	}
+
+	/**
+	 * 스플래시 이미지 가져오기
+	 * @param siteCd - 사이트코드
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 5
+	 */
+	@Cacheable(value = "splashimg")
+	public String getSplashImageUrl() {
+		String splashImg = displayDao.getSplashImage();
+		if (StringUtils.isBlank(splashImg)) {
+			return "";
+		}
+		return "http:" + GagaFileUtil.getConcatenationPath(env.getProperty("upload.image.view"), "splashimg", splashImg);
+	}
+
 }

+ 6 - 2
src/main/java/com/style24/front/biz/web/TsfAppController.java

@@ -1,6 +1,5 @@
 package com.style24.front.biz.web;
 
-import com.gagaframework.web.parameter.GagaMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -16,12 +15,14 @@ import com.style24.core.biz.service.TscKakaotalkService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.front.biz.service.TsfCustomerService;
+import com.style24.front.biz.service.TsfDisplayService;
 import com.style24.front.support.controller.TsfBaseController;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Customer;
 
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.rest.server.GagaResponse;
 
 /**
@@ -47,6 +48,9 @@ public class TsfAppController extends TsfBaseController {
 	@Autowired
 	private TscKakaotalkService kakaoService;
 
+	@Autowired
+	private TsfDisplayService displayService;
+
 	/**
 	 * 앱 설정 화면
 	 *
@@ -147,7 +151,7 @@ public class TsfAppController extends TsfBaseController {
 	@GetMapping("/splash/image/url")
 	@ResponseBody
 	public String getSplashImageUrl() {
-		return envsetService.getSplashImageUrl(TscConstants.Site.STYLE24.value());
+		return displayService.getSplashImageUrl();
 	}
 
 	/**

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

@@ -1254,4 +1254,15 @@
 		LIMIT 1
 	</select>
 	
+	<!-- 스플래시이미지 -->
+	<select id="getSplashImage" resultType="String">
+		/* TsfDisplay.getSplashImage */
+		SELECT SPLASH_IMG
+		FROM   TB_SPLASH_IMG SI
+		WHERE  NOW() BETWEEN DISP_STDT AND DISP_EDDT
+		AND    DISP_YN = 'Y'
+		ORDER  BY SPLASH_IMG_SQ DESC
+		LIMIT 1
+	</select>
+	
 </mapper>