Procházet zdrojové kódy

약관 관리 추가

jsshin před 5 roky
rodič
revize
a44db57782

+ 23 - 0
src/main/java/com/style24/core/biz/dao/TscClauseDao.java

@@ -2,6 +2,9 @@ package com.style24.core.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Clause;
+import org.springframework.stereotype.Repository;
+
+import java.util.Collection;
 
 /**
  * 약관 Dao
@@ -10,6 +13,7 @@ import com.style24.persistence.domain.Clause;
  * @since 2020. 10. 29
  */
 @ShopDs
+@Repository
 public interface TscClauseDao {
 
 	/**
@@ -21,4 +25,23 @@ public interface TscClauseDao {
 	 */
 	String getClause(Clause clause);
 
+	/**
+	 * 약관목록
+	 * @param  clause - 약관타입, 사이트코드
+	 * @return Collection<Clause> - 약관목록
+	 * @author jsshin
+	 * @since 2021. 06. 10
+	 */
+	Collection<Clause> getClauseList(Clause clause);
+
+	/**
+	 * 약관정보
+	 * @param  clauseSq - 약관시퀀스
+	 * @return String - 약관내용
+	 * @author jsshin
+	 * @since 2021. 06. 10
+	 */
+	Clause getClauseInfo(Integer clauseSq);
+
+
 }

+ 29 - 0
src/main/java/com/style24/core/biz/service/TscClauseService.java

@@ -9,6 +9,8 @@ import com.style24.persistence.domain.Clause;
 
 import lombok.extern.slf4j.Slf4j;
 
+import java.util.Collection;
+
 /**
  * 약관 Service
  * 
@@ -38,4 +40,31 @@ public class TscClauseService {
 		return clauseDao.getClause(clause);
 	}
 
+	/**
+	 * 약관목록
+	 * @param  siteCd - 사이트코드
+	 * @param  clauseType - 약관타입
+	 * @return Collection<Clause> - 약관목록
+	 * @author jsshin
+	 * @since 2021. 06. 10
+	 */
+	public Collection<Clause> getClauseList(String siteCd, String clauseType) {
+		Clause clause = new Clause();
+		clause.setSiteCd(siteCd);
+		clause.setClauseType(clauseType);
+		return clauseDao.getClauseList(clause);
+	}
+
+	/**
+	 * 약관정보
+	 * @param  clauseSq - 약관시퀀스
+	 * @return String - 약관내용
+	 * @author jsshin
+	 * @since 2021. 06. 10
+	 */
+	public Clause getClauseInfo(Integer clauseSq) {
+		return clauseDao.getClauseInfo(clauseSq);
+	}
+
+
 }

+ 1 - 0
src/main/java/com/style24/persistence/domain/Clause.java

@@ -21,5 +21,6 @@ public class Clause extends TscBaseDomain {
 	private String clauseContent;
 	private String effectDt;
 	private String dispYn;
+	private String effectYn;
 
 }

+ 20 - 0
src/main/java/com/style24/persistence/mybatis/shop/TscClause.xml

@@ -16,4 +16,24 @@
 		                   )
 	</select>
 
+	<!-- 약관 정보 목록 -->
+	<select id="getClauseList" parameterType="Clause" resultType="Clause">
+		/* TscClause.getClause */
+		SELECT CLAUSE_SQ
+		     , CLAUSE_TITLE
+		     , CLAUSE_CONTENT
+		FROM   TB_CLAUSE
+		WHERE  SITE_CD = #{siteCd}
+		AND    CLAUSE_TYPE = #{clauseType}
+		AND    DISP_YN = 'Y'
+		ORDER BY REG_DT
+	</select>
+
+	<!-- 약관 정보 -->
+	<select id="getClauseInfo" parameterType="Integer" resultType="Clause">
+		SELECT CLAUSE_CONTENT
+		FROM   TB_CLAUSE
+		WHERE  CLAUSE_SQ = #{clauseSq}
+	</select>
+
 </mapper>