Skip to content

Commit 0da75c3

Browse files
committed
feat: 이용약관 데이터 초기화
1 parent 79ddf6e commit 0da75c3

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
package org.example.gridgestagram.data;
2+
3+
import java.time.LocalDateTime;
4+
import lombok.RequiredArgsConstructor;
5+
import lombok.extern.slf4j.Slf4j;
6+
import org.example.gridgestagram.repository.term.TermsRepository;
7+
import org.example.gridgestagram.repository.term.entity.Terms;
8+
import org.springframework.boot.ApplicationArguments;
9+
import org.springframework.boot.ApplicationRunner;
10+
import org.springframework.core.annotation.Order;
11+
import org.springframework.stereotype.Component;
12+
13+
@Component
14+
@RequiredArgsConstructor
15+
@Slf4j
16+
@Order(1)
17+
public class TermsDataInitializer implements ApplicationRunner {
18+
19+
private final TermsRepository termsRepository;
20+
21+
@Override
22+
public void run(ApplicationArguments args) throws Exception {
23+
if (termsRepository.count() == 0) {
24+
initializeTermsData();
25+
log.info("Terms 초기 데이터 생성 완료");
26+
}
27+
}
28+
29+
private void initializeTermsData() {
30+
31+
// 2. 이용약관 (필수)
32+
Terms serviceTerms = Terms.builder()
33+
.title("이용약관 (필수)")
34+
.content(getServiceTermsContent())
35+
.isRequired(true)
36+
.createdAt(LocalDateTime.now())
37+
.build();
38+
termsRepository.save(serviceTerms);
39+
40+
// 3. 데이터 정책 (필수)
41+
Terms dataPolicy = Terms.builder()
42+
.title("데이터 정책 (필수)")
43+
.content(getDataPolicyContent())
44+
.isRequired(true)
45+
.createdAt(LocalDateTime.now())
46+
.build();
47+
termsRepository.save(dataPolicy);
48+
49+
// 4. 위치 기반 기능 (필수)
50+
Terms locationService = Terms.builder()
51+
.title("위치 기반 기능 (필수)")
52+
.content(getLocationServiceContent())
53+
.isRequired(true)
54+
.createdAt(LocalDateTime.now())
55+
.build();
56+
termsRepository.save(locationService);
57+
58+
}
59+
60+
private String getServiceTermsContent() {
61+
return """
62+
제1조 (목적)
63+
이 약관은 Tnovel(이하 "회사")이 제공하는 서비스의 이용조건 및 절차, 회사와 회원간의 권리·의무 및 책임사항을 규정함을 목적으로 합니다.
64+
65+
제2조 (정의)
66+
1. "서비스"라 함은 회사가 제공하는 모든 서비스를 의미합니다.
67+
2. "회원"이라 함은 이 약관에 동의하고 회사와 서비스 이용계약을 체결한 개인을 말합니다.
68+
69+
제3조 (약관의 게시와 개정)
70+
1. 회사는 이 약관의 내용을 회원이 쉽게 알 수 있도록 서비스 초기 화면에 게시합니다.
71+
2. 회사는 필요한 경우 이 약관을 개정할 수 있습니다.
72+
73+
제4조 (서비스의 제공 및 변경)
74+
1. 회사는 다음과 같은 업무를 수행합니다.
75+
- 소설 콘텐츠 제공 서비스
76+
- 사용자 맞춤형 추천 서비스
77+
- 기타 회사가 정하는 업무
78+
""";
79+
}
80+
81+
private String getDataPolicyContent() {
82+
return """
83+
개인정보 수집 및 이용에 대한 동의
84+
85+
1. 수집하는 개인정보 항목
86+
- 필수항목: 이름, 이메일주소, 휴대폰번호, 생년월일
87+
- 선택항목: 프로필 사진, 관심 장르
88+
89+
2. 개인정보 수집 및 이용목적
90+
- 회원 가입 및 관리
91+
- 서비스 제공 및 개선
92+
- 고객상담 및 민원처리
93+
- 법령 및 약관 위반 회원에 대한 이용제한 조치
94+
95+
3. 개인정보 보유 및 이용기간
96+
- 회원탈퇴 시까지 (단, 법령에서 정한 경우 해당 기간까지 보관)
97+
98+
4. 개인정보 수집 동의 거부 시
99+
- 필수항목 수집 동의를 거부하시는 경우 서비스 이용이 제한됩니다.
100+
""";
101+
}
102+
103+
private String getLocationServiceContent() {
104+
return """
105+
위치기반서비스 이용약관
106+
107+
제1조 (목적)
108+
이 약관은 회사가 제공하는 위치기반서비스에 대해 회사와 개인위치정보주체와의 권리·의무 및 책임사항을 규정함을 목적으로 합니다.
109+
110+
제2조 (서비스 내용)
111+
회사는 GPS칩이 내장된 스마트폰을 통해 수집된 위치정보를 이용하여 다음과 같은 위치기반서비스를 제공합니다:
112+
- 현재 위치 기반 맞춤 콘텐츠 제공
113+
- 지역별 이벤트 정보 제공
114+
- 근처 서점 및 문화시설 정보 제공
115+
116+
제3조 (개인위치정보의 수집)
117+
1. 회사는 개인위치정보주체의 동의를 얻어 개인위치정보를 수집합니다.
118+
2. 개인위치정보는 해당 서비스 제공을 위해서만 이용됩니다.
119+
""";
120+
}
121+
122+
}

0 commit comments

Comments
 (0)