From d0a95b5a4a36fdf101aa638bd261bf7e9349f874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:02:56 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[Feat]:=20lastModifiedAt=20modifiedAt=20?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EC=88=98=EB=AA=85=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/haedal/zzansuni/common/domain/BaseTimeEntity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java index efde64a..f8afe55 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java @@ -19,6 +19,6 @@ public class BaseTimeEntity { private LocalDateTime createdAt; @LastModifiedDate - @Column(name = "last_modified_at") - private LocalDateTime lastModifiedAt; + @Column(name = "modified_at") + private LocalDateTime modifiedAt; } From 57892080edc0a5999d2308d2fec8f2663fb8da80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:48:01 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[Feat]:=20DB=20DDL=20=EC=84=A4=EC=A0=95=20(?= =?UTF-8?q?#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/src/main/resources/data.sql | 473 ------------------ .../main/resources/db/migration/V1__init.sql | 127 ++--- 2 files changed, 67 insertions(+), 533 deletions(-) delete mode 100644 zzansuni-api-server/app/src/main/resources/data.sql diff --git a/zzansuni-api-server/app/src/main/resources/data.sql b/zzansuni-api-server/app/src/main/resources/data.sql deleted file mode 100644 index 9943c64..0000000 --- a/zzansuni-api-server/app/src/main/resources/data.sql +++ /dev/null @@ -1,473 +0,0 @@ -/* - 어드민 1명, 매니저 1명, 유저 38명 INSERT - */ -INSERT INTO users (exp, created_at, last_modified_at, auth_token, email, nickname, password, profile_image_url, - provider, role) -VALUES (0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', 'NAVER_HP6Yyh7SIkk8QS1VFtEylxrxo23UxNTBHcAjfTw-BHM', null, - 'bayy', null, null, 'NAVER', 'ADMIN'), - (0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'manager@a.c', 'testUser1', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'MANAGER'), - (49, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test0@a.c', '이원', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (94, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test1@a.c', '재광', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (87, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test2@a.c', '조한', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (87, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test3@a.c', '태혁', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (47, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test4@a.c', '태윤', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (43, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test5@a.c', '예승', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (83, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test6@a.c', '효신', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (52, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test7@a.c', '준범', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (68, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test8@a.c', '소담', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (40, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test9@a.c', '준섭', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (32, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test10@a.c', '강은', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (17, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test11@a.c', '의빈', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (3, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test12@a.c', '승지', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (66, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test13@a.c', '휘서', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (60, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test14@a.c', '영후', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (25, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test15@a.c', '형우', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test16@a.c', '희범', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (31, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test17@a.c', '효범', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'), - (57, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt0@a.c', '기태', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/se/U2uEiDz/640/480', - null, 'USER'), - (28, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt1@a.c', '한서', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/se/MSVzesxY/640/480', - null, 'USER'), - (38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt2@a.c', '승리', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/se/KUZmdj5Zn/640/480', - null, 'USER'), - (87, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt3@a.c', '찬석', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=4114472343961600', null, 'USER'), - (76, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt4@a.c', '은현', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=4231310094630912', null, 'USER'), - (15, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt5@a.c', '성권', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=4323334812598272', null, 'USER'), - (21, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt6@a.c', '찬휘', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=8502500980162560', null, 'USER'), - (90, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt7@a.c', '충만', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/seed/IkQoFVE/640/480', - null, 'USER'), - (31, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt8@a.c', '태식', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=1946817203798016', null, 'USER'), - (13, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt9@a.c', '순규', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=1005792186597376', null, 'USER'), - (57, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt10@a.c', '성빈', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com40/480?lock=5094699765334016', null, 'USER'), - (0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt11@a.c', '조슈', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=7842715689549824', null, 'USER'), - (0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt12@a.c', '성목', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/seed/T0GXvPB9C5/640/480', - null, 'USER'), - (65, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt13@a.c', '주엽', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/sd/GTUgLFvuZ/640/480', - null, 'USER'), - (79, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt14@a.c', '지섭', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/sd/HqevoSPB/640/480', - null, 'USER'), - (9, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt15@a.c', '혜승', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com/0/480?lock=3226888453488640', null, 'USER'), - (15, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt16@a.c', '모세', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com40/480?lock=929401032146944', null, 'USER'), - (64, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt17@a.c', '혁주', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com40/480?lock=1474097934499840', null, 'USER'), - (64, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt18@a.c', '예솔', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com40/480?lock=5535552531070976', null, 'USER'), - (38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt19@a.c', '근영', - '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', - 'https://loremflickr.com40/480?lock=7618880130252800', null, 'USER'); - - -/* -챌린지 그룹 20개 INSERT - */ -INSERT INTO challenge_group (cumulative_count, created_at, last_modified_at, content, title, category, guide) -VALUES (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', - '아니하는 보호를 다만, 보장하기 가진다. 승인된 모성의 무상으로 보호한다.. 재외국민을 죄를 보호할. 노력하여야 판결이 필요한.', '창달에 영장을 헌법에', 'SHARE', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '사생활의 의하여 법률에 무상으로 범죄에 보장하기. 이상의 증거인멸의 사생활의 범하고 통신·방송의 정하는. 조약과 창달에 정하는 처벌받지 승인된 노력하여야 국민은 사후에 범하고 3년. -헌법에 사항은 사후에 범하고 진다. 현행범인인. 범죄를 진다. 증거인멸의. 체결·공포된 이상의 죄를. -대하여 통신·방송의 창달에 보호를 범죄에 무죄로 사후에 필요한 의무교육은 범죄에. 위하여 한다. 법률이 청구할 국가는 보호를 염려가 계승·발전과 보장하기. 무죄로 위하여 ', '행위시의 법률로써 의무교육은', - 'HEALTH', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', - '계승·발전과 법률이 다만, 영장을 창달에 구성하지 일반적으로. 국민은 유죄의 행위로 판결이 모든 신문의 무상으로. 거듭 대하여 신문의 있다..', '도피 수 신문의', 'SHARE', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '침해받지 정한다. 기능을 확정될. 의무를 진흥하여야 시설기준과 권리는 현행범인인. 법률이 신문의 예술가의. -승인된 소추되지 재외국민을 경우와 진다. 필요한 노력하여야 정한다.. 같은 무죄로 통신·방송의 사항은 모성의 기능을 영장을 법률로 또는. 예술가의 무상으로 아니하는 진흥하여야 추정된다. 또는 무죄로 때까지는 바에 소추되지. -증거인멸의 국내법과 신문의 있다. 장기 형사피고인은 정하는 평생교육을 소추되지. 죄를 염려가 때에는. 전통문화의 전통문화의 ', '같은 한다. 행위시의', 'SHARE', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '범죄에 국민은 전통문화의 바에 확정될 수 승인된. 형사피고인은 정하는 무죄로. 범죄를 때까지는 보호를 염려가 한다. 있을 처벌받지 통신·방송의 한다. 처벌받지. -보장하기 가진다. 법률이 가진다. 행위시의 확정될 현행범인인 소추되지. 행위로 법률에 국민은 있다.. 아니하며, 비밀과 아니하며, 거듭 국민은. -승인된 가진다. 권리는 필요한 보장하기. 진다. 사항은 위하여 판결이 형에 노력하여야. 도피 법률에 창달에 때에는 기능을.', '거듭 법률로 범하고', 'HEALTH', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '법률로 행위시의 비밀과 같은 추정된다. 효력을 수 판결이 법률로 처벌받지.', '다만, 노력하여야 이상의', - 'ECHO', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '진흥하여야 형에 대하여 청구할 의하여.', '의하여 가진다. 국제법규는', 'HEALTH', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '거듭 추정된다. 헌법에 아니하며, 시설기준과 신체의 사항은 형사피고인은 전통문화의. 헌법에 저작자·발명가·과학기술자와 보호를 노력하여야. -시설기준과 창달에 신체의. 처벌받지 영장을 국민은 체결·공포된 국민은 체결·공포된 유죄의. 다만, 국제법규는 영장을 기능을 범죄를. -계승·발전과 아니하며, 조약과 의무교육은. 보호한다. 진흥하여야 추정된다. 비밀과 신문의 비밀과 ', '보호를 처벌받지 형에', 'VOLUNTEER', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '염려가 유죄의 형에 한다. 필요한 헌법에 법률이 장기 법률이 있을. -장기 증거인멸의 국내법과 법률이 있을 신문의 형에. -보호를 범하고 체결·공포된 때에는 청구할 평생교육을 한다. 있다. 기능을 다만,. -영장을 현행범인인 민족문화의 국내법과 시설기준과 무상으로.', '증거인멸의 법률에 또는', 'VOLUNTEER', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '때에는 있다. 국민은 행위로 국제법규는 비밀과 바에.', '행위시의 유죄의 있을', 'HEALTH', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '시설기준과 정한다. 통신·방송의.', '자유를 시설기준과 신문의', 'ECHO', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', - '무죄로 시설기준과 법률에 한다. 평생교육을 민족문화의 보장하기. 아니하는 확정될 무죄로. 재외국민을 경우와 범하고 정하는 확정될 의무교육은 바에.', '국민은 사후에 증거인멸의', 'ECHO', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', - '헌법에 효력을 아니하며, 의무교육은. 통신·방송의 보호할 국제법규는 국가는 정하는 헌법에 바에 같은. 이상의 모성의 승해받지.', '정한다. 아니하는 저작자·발명가·과학기술자와', - 'VOLUNTEER', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '행위로 영장을 행위로 진흥하여야 헌법에 조약과 행위로 신체의 기능을.', '전통문화의 국내법과 권리는', - 'ECHO', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '신체의 예술가의 민족문화의 승인된 바에 의무를 무상으로. 사생활의 사생활의 헌법에 정한다. 무죄로 국민은 신문의 민족문화의 형사피고인은. 계승·발전과 아니하며, 있을. -효력을 동일한 기능을 예술가의 같은 법률에. 조약과 행위로 가진다. 모성의 승인된 정한다. 의무를 도피 노력하여야 의하여. 거듭 체결·공포된 의하여. -예술가의 증거인멸의 국제법규는. 유죄의 확정될 범죄에 자유를 시설기준과 사후에 통신·방송의. 전통문화의 모든 신문의 예술가의 저작자·발명', '노력하여야 처벌받지 장기', 'SHARE', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '비밀과 사항은 헌법에 아니한다.. 진다. 확정될 거듭 이상의. 바에 범하고 법률로써 보호한다.. -기능을 위하여 정하는. 법률에 신체의 동일한 법률로 진다. 권리는 법률이 아니하며,. 기능을 침해받지 국가는 진다. 같은. -의무를 구성하지 때에는 신문의. 정하는 통신·방송의 의무교육은. 경우와 범하고 승인된 범죄에 같은 창달에.', '국민은 법률에 국제법규는', 'HEALTH', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '거듭 도피 의하여 신문의 창달에 계승·발전과 추정된다. 필요한 자유를.', - '의무교육은 전통문화의 아니하며,', 'VOLUNTEER', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '형에 형에 있다. 법률에. -사항은 자유를 확정될 민족문화의 국제법규는 도피. -국내법과 국내법과 경우와 있을 기능을 범죄에.', '아니하며, 법률이 노력하여야', 'VOLUNTEER', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '무상으로 범죄에 이상의. -도피 사항은 노력하여야 유죄의 보호할 조약과 비밀과. -권리는 창달에 판결이 형사피고인은 저작자·발명가·과학기술자와 정한다. 계승·발전과 필요한.', '또는 판결이 자유를', 'HEALTH', '가이드 라인'), - (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '법률에 모성의 추정된다. 소추되지.', '효력을 사항은 평생교육을', 'HEALTH', '가이드 라인'); - -/* -챌린지 50개 INSERT - */ -INSERT INTO challenge (difficulty, once_exp, required_count, success_exp, challenge_group_id, created_at, - last_modified_at, day_type, start_date, end_date) -VALUES (4, 4, 14, 98, 20, '2024-03-13 23:32:22', '2024-06-01 10:23:48', 'WEEK', '2023-09-30 17:03:14', - '2023-12-30 02:38:20'), - (1, 9, 16, 67, 9, '2024-03-27 04:27:29', '2024-06-01 12:48:45', 'DAY', '2023-06-07 17:57:43', - '2024-04-14 14:39:49'), - (4, 2, 31, 88, 2, '2023-11-24 07:46:56', '2024-05-31 17:21:15', 'WEEK', '2023-07-29 23:26:44', - '2023-10-02 11:17:35'), - (5, 10, 36, 62, 9, '2024-01-20 13:49:55', '2024-05-31 18:05:52', 'DAY', '2023-08-09 01:21:01', - '2024-03-09 01:12:59'), - (1, 27, 12, 54, 2, '2023-12-29 11:23:05', '2024-05-31 15:39:54', 'DAY', '2023-09-30 18:44:10', - '2024-03-19 19:38:11'), - (2, 6, 46, 72, 3, '2024-03-07 12:36:06', '2024-05-31 17:00:39', 'WEEK', '2023-11-16 06:16:50', - '2023-10-12 01:21:20'), - (4, 8, 50, 73, 16, '2023-07-19 23:24:03', '2024-05-31 22:08:03', 'WEEK', '2023-08-01 02:51:28', - '2024-04-18 12:22:09'), - (4, 22, 7, 79, 12, '2023-06-12 23:02:03', '2024-05-31 16:44:05', 'MONTH', '2024-02-27 19:27:09', - '2023-09-10 04:18:18'), - (2, 18, 15, 81, 14, '2023-12-27 06:37:22', '2024-06-01 04:43:01', 'WEEK', '2023-10-10 06:54:56', - '2023-11-01 08:34:43'), - (3, 6, 24, 42, 14, '2023-08-04 08:19:08', '2024-06-01 05:05:13', 'MONTH', '2023-10-06 18:29:11', - '2024-01-26 16:16:36'), - (3, 12, 26, 14, 18, '2023-11-01 05:09:20', '2024-05-31 17:55:24', 'DAY', '2023-08-26 05:36:52', - '2023-06-02 19:59:36'), - (1, 23, 49, 84, 6, '2023-09-14 18:01:00', '2024-05-31 23:17:27', 'WEEK', '2024-03-20 13:54:52', - '2024-01-15 17:58:39'), - (4, 24, 38, 52, 6, '2023-08-07 11:02:48', '2024-05-31 17:27:27', 'MONTH', '2023-11-18 12:16:43', - '2023-12-13 23:07:26'), - (1, 22, 26, 39, 12, '2023-12-19 11:15:53', '2024-06-01 08:26:35', 'DAY', '2024-03-14 14:42:54', - '2024-05-10 20:01:25'), - (4, 10, 23, 31, 13, '2023-12-21 08:45:23', '2024-06-01 05:06:11', 'MONTH', '2024-03-13 02:06:39', - '2024-04-02 01:29:40'), - (4, 23, 34, 92, 17, '2024-05-24 19:31:38', '2024-06-01 04:26:12', 'MONTH', '2024-03-20 02:18:33', - '2024-04-30 05:59:14'), - (3, 2, 8, 81, 10, '2024-05-29 07:55:02', '2024-06-01 03:15:28', 'MONTH', '2023-11-21 15:39:06', - '2024-05-23 01:15:36'), - (4, 19, 22, 39, 3, '2023-07-13 22:02:04', '2024-06-01 02:13:55', 'MONTH', '2023-11-19 02:58:06', - '2023-07-15 18:51:49'), - (3, 3, 6, 93, 6, '2023-08-02 14:58:46', '2024-05-31 23:35:34', 'WEEK', '2023-11-03 02:06:32', - '2023-11-19 05:50:51'), - (5, 26, 25, 96, 10, '2023-08-04 01:08:10', '2024-05-31 14:46:26', 'DAY', '2024-05-04 17:22:54', - '2023-11-28 04:35:23'), - (4, 28, 12, 93, 3, '2023-11-10 16:45:34', '2024-05-31 13:34:08', 'WEEK', '2023-09-22 18:48:04', - '2023-07-17 17:03:07'), - (5, 25, 36, 56, 14, '2024-05-02 22:35:19', '2024-05-31 22:02:33', 'DAY', '2023-07-10 14:08:04', - '2024-01-29 02:42:45'), - (4, 14, 20, 81, 1, '2023-07-27 10:11:24', '2024-05-31 16:40:28', 'WEEK', '2024-05-20 05:25:36', - '2023-07-07 16:10:09'), - (4, 24, 44, 30, 15, '2023-10-07 12:43:07', '2024-05-31 18:20:23', 'MONTH', '2023-09-07 04:01:17', - '2023-07-18 05:44:56'), - (5, 14, 11, 19, 15, '2024-03-23 04:22:26', '2024-05-31 19:05:54', 'WEEK', '2024-05-20 03:42:08', - '2024-05-19 20:26:46'), - (4, 22, 11, 16, 18, '2024-04-05 09:46:03', '2024-05-31 22:24:33', 'MONTH', '2024-03-23 08:01:18', - '2023-11-17 01:32:17'), - (1, 10, 11, 61, 2, '2023-09-16 11:36:51', '2024-05-31 20:53:52', 'DAY', '2024-02-26 10:35:57', - '2023-10-27 17:14:19'), - (3, 8, 38, 85, 17, '2023-06-27 08:43:17', '2024-06-01 11:31:51', 'WEEK', '2023-08-26 22:05:34', - '2024-05-03 09:41:59'), - (4, 11, 43, 24, 9, '2024-02-16 04:11:43', '2024-05-31 17:38:23', 'MONTH', '2024-04-13 12:43:33', - '2023-08-05 10:56:03'), - (1, 7, 21, 10, 19, '2024-01-01 02:27:06', '2024-06-01 00:48:57', 'DAY', '2024-04-01 10:55:57', - '2023-09-26 12:05:16'), - (3, 29, 34, 16, 6, '2023-11-02 21:51:23', '2024-06-01 02:16:56', 'WEEK', '2024-02-16 01:31:04', - '2024-05-17 05:19:48'), - (5, 16, 45, 15, 13, '2023-12-27 12:46:14', '2024-05-31 13:25:33', 'DAY', '2023-12-19 03:56:43', - '2024-05-01 20:28:13'), - (5, 3, 7, 63, 10, '2023-11-18 05:15:58', '2024-05-31 18:18:21', 'WEEK', '2024-01-07 12:47:23', - '2024-01-03 15:31:52'), - (1, 1, 38, 25, 9, '2023-10-11 00:48:42', '2024-06-01 05:35:37', 'MONTH', '2023-10-03 13:01:09', - '2023-06-29 10:50:12'), - (3, 16, 5, 41, 16, '2024-02-07 02:31:17', '2024-05-31 22:24:50', 'WEEK', '2024-01-17 20:40:14', - '2023-10-26 22:06:57'), - (2, 24, 16, 100, 3, '2024-05-11 17:18:36', '2024-06-01 05:02:00', 'WEEK', '2023-09-05 18:39:18', - '2023-07-29 09:16:38'), - (3, 22, 16, 82, 11, '2024-03-30 05:55:42', '2024-06-01 10:27:17', 'MONTH', '2024-01-29 04:14:18', - '2023-10-19 21:18:13'), - (3, 8, 17, 53, 19, '2023-12-20 13:47:53', '2024-05-31 23:01:45', 'WEEK', '2024-03-26 15:37:31', - '2024-04-23 12:50:01'), - (5, 21, 21, 99, 14, '2023-10-15 16:20:58', '2024-05-31 23:46:03', 'MONTH', '2024-01-09 07:22:56', - '2024-05-09 14:49:32'), - (2, 30, 8, 42, 13, '2024-04-02 08:40:50', '2024-05-31 20:06:58', 'WEEK', '2023-06-16 17:19:07', - '2024-01-21 16:14:28'), - (4, 1, 38, 21, 15, '2023-08-18 14:33:24', '2024-05-31 14:41:47', 'MONTH', '2023-06-17 23:33:35', - '2023-11-06 03:47:58'), - (3, 7, 42, 80, 19, '2023-10-09 15:18:27', '2024-06-01 01:16:19', 'DAY', '2023-07-01 05:51:52', - '2024-04-23 00:14:22'), - (3, 20, 27, 13, 20, '2023-10-10 07:58:38', '2024-05-31 22:24:18', 'WEEK', '2024-05-01 14:24:55', - '2024-05-07 22:04:22'), - (2, 30, 45, 12, 16, '2023-11-30 06:26:47', '2024-06-01 06:09:41', 'WEEK', '2023-09-06 04:51:45', - '2024-05-26 22:38:50'), - (2, 27, 37, 77, 15, '2024-01-14 12:01:26', '2024-06-01 03:58:41', 'MONTH', '2024-03-10 15:34:11', - '2023-08-04 06:01:43'), - (1, 16, 23, 86, 14, '2024-01-11 18:19:31', '2024-06-01 09:43:56', 'MONTH', '2024-01-16 11:07:59', - '2024-01-09 21:24:39'), - (1, 1, 30, 16, 12, '2023-11-07 10:30:09', '2024-06-01 01:32:44', 'MONTH', '2023-09-17 06:40:04', - '2023-08-06 04:11:45'), - (4, 8, 16, 22, 2, '2024-04-08 20:53:34', '2024-06-01 12:50:19', 'WEEK', '2023-08-09 09:32:53', - '2023-11-18 21:01:25'), - (1, 7, 21, 10, 10, '2024-04-03 02:30:22', '2024-05-31 18:23:39', 'MONTH', '2023-11-15 06:47:13', - '2023-11-28 23:44:20'), - (1, 19, 43, 77, 19, '2023-12-03 10:46:32', '2024-05-31 21:35:15', 'WEEK', '2024-01-27 11:42:35', - '2023-10-03 10:02:52'); - - -/** - * 유저 챌린지 50개 INSERT - */ -INSERT INTO user_challenge (challenge_id, created_at, last_modified_at, user_id, status) -VALUES (23, '2024-04-17 00:59:51', '2024-05-31 20:01:57', 19, 'PROCEEDING'), - (35, '2023-11-06 10:28:46', '2024-05-31 14:27:59', 20, 'SUCCESS'), - (27, '2023-12-26 19:29:33', '2024-05-31 12:47:58', 14, 'PROCEEDING'), - (32, '2023-11-06 22:11:18', '2024-05-31 18:35:06', 1, 'FAIL'), - (21, '2023-11-03 04:22:11', '2024-05-31 23:15:25', 8, 'PROCEEDING'), - (2, '2024-02-08 13:51:31', '2024-05-31 21:22:24', 7, 'PROCEEDING'), - (25, '2023-12-02 16:11:27', '2024-05-31 13:44:19', 16, 'FAIL'), - (29, '2024-05-13 11:18:07', '2024-06-01 01:27:26', 2, 'FAIL'), - (14, '2023-11-08 09:13:38', '2024-05-31 23:47:19', 13, 'SUCCESS'), - (5, '2024-05-21 02:32:20', '2024-06-01 02:59:40', 11, 'SUCCESS'), - (9, '2024-04-16 12:43:09', '2024-06-01 03:07:21', 2, 'PROCEEDING'), - (30, '2023-09-22 09:02:08', '2024-05-31 15:56:47', 16, 'FAIL'), - (31, '2023-06-10 12:54:44', '2024-06-01 02:40:54', 3, 'PROCEEDING'), - (12, '2023-12-29 15:40:16', '2024-05-31 10:58:46', 5, 'PROCEEDING'), - (14, '2023-11-23 20:16:06', '2024-05-31 10:30:09', 17, 'FAIL'), - (32, '2023-07-01 22:11:32', '2024-05-31 07:12:12', 1, 'FAIL'), - (40, '2024-03-26 19:06:37', '2024-05-31 23:29:29', 12, 'SUCCESS'), - (18, '2024-02-27 09:47:32', '2024-05-31 16:05:36', 16, 'PROCEEDING'), - (2, '2024-05-25 21:56:45', '2024-05-31 13:13:29', 7, 'PROCEEDING'), - (21, '2023-11-28 07:29:39', '2024-06-01 03:20:59', 5, 'PROCEEDING'), - (36, '2023-10-16 14:10:18', '2024-05-31 17:27:43', 19, 'FAIL'), - (37, '2023-07-04 08:19:40', '2024-05-31 08:54:08', 17, 'SUCCESS'), - (34, '2024-02-13 11:06:11', '2024-05-31 14:47:56', 1, 'FAIL'), - (40, '2023-06-30 06:53:36', '2024-06-01 03:00:23', 13, 'SUCCESS'), - (21, '2023-06-05 20:04:34', '2024-05-31 22:17:43', 13, 'SUCCESS'), - (40, '2024-03-31 04:30:25', '2024-05-31 11:31:29', 5, 'PROCEEDING'), - (21, '2023-10-30 21:45:56', '2024-06-01 00:34:50', 3, 'FAIL'), - (32, '2023-09-16 11:04:44', '2024-06-01 06:16:46', 5, 'SUCCESS'), - (37, '2023-12-18 18:21:08', '2024-05-31 15:24:21', 5, 'SUCCESS'), - (30, '2024-02-04 08:22:41', '2024-06-01 02:36:46', 17, 'PROCEEDING'), - (13, '2023-09-18 13:06:33', '2024-05-31 09:07:34', 9, 'FAIL'), - (30, '2024-02-14 15:40:11', '2024-05-31 16:10:40', 19, 'FAIL'), - (39, '2024-03-05 05:49:58', '2024-05-31 12:33:58', 17, 'FAIL'), - (3, '2023-07-16 08:49:35', '2024-06-01 01:11:38', 15, 'PROCEEDING'), - (18, '2023-06-25 19:39:12', '2024-06-01 04:26:02', 2, 'PROCEEDING'), - (1, '2024-03-28 13:31:21', '2024-06-01 06:23:23', 9, 'PROCEEDING'), - (36, '2023-09-04 19:33:05', '2024-05-31 21:56:36', 8, 'PROCEEDING'), - (25, '2023-06-26 10:41:27', '2024-06-01 00:08:53', 17, 'SUCCESS'), - (10, '2023-12-12 23:50:50', '2024-06-01 06:20:09', 12, 'PROCEEDING'), - (10, '2024-01-08 11:08:49', '2024-05-31 09:43:11', 10, 'PROCEEDING'), - (12, '2024-04-11 22:59:11', '2024-05-31 23:15:53', 4, 'FAIL'), - (35, '2024-04-10 09:04:26', '2024-05-31 15:10:54', 20, 'PROCEEDING'), - (34, '2023-07-21 16:26:14', '2024-05-31 12:50:30', 7, 'PROCEEDING'), - (23, '2023-09-19 07:24:03', '2024-05-31 08:33:48', 1, 'PROCEEDING'), - (35, '2023-12-25 03:56:47', '2024-05-31 19:04:40', 16, 'PROCEEDING'), - (37, '2023-07-21 18:49:30', '2024-05-31 13:18:06', 2, 'FAIL'), - (30, '2024-01-13 10:30:28', '2024-06-01 04:13:24', 3, 'FAIL'), - (29, '2024-03-17 06:41:06', '2024-05-31 15:59:43', 15, 'SUCCESS'), - (5, '2024-05-13 01:25:34', '2024-05-31 09:03:49', 8, 'SUCCESS'), - (5, '2023-08-27 06:24:49', '2024-05-31 13:45:58', 18, 'SUCCESS'); -/** - * 챌린지 리뷰 50개 INSERT - - */ -INSERT INTO challenge_review (rating, created_at, last_modified_at, user_challenge_id, content) -VALUES (1, '2023-06-03 00:52:49', '2024-05-31 02:33:22', 35, '국내법과 사생활의 보호한다. 동일한.'), - (3, '2023-06-09 01:47:10', '2024-05-30 18:31:46', 19, '증거인멸의 다만, 아니한다. 동일한 일반적으로 아니하며, 신체의 저작자·발명가·과학기술자와.'), - (3, '2024-02-21 20:07:29', '2024-05-30 11:36:37', 21, '보호한다. 판결이 범하고 전통문화의 침해받지 3년.'), - (1, '2023-06-21 02:36:42', '2024-05-31 04:32:31', 23, '구성하지 모성의 있다..'), - (1, '2023-06-08 18:13:22', '2024-05-31 03:21:17', 37, '있을 추정된다. 보장하기 국민은 때에는 모든.'), - (1, '2024-05-05 20:32:29', '2024-05-30 08:39:43', 30, '사생활의 보호할 범죄를 신체의.'), - (1, '2024-02-21 15:06:53', '2024-05-31 05:03:24', 4, '재외국민을 계승·발전과 때까지는 의하여 권리는.'), - (3, '2023-12-02 07:14:52', '2024-05-30 09:41:40', 9, '경우와 권리는 범죄를 죄를.'), - (4, '2023-09-09 18:30:55', '2024-05-30 10:08:27', 3, '증거인멸의 형사피고인은 사항은 의무를 승인된 해당하는 국내법과 법률에 신문의.'), - (5, '2024-02-27 11:48:23', '2024-05-30 09:05:03', 9, '위하여 창달에 형사피고인은 자유를 보호를 염려가.'), - (5, '2023-06-23 21:20:57', '2024-05-31 05:09:20', 19, '수 침해받지 무죄로 법률에.'), - (5, '2023-06-22 14:33:13', '2024-05-31 07:18:27', 10, '바에 영장을 수 형사피고인은 노력하여야 처벌받지.'), - (5, '2023-08-13 21:38:57', '2024-05-30 21:04:50', 45, '조약과 권리는 법률이.'), - (3, '2024-03-18 14:27:16', '2024-05-30 22:58:46', 47, '노력하여야 침해받지 재외국민을 행위로 행위로 사후에 위하여.'), - (1, '2023-10-31 13:54:39', '2024-05-30 20:16:11', 42, '가진다. 아니한다. 소추되지 때까지는 아니하는 정하는 청구할 시설기준과 가진다..'), - (4, '2024-05-30 14:42:00', '2024-05-31 06:34:24', 4, '사항은 기능을 국내법과 국제법규는 보장하기 청구할 국내법과 같은 모든 추정된다..'), - (2, '2023-08-08 23:36:42', '2024-05-30 19:17:52', 47, '모성의 아니하며, 행위로 평생교육을 국민은.'), - (1, '2024-05-21 12:17:16', '2024-05-30 15:26:01', 15, '신문의 노력하여야 행위로 통신·방송의 범하고 보호한다. 한다. 장기 범죄에.'), - (1, '2024-05-16 05:25:28', '2024-05-30 09:05:54', 1, '전통문화의 법률이 다만, 승인된 가진다. 정한다. 형사피고인은 재외국민을 계승·발전과.'), - (3, '2023-07-03 06:51:26', '2024-05-30 14:26:18', 46, '통신·방송의 있을 승인된 일반적으로 경우와.'), - (2, '2023-12-31 15:01:16', '2024-05-30 22:47:52', 14, '다만, 무상으로 한다. 행위로.'), - (5, '2023-10-31 09:21:32', '2024-05-31 06:13:40', 49, '유죄의 형사피고인은 법률에 형사피고인은 승인된 또는 바에 재외국민을 가진다. 진다..'), - (3, '2023-08-28 14:11:32', '2024-05-30 16:51:39', 20, '헌법에 범죄를 신체의 법률로써 가진다. 이상의 도피 죄를.'), - (2, '2023-08-22 12:10:52', '2024-05-31 07:22:03', 37, '3년 유죄의 아니하는.'), - (3, '2024-05-19 08:04:04', '2024-05-30 21:25:47', 50, '진흥하여야 범죄를 염려가 범하고 형사피고인은 같은 있다..'), - (2, '2023-10-10 08:54:16', '2024-05-30 08:14:22', 49, '유죄의 소추되지 증거인멸의 때까지는.'), - (2, '2024-02-09 05:31:38', '2024-05-30 12:42:50', 48, '국가는 구성하지 행위시의 법률에 형에 수 증거인멸의.'), - (1, '2023-07-18 16:20:24', '2024-05-30 20:25:22', 26, '자유를 대하여 침해받지.'), - (4, '2024-02-07 20:14:41', '2024-05-30 16:39:43', 23, '무죄로 이상의 같은 아니한다. 때까지는 진다. 법률로써.'), - (3, '2024-04-19 22:12:21', '2024-05-30 13:17:36', 26, '필요한 아니하는 저작자·발명가·과학기술자와 법률로 사항은 승인된.'), - (1, '2024-05-25 18:24:29', '2024-05-30 17:38:42', 42, '국내법과 거듭 3년 확정될 신체의 민족문화의.'), - (1, '2023-09-25 12:01:05', '2024-05-30 20:19:31', 18, '또는 범죄에 권리는 무죄로 행위시의 법률로 무죄로 사생활의.'), - (5, '2023-08-04 07:13:03', '2024-05-30 18:22:27', 41, '체결·공포된 통신·방송의 예술가의 정한다. 자유를 평생교육을 범죄를.'), - (2, '2024-02-16 07:25:42', '2024-05-30 10:28:16', 18, '체결·공포된 무상으로 때까지는 아니하는 기능을 권리는.'), - (4, '2024-02-16 08:55:55', '2024-05-31 03:25:10', 3, '유죄의 보호할 사항은.'), - (1, '2023-11-08 20:04:57', '2024-05-30 11:11:12', 2, '조약과 정한다. 같은.'), - (2, '2023-12-21 18:35:25', '2024-05-31 04:50:30', 4, '보호할 때에는 범하고.'), - (1, '2023-06-20 23:53:48', '2024-05-30 21:18:04', 45, '형사피고인은 모든 처벌받지 이상의 추정된다. 진흥하여야 법률로써 아니하며, 예술가의.'), - (4, '2024-02-09 10:37:46', '2024-05-30 22:52:13', 5, '대하여 민족문화의 체결·공포된 모든 증거인멸의.'), - (5, '2024-01-28 13:24:30', '2024-05-30 11:49:11', 13, '일반적으로 저작자·발명가·과학기술자와 바에 예술가의.'), - (1, '2023-06-08 20:56:37', '2024-05-30 14:48:57', 49, '효력을 침해받지 청구할 모든 동일한 전통문화의 보장하기 도피.'), - (3, '2023-12-08 15:55:56', '2024-05-30 17:00:03', 8, '국내법과 법률로써 의하여 유죄의 평생교육을 필요한 정하는.'), - (1, '2024-04-22 21:33:40', '2024-05-31 00:09:49', 40, '범죄에 아니하며, 판결이 전통문화의 때까지는.'), - (1, '2023-11-29 01:39:58', '2024-05-30 12:03:29', 29, '민족문화의 정하는 비밀과 범하고 창달에 의무를 있다..'), - (5, '2023-12-06 02:35:39', '2024-05-30 17:23:13', 6, '계승·발전과 저작자·발명가·과학기술자와 거듭 필요한 위하여 바에 의하여 때까지는.'), - (4, '2024-04-04 22:13:23', '2024-05-30 13:49:32', 14, '처벌받지 헌법에 조약과 예술가의.'), - (4, '2024-04-24 09:22:19', '2024-05-30 20:26:12', 46, '국가는 아니하는 국민은 확정될 죄를 무상으로.'), - (4, '2023-09-22 10:40:12', '2024-05-31 07:14:26', 44, '창달에 거듭 가진다. 죄를.'), - (5, '2023-08-23 11:16:05', '2024-05-30 17:14:14', 24, '모든 사항은 무죄로 정한다. 때에는 경우와 추정된다..'), - (4, '2024-01-07 17:45:44', '2024-05-30 10:07:43', 14, '해당하는 예술가의 정한다. 때에는 동일한.'); - -/** - * 챌린지 인증 46개 INSERT - */ -INSERT INTO challenge_verification (created_at, last_modified_at, user_challenge_id, content, image_url, status) -VALUES ('2024-05-27 23:36:28', '2024-05-30 22:07:47', 32, '아니하며, 국제법규는 시설기준과 추정된다. 국민은 경우와 정하는.', - 'https://picsum.photos/seed/OV8iAi12r/640/480', 'WAITING'), - ('2023-10-02 05:57:27', '2024-05-30 11:26:27', 48, '거듭 다만, 재외국민을 국내법과.', - 'https://picsum.photos/seed/bIVjmsl/640/480', 'WAITING'), - ('2023-11-25 00:15:07', '2024-05-30 18:15:22', 35, '사생활의 정한다. 있다. 다만, 진흥하여야 모든 국제법규는 보호를 무죄로.', - 'https://picsum.photos/seed/EAo7ksdS4S/640/480', 'WAITING'), - ('2024-03-26 17:41:21', '2024-05-30 22:24:52', 12, '정하는 해당하는 처벌받지 사항은 시설기준과 신문의 장기 계승·발전과.', - 'https://picsum.photos/seed/dkAQgU/640/480', 'APPROVED'), - ('2024-03-03 23:59:43', '2024-05-31 03:31:50', 20, '확정될 아니한다. 진흥하여야 행위시의 또는.', - 'https://picsum.photos/seed/s5Kg1E8CgJ/640/480', 'APPROVED'), - ('2024-04-08 10:16:14', '2024-05-31 07:03:41', 45, '정하는 경우와 바에 국내법과 염려가 모든 3년 의무를 일반적으로.', - 'https://loremflickr.com/640/480?lock=3307173008375808', 'APPROVED'), - ('2024-01-09 17:27:44', '2024-05-30 14:44:44', 18, '조약과 염려가 해당하는 신체의 진다. 현행범인인 처벌받지 국가는 아니하며,.', - 'https://loremflickr.com/640/480?lock=8073837394526208', 'WAITING'), - ('2024-02-09 15:07:09', '2024-05-30 15:47:44', 15, '법률로써 모성의 모든 대하여 사항은 사생활의 재외국민을 현행범인인.', - 'https://picsum.photos/seed/FzACl/640/480', 'WAITING'), - ('2024-05-24 17:25:29', '2024-05-30 11:43:40', 6, '장기 일반적으로 도피 통신·방송의 이상의.', - 'https://loremflickr.com/640/480?lock=8850856617181184', 'WAITING'), - ('2023-12-19 14:31:32', '2024-05-31 00:38:07', 30, '헌법에 확정될 때에는 국가는 거듭 유죄의 동일한 정한다. 무죄로.', - 'https://picsum.photos/seed/3beRsIUG/640/480', 'REJECTED'), - ('2024-01-06 20:58:23', '2024-05-30 08:58:54', 35, '헌법에 또는 노력하여야 이상의 침해받지 의하여 아니하며, 의하여 또는 일반적으로.', - 'https://picsum.photos/seed/eIY2VZD6lW/640/480', 'WAITING'), - ('2023-10-03 07:32:10', '2024-05-31 06:54:47', 4, '한다. 같은 추정된다. 현행범인인.', - 'https://picsum.photos/seed/STLvXQtw/640/480', 'APPROVED'), - ('2023-11-12 12:11:00', '2024-05-31 05:42:27', 21, '시설기준과 3년 국민은 증거인멸의 의무를 다만, 대하여 사후에.', - 'https://picsum.photos/seed/6qoeQ/640/480', 'APPROVED'), - ('2023-10-31 16:57:12', '2024-05-31 07:38:53', 46, '비밀과 거듭 의무교육은 또는.', - 'https://loremflickr.com/640/480?lock=751997642866688', 'APPROVED'), - ('2024-01-12 09:34:39', '2024-05-30 16:58:17', 5, '평생교육을 처벌받지 신체의 또는 비밀과 의하여 유죄의 전통문화의.', - 'https://loremflickr.com/640/480?lock=977042266914816', 'WAITING'), - ('2024-03-03 11:47:21', '2024-05-30 09:31:42', 23, '범하고 전통문화의 추정된다. 국민은 때에는 국내법과 정한다..', - 'https://picsum.photos/seed/Ubre0hdn5o/640/480', 'WAITING'), - ('2023-06-05 21:30:34', '2024-05-30 08:37:29', 49, '국내법과 소추되지 계승·발전과 자유를.', - 'https://picsum.photos/seed/qpvVM/640/480', 'REJECTED'), - ('2024-05-02 04:32:43', '2024-05-30 21:13:00', 45, '국제법규는 확정될 판결이 조약과 영장을 수 민족문화의 또는 권리는.', - 'https://picsum.photos/seed/maLRUt/640/480', 'WAITING'), - ('2024-04-01 09:34:49', '2024-05-31 07:29:11', 18, '진흥하여야 경우와 구성하지.', - 'https://picsum.photos/seed/Jl65yd/640/480', 'WAITING'), - ('2024-02-08 10:59:57', '2024-05-30 21:51:10', 26, '수 있을 대하여 있을.', 'https://picsum.photos/seed/rvGrI/640/480', - 'REJECTED'), - ('2024-05-07 06:17:17', '2024-05-30 08:15:12', 22, '도피 때까지는 기능을 소추되지.', - 'https://picsum.photos/seed/lMTHy0/640/480', 'WAITING'), - ('2023-06-02 13:06:03', '2024-05-30 14:52:57', 20, '행위로 처벌받지 3년 권리는 3년 국민은 국민은 처벌받지.', - 'https://loremflickr.com/640/480?lock=875057383473152', 'WAITING'), - ('2023-08-23 12:47:47', '2024-05-30 10:43:14', 20, '수 수 진흥하여야 통신·방송의 아니한다. 또는.', - 'https://picsum.photos/seed/Z6P2F/640/480', 'REJECTED'), - ('2023-11-10 08:55:25', '2024-05-30 09:55:18', 5, '확정될 국민은 염려가 무상으로 계승·발전과 의무교육은 염려가.', - 'https://loremflickr.com/640/480?lock=1780859287896064', 'APPROVED'), - ('2023-09-09 12:47:05', '2024-05-30 20:43:48', 9, '구성하지 범죄에 수 형사피고인은.', - 'https://loremflickr.com/640/480?lock=6912995984670720', 'REJECTED'), - ('2024-05-16 23:32:52', '2024-05-31 03:01:52', 38, '장기 자유를 범죄에 자유를 헌법에 소추되지.', - 'https://loremflickr.com/640/480?lock=8885057074757632', 'WAITING'), - ('2024-01-05 03:29:29', '2024-05-30 22:12:25', 12, '진다. 자유를 있을 법률이 현행범인인.', - 'https://loremflickr.com/640/480?lock=2034077018357760', 'WAITING'), - ('2023-06-11 13:03:15', '2024-05-31 04:08:27', 35, '모성의 때까지는 도피 침해받지 때까지는 국제법규는 현행범인인 보장하기.', - 'https://loremflickr.com/640/480?lock=5503189021360128', 'WAITING'), - ('2023-12-04 03:53:35', '2024-05-30 23:30:01', 21, '형에 증거인멸의 이상의.', - 'https://picsum.photos/seed/DlxpJBGDgW/640/480', 'REJECTED'), - ('2023-06-06 23:04:43', '2024-05-30 16:11:53', 5, '헌법에 모성의 비밀과 수 민족문화의 바에 모든 비밀과 장기 해당하는.', - 'https://picsum.photos/seed/OHPX6N5V/640/480', 'WAITING'), - ('2024-02-29 12:39:10', '2024-05-31 04:35:03', 8, '모든 모든 국내법과 보호를 장기 아니한다..', - 'https://picsum.photos/seed/gD7tPI/640/480', 'WAITING'), - ('2024-01-27 15:35:24', '2024-05-30 11:17:38', 25, '창달에 의하여 가진다. 보호할 국제법규는 법률에 모성의 처벌받지 또는.', - 'https://loremflickr.com/640/480?lock=6543254577217536', 'WAITING'), - ('2023-12-17 02:48:49', '2024-05-30 09:30:41', 15, '때에는 처벌받지 범하고 전통문화의 사생활의 같은 동일한 구성하지 사항은.', - 'https://picsum.photos/seed/f05NY/640/480', 'APPROVED'), - ('2023-09-16 10:16:18', '2024-05-31 07:51:56', 28, '정한다. 청구할 침해받지 의무를 현행범인인 국민은 진다. 경우와.', - 'https://picsum.photos/seed/tG8KWBS/640/480', 'APPROVED'), - ('2024-03-30 22:22:02', '2024-05-31 01:01:01', 8, '대하여 염려가 범죄에 민족문화의 동일한 체결·공포된 증거인멸의 일반적으로.', - 'https://picsum.photos/seed/9t4X1/640/480', 'APPROVED'), - ('2023-09-20 20:49:03', '2024-05-31 05:19:59', 36, '아니하는 국내법과 의무교육은 같은 신체의 자유를 처벌받지 아니한다. 보호할.', - 'https://loremflickr.com/640/480?lock=4057641114402816', 'WAITING'), - ('2024-03-12 15:56:44', '2024-05-30 09:32:35', 6, '구성하지 있을 승인된 모든 재외국민을 염려가 국가는 노력하여야 의무교육은 거듭.', - 'https://picsum.photos/seed/98YgXMyzYW/640/480', 'REJECTED'), - ('2024-02-17 17:00:06', '2024-05-31 03:43:45', 42, '재외국민을 재외국민을 평생교육을.', - 'https://loremflickr.com/640/480?lock=4100285760798720', 'APPROVED'), - ('2024-02-08 09:43:06', '2024-05-30 16:17:47', 30, '추정된다. 대하여 행위시의 추정된다. 판결이 염려가 신문의.', - 'https://picsum.photos/seed/oV6An/640/480', 'APPROVED'), - ('2023-09-11 19:02:14', '2024-05-30 20:28:34', 32, '수 행위시의 일반적으로.', - 'https://loremflickr.com/640/480?lock=3881982306025472', 'APPROVED'), - ('2023-10-07 10:54:13', '2024-05-30 23:25:39', 32, '아니하며, 무죄로 모든 법률이.', - 'https://picsum.photos/seed/2clkBeTzp/640/480', 'APPROVED'), - ('2024-04-03 17:37:32', '2024-05-30 21:38:46', 39, '3년 모든 죄를 동일한 범죄에 가진다. 모성의.', - 'https://loremflickr.com/640/480?lock=3000785430380544', 'REJECTED'), - ('2023-12-05 03:53:40', '2024-05-30 16:26:27', 28, '신문의 국제법규는 사후에 국민은 신체의 영장을 자유를.', - 'https://picsum.photos/seed/BRN7QF/640/480', 'REJECTED'), - ('2024-02-11 22:18:52', '2024-05-31 07:20:35', 14, '창달에 사항은 판결이 국가는 있다..', - 'https://loremflickr.com/640/480?lock=4741877037268992', 'WAITING'), - ('2023-07-29 19:05:24', '2024-05-31 02:31:04', 37, '기능을 침해받지 사항은 통신·방송의 판결이 통신·방송의 자유를 창달에 승인된.', - 'https://picsum.photos/seed/aHv99mwiOi/640/480', 'REJECTED'), - ('2023-08-09 06:57:01', '2024-05-30 10:35:12', 28, '정한다. 바에 신체의 필요한 3년 범하고 유죄의 평생교육을 권리는.', - 'https://loremflickr.com/640/480?lock=5358013936304128', 'REJECTED'); diff --git a/zzansuni-api-server/app/src/main/resources/db/migration/V1__init.sql b/zzansuni-api-server/app/src/main/resources/db/migration/V1__init.sql index ad430af..41d842a 100644 --- a/zzansuni-api-server/app/src/main/resources/db/migration/V1__init.sql +++ b/zzansuni-api-server/app/src/main/resources/db/migration/V1__init.sql @@ -2,107 +2,114 @@ CREATE TABLE users ( id BIGINT NOT NULL AUTO_INCREMENT, exp INTEGER NOT NULL, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, - auth_token VARCHAR(255), - email VARCHAR(255) UNIQUE, - nickname VARCHAR(255) NOT NULL, - password VARCHAR(255), + auth_token VARCHAR(128), + email VARCHAR(255) NOT NULL, + nickname VARCHAR(50) NOT NULL, + password VARCHAR(128), profile_image_url VARCHAR(255), provider ENUM('KAKAO', 'NAVER'), role ENUM('ADMIN', 'MANAGER', 'USER') NOT NULL, - PRIMARY KEY (id) + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, + PRIMARY KEY (id), + CONSTRAINT uk_users_email UNIQUE (email) ) ENGINE=InnoDB; CREATE TABLE challenge_group ( - id BIGINT NOT NULL AUTO_INCREMENT, - cumulative_count INTEGER NOT NULL, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, - content VARCHAR(255) NOT NULL, - guide VARCHAR(255) NOT NULL, - title VARCHAR(255) NOT NULL, + id BIGINT NOT NULL AUTO_INCREMENT, + title VARCHAR(100) NOT NULL, + content VARCHAR(1000) NOT NULL, + guide VARCHAR(1000) NOT NULL, category ENUM('ECHO', 'ETC', 'HEALTH', 'SHARE', 'VOLUNTEER') NOT NULL, - PRIMARY KEY (id) + join_start_date DATE NOT NULL, + join_end_date DATE NOT NULL, + cumulative_count INTEGER NOT NULL, + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, + PRIMARY KEY (id), + INDEX idx_challenge_group_join_start_date_join_end_date_category (join_start_date, join_end_date, category) ) ENGINE=InnoDB; CREATE TABLE challenge ( - id BIGINT NOT NULL AUTO_INCREMENT, - difficulty INTEGER NOT NULL, - end_date DATE NOT NULL, + id BIGINT NOT NULL AUTO_INCREMENT, + challenge_group_id BIGINT NOT NULL, once_exp INTEGER NOT NULL, - required_count INTEGER NOT NULL, - start_date DATE NOT NULL, success_exp INTEGER NOT NULL, - challenge_group_id BIGINT NOT NULL, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, - day_type ENUM('DAY', 'MONTH', 'WEEK', 'YEAR') NOT NULL, + difficulty INTEGER NOT NULL, + required_count INTEGER NOT NULL, + active_period INTEGER NOT NULL, + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, PRIMARY KEY (id), - CONSTRAINT FK_challenge_challenge_group FOREIGN KEY (challenge_group_id) REFERENCES challenge_group (id) + CONSTRAINT fk_challenge_challenge_group FOREIGN KEY (challenge_group_id) REFERENCES challenge_group (id) ) ENGINE=InnoDB; CREATE TABLE challenge_group_image ( - id BIGINT NOT NULL AUTO_INCREMENT, - challenge_group_id BIGINT NOT NULL, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, + id BIGINT NOT NULL AUTO_INCREMENT, + challenge_group_id BIGINT NOT NULL, image_url VARCHAR(255) NOT NULL, + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, PRIMARY KEY (id), - CONSTRAINT FK_challenge_group_image_challenge_group FOREIGN KEY (challenge_group_id) REFERENCES challenge_group (id) + CONSTRAINT fk_challenge_group_image_challenge_group FOREIGN KEY (challenge_group_id) REFERENCES challenge_group (id) ) ENGINE=InnoDB; CREATE TABLE challenge_group_user_exp ( - id BIGINT NOT NULL AUTO_INCREMENT, + id BIGINT NOT NULL AUTO_INCREMENT, total_exp INTEGER NOT NULL, - challenge_group_id BIGINT NOT NULL, - user_id BIGINT NOT NULL, + challenge_group_id BIGINT NOT NULL, + user_id BIGINT NOT NULL, PRIMARY KEY (id), - CONSTRAINT UK_challenge_group_user_exp_challenge_group_user UNIQUE (challenge_group_id, user_id), - CONSTRAINT FK_challenge_group_user_exp_challenge_group FOREIGN KEY (challenge_group_id) REFERENCES challenge_group (id), - CONSTRAINT FK_challenge_group_user_exp_users FOREIGN KEY (user_id) REFERENCES users (id) + CONSTRAINT uk_challenge_group_user_exp_challenge_group_user UNIQUE (challenge_group_id, user_id), + CONSTRAINT fk_challenge_group_user_exp_challenge_group FOREIGN KEY (challenge_group_id) REFERENCES challenge_group (id), + CONSTRAINT fk_challenge_group_user_exp_users FOREIGN KEY (user_id) REFERENCES users (id) ) ENGINE=InnoDB; CREATE TABLE user_challenge ( - id BIGINT NOT NULL AUTO_INCREMENT, - challenge_id BIGINT NOT NULL, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, - user_id BIGINT NOT NULL, - status ENUM('FAIL', 'PROCEEDING', 'SUCCESS') NOT NULL, + id BIGINT NOT NULL AUTO_INCREMENT, + challenge_id BIGINT NOT NULL, + user_id BIGINT NOT NULL, + active_start_date DATE NOT NULL, + active_end_date DATE NOT NULL, + status ENUM('FAIL', 'PROCEEDING', 'SUCCESS') NOT NULL, + success_date DATE, + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, PRIMARY KEY (id), - CONSTRAINT UK_user_challenge_challenge_user UNIQUE (challenge_id, user_id), - CONSTRAINT FK_user_challenge_challenge FOREIGN KEY (challenge_id) REFERENCES challenge (id), - CONSTRAINT FK_user_challenge_users FOREIGN KEY (user_id) REFERENCES users (id) + CONSTRAINT uk_user_challenge_challenge_user UNIQUE (challenge_id, user_id), + CONSTRAINT fk_user_challenge_challenge FOREIGN KEY (challenge_id) REFERENCES challenge (id), + CONSTRAINT fk_user_challenge_users FOREIGN KEY (user_id) REFERENCES users (id) ) ENGINE=InnoDB; CREATE TABLE challenge_review ( - id BIGINT NOT NULL AUTO_INCREMENT, - rating INTEGER NOT NULL, - challenge_group_id BIGINT NOT NULL, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, - user_challenge_id BIGINT NOT NULL, - content VARCHAR(255) NOT NULL, + id BIGINT NOT NULL AUTO_INCREMENT, + challenge_group_id BIGINT NOT NULL, + user_challenge_id BIGINT NOT NULL, + rating INTEGER NOT NULL, + content VARCHAR(1000) NOT NULL, + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, PRIMARY KEY (id), - CONSTRAINT FK_challenge_review_user_challenge FOREIGN KEY (user_challenge_id) REFERENCES user_challenge (id) + CONSTRAINT fk_challenge_review_user_challenge FOREIGN KEY (user_challenge_id) REFERENCES user_challenge (id), + INDEX idx_challenge_review_challenge_group_id (challenge_group_id) ) ENGINE=InnoDB; CREATE TABLE challenge_verification ( - id BIGINT NOT NULL AUTO_INCREMENT, - created_at DATETIME(6) NOT NULL, - last_modified_at DATETIME(6) NOT NULL, - user_challenge_id BIGINT NOT NULL, - content VARCHAR(255) NOT NULL, + id BIGINT NOT NULL AUTO_INCREMENT, + user_challenge_id BIGINT NOT NULL, + content VARCHAR(1000) NOT NULL, image_url VARCHAR(255), - status ENUM('APPROVED', 'REJECTED', 'WAITING'), + status ENUM('PRE_APPROVED', 'APPROVED', 'REJECTED'), + created_at DATETIME(0) NOT NULL, + modified_at DATETIME(0) NOT NULL, PRIMARY KEY (id), - CONSTRAINT FK_challenge_verification_user_challenge FOREIGN KEY (user_challenge_id) REFERENCES user_challenge (id) + CONSTRAINT fk_challenge_verification_user_challenge FOREIGN KEY (user_challenge_id) REFERENCES user_challenge (id) ) ENGINE=InnoDB; + From 9e6324712d43369f087d8153c95bbf92a97e9dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:06:56 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[Feat]:=20DB=20JPA=20=EC=A0=81=EC=9A=A9=20(?= =?UTF-8?q?#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../challengegroup/domain/Challenge.java | 14 +++---------- .../challengegroup/domain/ChallengeGroup.java | 21 +++++++++++++++---- .../domain/ChallengeReview.java | 7 ++++++- .../common/domain/BaseTimeEntity.java | 4 ++-- .../org/haedal/zzansuni/user/domain/User.java | 7 +++++-- .../domain/ChallengeGroupUserExp.java | 12 +++++------ .../domain/ChallengeVerification.java | 4 ++-- .../domain/ChallengeVerificationStatus.java | 2 +- .../userchallenge/domain/UserChallenge.java | 10 ++++++++- .../domain/application/RecordServiceTest.java | 2 +- 10 files changed, 52 insertions(+), 31 deletions(-) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java index 8300c77..1455d97 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java @@ -25,12 +25,6 @@ public class Challenge extends BaseTimeEntity { @JoinColumn(name = "challenge_group_id") private ChallengeGroup challengeGroup; - @Column(nullable = false) - private Integer requiredCount; - - @Enumerated(EnumType.STRING) - @Column(nullable = false) - private DayType dayType; @Column(nullable = false) private Integer onceExp; @@ -42,22 +36,20 @@ public class Challenge extends BaseTimeEntity { private Integer difficulty; @Column(nullable = false) - private LocalDate startDate; + private Integer requiredCount; @Column(nullable = false) - private LocalDate endDate; + private Integer activePeriod; public static Challenge create(ChallengeGroupCommand.CreateChallenge command, ChallengeGroup group) { return Challenge.builder() .challengeGroup(group) .requiredCount(command.getRequiredCount()) - .dayType(command.getDayType()) .onceExp(command.getOnceExp()) .successExp(command.getSuccessExp()) .difficulty(command.getDifficulty()) - .startDate(command.getStartDate()) - .endDate(command.getEndDate()) + .activePeriod(command.getActivePeriod()) .build(); } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java index ac7f4d8..551fb3c 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java @@ -8,6 +8,7 @@ import lombok.NoArgsConstructor; import org.haedal.zzansuni.common.domain.BaseTimeEntity; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; @@ -16,24 +17,36 @@ @AllArgsConstructor @Builder @Getter +@Table( + indexes = { + @Index(name = "idx_challenge_group_join_start_date_join_end_date_category", columnList = "join_start_date, join_end_date, category"), + } +) public class ChallengeGroup extends BaseTimeEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; + @Column(nullable = false, length = 100) + private String title; + + @Column(nullable = false, length = 1000) + private String content; + + @Column(nullable = false, length = 1000) + private String guide; + @Enumerated(EnumType.STRING) @Column(nullable = false) private ChallengeCategory category; @Column(nullable = false) - private String title; + private LocalDate joinStartDate; @Column(nullable = false) - private String content; + private LocalDate joinEndDate; - @Column(nullable = false) - private String guide; @Column(nullable = false) private Integer cumulativeCount; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java index 1265323..cfa0d34 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java @@ -15,6 +15,11 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @Getter @Builder +@Table( + indexes = { + @Index(name = "idx_challenge_review_challenge_group_id", columnList = "challenge_group_id"), + } +) public class ChallengeReview extends BaseTimeEntity { @Id @@ -25,7 +30,7 @@ public class ChallengeReview extends BaseTimeEntity { @JoinColumn(name = "user_challenge_id", nullable = false) private UserChallenge userChallenge; - @Column(nullable = false) + @Column(nullable = false, length = 1000) private String content; @Column(nullable = false) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java index f8afe55..1aabfc6 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/common/domain/BaseTimeEntity.java @@ -15,10 +15,10 @@ public class BaseTimeEntity { @CreatedDate - @Column(name = "created_at") + @Column(name = "created_at", columnDefinition = "DATETIME(0)") private LocalDateTime createdAt; @LastModifiedDate - @Column(name = "modified_at") + @Column(name = "modified_at", columnDefinition = "DATETIME(0)") private LocalDateTime modifiedAt; } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/user/domain/User.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/user/domain/User.java index b852223..12521ba 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/user/domain/User.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/user/domain/User.java @@ -11,7 +11,9 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @Builder @AllArgsConstructor -@Table(name = "users") +@Table(name = "users", uniqueConstraints = { + @UniqueConstraint(columnNames = {"email"}, name = "uk_users_email"), +}) public class User extends BaseTimeEntity { @Id @@ -25,9 +27,9 @@ public class User extends BaseTimeEntity { @Column(nullable = false) private Role role; - @Column(unique = true) private String email; + @Column(length = 128) private String password; @Column(nullable = false) @@ -36,6 +38,7 @@ public class User extends BaseTimeEntity { @Enumerated(EnumType.STRING) private OAuth2Provider provider; + @Column(length = 128) private String authToken; private String profileImageUrl; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeGroupUserExp.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeGroupUserExp.java index f6ac3e3..ed41bb0 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeGroupUserExp.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeGroupUserExp.java @@ -11,12 +11,12 @@ @AllArgsConstructor @Builder @Table( - uniqueConstraints = { - @UniqueConstraint( - name = "challenge_group_user_exp_unique", - columnNames = {"challenge_group_id", "user_id"} - ) - } + uniqueConstraints = { + @UniqueConstraint( + name = "uk_challenge_group_user_exp_challenge_group_user", + columnNames = {"challenge_group_id", "user_id"} + ) + } ) public class ChallengeGroupUserExp { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerification.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerification.java index a6dccad..30a5a59 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerification.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerification.java @@ -22,7 +22,7 @@ public class ChallengeVerification extends BaseTimeEntity { private String imageUrl; - @Column(nullable = false) + @Column(nullable = false, length = 1000) private String content; @Enumerated(EnumType.STRING) @@ -34,7 +34,7 @@ public static ChallengeVerification create(ChallengeCommand.VerificationCreate c .userChallenge(userChallenge) .imageUrl(command.getImageUrl()) .content(command.getContent()) - .status(ChallengeVerificationStatus.APPROVED) + .status(ChallengeVerificationStatus.PRE_APPROVED) .build(); } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerificationStatus.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerificationStatus.java index 244ed63..080ea96 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerificationStatus.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeVerificationStatus.java @@ -4,7 +4,7 @@ @RequiredArgsConstructor public enum ChallengeVerificationStatus { - WAITING("대기중"), + PRE_APPROVED("예비승인"), APPROVED("승인"), REJECTED("거절"); diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/UserChallenge.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/UserChallenge.java index e34f4e3..97aeabc 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/UserChallenge.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/UserChallenge.java @@ -26,7 +26,7 @@ @Table( uniqueConstraints = { @UniqueConstraint( - name = "user_challenge_unique", + name = "uk_user_challenge_challenge_user", columnNames = {"challenge_id", "user_id"} ) } @@ -49,6 +49,14 @@ public class UserChallenge extends BaseTimeEntity { @Column(nullable = false) private ChallengeStatus status; + @Column(nullable = false) + private LocalDate activeStartDate; + + @Column(nullable = false) + private LocalDate activeEndDate; + + private LocalDate successDate; + @OneToMany(mappedBy = "userChallenge", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) private List challengeVerifications = new ArrayList<>(); diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java index 8d0c6d8..67a5cf0 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java @@ -106,7 +106,7 @@ void setUp() { .userChallenge(userChallenge) .imageUrl("http://example.com/image.jpg") .content("Test Verification") - .status(ChallengeVerificationStatus.APPROVED) + .status(ChallengeVerificationStatus.PRE_APPROVED) .build(); challengeReview = ChallengeReview.builder() From aefb340380f4ee1158e1288ab9e2c2f1e9ead138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:13:07 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[Feat]:=20DayType=20=EC=A0=9C=EA=B1=B0=20(#?= =?UTF-8?q?76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../haedal/zzansuni/admin/controller/AdminReq.java | 7 ------- .../controller/ChallengeGroupRes.java | 3 --- .../zzansuni/challengegroup/domain/Challenge.java | 2 +- .../domain/ChallengeGroupCommand.java | 14 ++++---------- .../zzansuni/challengegroup/domain/DayType.java | 5 ----- .../domain/application/ChallengeModel.java | 5 ----- .../domain/application/UserChallengeModel.java | 4 ---- .../ChallengeGroupQueryServiceTest.java | 3 --- .../application/ChallengeGroupServiceTest.java | 11 ----------- .../domain/userchallenge/UserChallengeTest.java | 6 ------ .../domain/application/RecordServiceTest.java | 3 --- .../domain/application/UserRecordServiceTest.java | 3 --- 12 files changed, 5 insertions(+), 61 deletions(-) delete mode 100644 zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/DayType.java diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/admin/controller/AdminReq.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/admin/controller/AdminReq.java index de47092..9669b02 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/admin/controller/AdminReq.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/admin/controller/AdminReq.java @@ -4,7 +4,6 @@ import jakarta.validation.constraints.NotNull; import org.haedal.zzansuni.challengegroup.domain.ChallengeCategory; import org.haedal.zzansuni.challengegroup.domain.ChallengeGroupCommand; -import org.haedal.zzansuni.challengegroup.domain.DayType; import java.time.LocalDate; import java.util.List; @@ -37,9 +36,6 @@ public record CreateChallengeRequest( @NotNull(message = "startDate는 필수값입니다.") LocalDate startDate, @NotNull(message = "endDate는 필수값입니다.") - LocalDate endDate, - @NotNull(message = "dayType은 필수값입니다.") - DayType dayType, @NotNull(message = "requiredCount는 필수값입니다.") Integer requiredCount, @NotNull(message = "onceExp는 필수값입니다.") @@ -51,9 +47,6 @@ public record CreateChallengeRequest( ){ public ChallengeGroupCommand.CreateChallenge toCommand() { return ChallengeGroupCommand.CreateChallenge.builder() - .startDate(startDate) - .endDate(endDate) - .dayType(dayType) .requiredCount(requiredCount) .onceExp(onceExp) .successExp(successExp) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/controller/ChallengeGroupRes.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/controller/ChallengeGroupRes.java index 6c9cf4b..0aba7e3 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/controller/ChallengeGroupRes.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/controller/ChallengeGroupRes.java @@ -4,7 +4,6 @@ import org.haedal.zzansuni.user.controller.UserRes; import org.haedal.zzansuni.challengegroup.domain.ChallengeCategory; import org.haedal.zzansuni.challengegroup.domain.application.ChallengeGroupModel; -import org.haedal.zzansuni.challengegroup.domain.DayType; import org.haedal.zzansuni.challengegroup.domain.application.ChallengeModel; import org.haedal.zzansuni.userchallenge.domain.application.ChallengeGroupRankingModel; import org.springframework.data.domain.Page; @@ -109,7 +108,6 @@ public record Challenge( Integer difficulty, Integer onceExp, Integer successExp, - DayType dayType, Integer dayCount ) { public static Challenge from( @@ -121,7 +119,6 @@ public static Challenge from( .difficulty(challenge.difficulty()) .onceExp(challenge.onceExp()) .successExp(challenge.successExp()) - .dayType(challenge.dayType()) .dayCount(challenge.requiredCount()) .build(); } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java index 1455d97..c7d1e96 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/Challenge.java @@ -45,10 +45,10 @@ public class Challenge extends BaseTimeEntity { public static Challenge create(ChallengeGroupCommand.CreateChallenge command, ChallengeGroup group) { return Challenge.builder() .challengeGroup(group) - .requiredCount(command.getRequiredCount()) .onceExp(command.getOnceExp()) .successExp(command.getSuccessExp()) .difficulty(command.getDifficulty()) + .requiredCount(command.getRequiredCount()) .activePeriod(command.getActivePeriod()) .build(); } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroupCommand.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroupCommand.java index 162d2b5..f44b56f 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroupCommand.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroupCommand.java @@ -36,12 +36,6 @@ public Create(String title, String content, String guide, ChallengeCategory cate @Getter public static class CreateChallenge extends SelfValidating { - @NotNull(message = "startDate는 필수값입니다.") - private final LocalDate startDate; - @NotNull(message = "endDate는 필수값입니다.") - private final LocalDate endDate; - @NotNull(message = "dayType은 필수값입니다.") - private final DayType dayType; @NotNull(message = "requiredCount는 필수값입니다.") private final Integer requiredCount; @NotNull(message = "onceExp는 필수값입니다.") @@ -50,16 +44,16 @@ public static class CreateChallenge extends SelfValidating { private final Integer successExp; @NotNull(message = "difficulty는 필수값입니다.") private final Integer difficulty; + @NotNull(message = "activePeriod는 필수값입니다.") + private final Integer activePeriod; @Builder - public CreateChallenge(LocalDate startDate, LocalDate endDate, DayType dayType, Integer requiredCount, Integer onceExp, Integer successExp, Integer difficulty) { - this.startDate = startDate; - this.endDate = endDate; - this.dayType = dayType; + public CreateChallenge(Integer requiredCount, Integer onceExp, Integer successExp, Integer difficulty, Integer activePeriod) { this.requiredCount = requiredCount; this.onceExp = onceExp; this.successExp = successExp; this.difficulty = difficulty; + this.activePeriod = activePeriod; this.validateSelf(); } } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/DayType.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/DayType.java deleted file mode 100644 index 255e2cc..0000000 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/DayType.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.haedal.zzansuni.challengegroup.domain; - -public enum DayType { - DAY, WEEK, MONTH, YEAR -} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeModel.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeModel.java index 8151606..90e2509 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeModel.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeModel.java @@ -3,7 +3,6 @@ import lombok.Builder; import lombok.Getter; import org.haedal.zzansuni.challengegroup.domain.Challenge; -import org.haedal.zzansuni.challengegroup.domain.DayType; import java.time.LocalDate; @@ -16,7 +15,6 @@ public class ChallengeModel { public record Main( Long id, Integer requiredCount, - DayType dayType, Integer onceExp, Integer successExp, Integer difficulty, @@ -27,12 +25,9 @@ public static Main from(Challenge challenge) { return Main.builder() .id(challenge.getId()) .requiredCount(challenge.getRequiredCount()) - .dayType(challenge.getDayType()) .onceExp(challenge.getOnceExp()) .successExp(challenge.getSuccessExp()) .difficulty(challenge.getDifficulty()) - .startDate(challenge.getStartDate()) - .endDate(challenge.getEndDate()) .build(); } } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java index 3f877c2..e1b748f 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeModel.java @@ -32,8 +32,6 @@ public static Record from( .title(challengeGroup.getTitle()) .totalCount(challenge.getRequiredCount()) .successCount(challengeVerificationList.size()) - .startDate(challenge.getStartDate()) - .endDate(challenge.getEndDate()) .recordIds(challengeVerificationList.stream() .map(ChallengeVerification::getId) .collect(Collectors.toList())) @@ -62,8 +60,6 @@ public static Current from(UserChallenge userChallenge, Boolean reviewWritten) { .totalCount(challenge.getRequiredCount()) .successCount(userChallenge.getChallengeVerifications().size()) .participationDate(userChallenge.getCreatedAt()) - .startDate(challenge.getStartDate()) - .endDate(challenge.getEndDate()) .category(challenge.getChallengeGroup().getCategory()) .reviewWritten(reviewWritten) .build(); diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupQueryServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupQueryServiceTest.java index f0422ec..d265715 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupQueryServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupQueryServiceTest.java @@ -65,12 +65,9 @@ void getChallengeGroupDetail() { Challenge challenge = Challenge.builder() .challengeGroup(challengeGroup) .requiredCount(12) - .dayType(DayType.WEEK) .successExp(100) .onceExp(10) .difficulty(3) - .startDate(LocalDate.now()) - .endDate(LocalDate.now().plusDays(7)) .build(); challengeRepository.save(challenge); diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupServiceTest.java index 9a0ac09..bdb02cc 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupServiceTest.java @@ -29,9 +29,6 @@ void createChallengeGroup() { LocalDate startDate = LocalDate.of(2021, 1, 1); // given ChallengeGroupCommand.CreateChallenge createChallenge = ChallengeGroupCommand.CreateChallenge.builder() - .startDate(startDate) - .endDate(startDate.plusDays(7)) - .dayType(DayType.WEEK) .requiredCount(1) .onceExp(100) .successExp(100) @@ -61,8 +58,6 @@ void createChallengeGroup() { assertThat(challengeGroup.getChallenges().size()).isEqualTo(1); Challenge challenge = challengeGroup.getChallenges().get(0); - assertThat(challenge.getStartDate()).isEqualTo(startDate); - assertThat(challenge.getEndDate()).isEqualTo(startDate.plusDays(7)); } @@ -83,22 +78,16 @@ void deleteChallengeGroup() { Challenge challenge1 = Challenge.builder() .challengeGroup(challengeGroup) .requiredCount(1) - .dayType(DayType.WEEK) .onceExp(100) .successExp(100) .difficulty(2) - .startDate(LocalDate.now()) - .endDate(LocalDate.now().plusDays(7)) .build(); Challenge challenge2 = Challenge.builder() .challengeGroup(challengeGroup) .requiredCount(1) - .dayType(DayType.WEEK) .onceExp(100) .successExp(100) .difficulty(2) - .startDate(LocalDate.now()) - .endDate(LocalDate.now().plusDays(7)) .build(); challengeRepository.save(challenge1); challengeRepository.save(challenge2); diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/domain/userchallenge/UserChallengeTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/domain/userchallenge/UserChallengeTest.java index 15248bd..ff7f8a7 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/domain/userchallenge/UserChallengeTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/domain/userchallenge/UserChallengeTest.java @@ -29,12 +29,9 @@ public class UserChallengeTest { Challenge challenge = Challenge.builder() .challengeGroup(createChallengeGroup()) .requiredCount(2) - .dayType(DayType.WEEK) .onceExp(100) .successExp(100) .difficulty(2) - .startDate(LocalDate.of(2021, 1, 1)) - .endDate(LocalDate.of(2024, 1, 1)) .build(); UserChallenge userChallenge = createUserChallenge(challenge); @@ -140,12 +137,9 @@ private Challenge createChallenge() { return Challenge.builder() .challengeGroup(challengeGroup) .requiredCount(2) - .dayType(DayType.WEEK) .onceExp(100) .successExp(100) .difficulty(2) - .startDate(LocalDate.of(2021, 1, 1)) - .endDate(LocalDate.of(2024, 1, 1)) .build(); } diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java index 67a5cf0..52be987 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java @@ -86,12 +86,9 @@ void setUp() { .id(1L) .challengeGroup(challengeGroup) .requiredCount(10) - .dayType(DayType.DAY) .onceExp(10) .successExp(50) .difficulty(1) - .startDate(LocalDate.now()) - .endDate(LocalDate.now().plusDays(30)) .build(); userChallenge = UserChallenge.builder() diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java index ec8aaa6..12338da 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java @@ -96,12 +96,9 @@ void setUp() { .id(1L) .challengeGroup(challengeGroup) .requiredCount(10) - .dayType(DayType.DAY) .onceExp(10) .successExp(50) .difficulty(1) - .startDate(LocalDate.now()) - .endDate(LocalDate.now().plusDays(30)) .build(); userChallenge = UserChallenge.builder() From a64fb9cd68f71b29a1544731ee49271d3132ee1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:15:00 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[Feat]:=20=EA=B0=9C=ED=96=89=20(#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zzansuni/challengegroup/domain/ChallengeGroup.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java index 551fb3c..1639ff7 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeGroup.java @@ -18,9 +18,12 @@ @Builder @Getter @Table( - indexes = { - @Index(name = "idx_challenge_group_join_start_date_join_end_date_category", columnList = "join_start_date, join_end_date, category"), - } + indexes = { + @Index( + name = "idx_challenge_group_join_start_date_join_end_date_category", + columnList = "join_start_date, join_end_date, category" + ), + } ) public class ChallengeGroup extends BaseTimeEntity { From a261b5eb95dc599f5429c2f57e1c477ac3228272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:19:49 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[Feat]:=20=EB=A6=AC=EB=B7=B0=20=ED=8C=A8?= =?UTF-8?q?=ED=82=A4=EC=A7=80=20=EC=9D=B4=EB=8F=99=20(#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/ChallengeCommand.java | 19 ----------- .../controller/ChallengeReviewController.java | 9 +++--- .../controller/ChallengeReviewReq.java | 20 ++++++++++++ .../domain/ChallengeReview.java | 9 ++---- .../domain/ChallengeReviewCommand.java | 32 +++++++++++++++++++ .../domain/ChallengeReviewService.java | 3 +- .../controller/ChallengeReq.java | 12 ------- .../domain/application/RecordServiceTest.java | 9 ++---- 8 files changed, 61 insertions(+), 52 deletions(-) create mode 100644 zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewReq.java create mode 100644 zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewCommand.java diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeCommand.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeCommand.java index dc1a205..a997309 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeCommand.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengegroup/domain/ChallengeCommand.java @@ -50,25 +50,6 @@ public VerificationCreate(String content, String imageUrl) { } } - @Getter - public static class ReviewCreate extends SelfValidating { - - @NotBlank(message = "내용은 필수입니다.") - private final String content; - - @NotNull(message = "평점은 필수입니다.") - @Min(1) - @Max(5) - private final Integer rating; - - @Builder - public ReviewCreate(String content, Integer rating) { - this.content = content; - this.rating = rating; - this.validateSelf(); - } - - } } diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java index 6ff9321..aedb588 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java @@ -4,13 +4,12 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.haedal.zzansuni.common.controller.PagingRequest; -import org.haedal.zzansuni.common.controller.PagingResponse; -import org.haedal.zzansuni.core.api.ApiResponse; -import org.haedal.zzansuni.userchallenge.controller.ChallengeReq; import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel.ChallengeReviewWithChallenge; import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel.ChallengeReviewWithUserInfo; import org.haedal.zzansuni.challengereview.domain.ChallengeReviewService; +import org.haedal.zzansuni.common.controller.PagingRequest; +import org.haedal.zzansuni.common.controller.PagingResponse; +import org.haedal.zzansuni.core.api.ApiResponse; import org.haedal.zzansuni.global.jwt.JwtUser; import org.springframework.data.domain.Page; import org.springframework.http.HttpStatus; @@ -67,7 +66,7 @@ public ApiResponse> getChal public ApiResponse challengeReviewCreate( @PathVariable Long challengeId, @AuthenticationPrincipal JwtUser jwtUser, - @RequestBody ChallengeReq.ReviewCreate request + @RequestBody ChallengeReviewReq.Create request ) { Long response = challengeReviewService.createReview(request.toCommand(), challengeId, jwtUser.getId()); diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewReq.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewReq.java new file mode 100644 index 0000000..67add1c --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewReq.java @@ -0,0 +1,20 @@ +package org.haedal.zzansuni.challengereview.controller; + +import io.swagger.v3.oas.annotations.media.Schema; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewCommand; + +public class ChallengeReviewReq { + public record Create( + String content, + @Schema(description = "평점", example = "5") + Integer rating + ) { + + public ChallengeReviewCommand.Create toCommand() { + return ChallengeReviewCommand.Create.builder() + .content(content) + .rating(rating) + .build(); + } + } +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java index cfa0d34..feb9fa7 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java @@ -1,13 +1,8 @@ package org.haedal.zzansuni.challengereview.domain; import jakarta.persistence.*; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; +import lombok.*; import org.haedal.zzansuni.common.domain.BaseTimeEntity; -import org.haedal.zzansuni.challengegroup.domain.ChallengeCommand; import org.haedal.zzansuni.userchallenge.domain.UserChallenge; @Entity @@ -40,7 +35,7 @@ public class ChallengeReview extends BaseTimeEntity { @Column(nullable = false) private Long challengeGroupId; - public static ChallengeReview create(UserChallenge userChallenge, ChallengeCommand.ReviewCreate command) { + public static ChallengeReview create(UserChallenge userChallenge, ChallengeReviewCommand.Create command) { Long challengeGroupId = userChallenge.getChallenge().getChallengeGroupId(); return ChallengeReview.builder() .userChallenge(userChallenge) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewCommand.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewCommand.java new file mode 100644 index 0000000..d555d1e --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewCommand.java @@ -0,0 +1,32 @@ +package org.haedal.zzansuni.challengereview.domain; + +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Builder; +import lombok.Getter; +import org.haedal.zzansuni.core.utils.SelfValidating; + +public class ChallengeReviewCommand { + @Getter + public static class Create extends SelfValidating { + + @NotBlank(message = "내용은 필수입니다.") + private final String content; + + @NotNull(message = "평점은 필수입니다.") + @Min(1) + @Max(5) + private final Integer rating; + + @Builder + public Create(String content, Integer rating) { + this.content = content; + this.rating = rating; + this.validateSelf(); + } + + + } +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java index 2f56398..1394d70 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java @@ -2,7 +2,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.haedal.zzansuni.challengegroup.domain.ChallengeCommand; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeReader; import org.haedal.zzansuni.userchallenge.domain.UserChallenge; import org.springframework.data.domain.Page; @@ -25,7 +24,7 @@ public class ChallengeReviewService { * 챌린지 리뷰 작성하기 */ @Transactional - public Long createReview(ChallengeCommand.ReviewCreate command, Long challengeId, Long userId) { + public Long createReview(ChallengeReviewCommand.Create command, Long challengeId, Long userId) { UserChallenge userChallenge = userChallengeReader.findByUserIdAndChallengeId(userId, challengeId).orElseThrow(() -> new IllegalStateException("해당 챌린지 참여 기록이 없습니다.")); diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReq.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReq.java index ef56bf3..4610a52 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReq.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReq.java @@ -19,18 +19,6 @@ public ChallengeCommand.Verificate toCommand(MultipartFile image) { } - public record ReviewCreate( - String content, - @Schema(description = "평점", example = "5") - Integer rating - ) { - public ChallengeCommand.ReviewCreate toCommand() { - return ChallengeCommand.ReviewCreate.builder() - .content(content) - .rating(rating) - .build(); - } - } } diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java index 52be987..0927c21 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java @@ -1,15 +1,10 @@ package org.haedal.zzansuni.userchallenge.domain.application; -import java.time.LocalDate; import org.haedal.zzansuni.challengegroup.domain.*; import org.haedal.zzansuni.challengegroup.domain.port.ChallengeReader; -import org.haedal.zzansuni.challengereview.domain.ChallengeReview; -import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel; -import org.haedal.zzansuni.challengereview.domain.ChallengeReviewService; +import org.haedal.zzansuni.challengereview.domain.*; import org.haedal.zzansuni.userchallenge.domain.*; -import org.haedal.zzansuni.challengereview.domain.ChallengeReviewReader; -import org.haedal.zzansuni.challengereview.domain.ChallengeReviewStore; import org.haedal.zzansuni.userchallenge.domain.port.ChallengeVerificationReader; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeReader; import org.haedal.zzansuni.user.domain.User; @@ -150,7 +145,7 @@ void getChallengeRecordDetail() { void createReview() { Long userId = 1L; Long challengeId = 1L; - ChallengeCommand.ReviewCreate command = new ChallengeCommand.ReviewCreate( + ChallengeReviewCommand.Create command = new ChallengeReviewCommand.Create( "Great challenge!", 5); when(userChallengeReader.findByUserIdAndChallengeId(userId, challengeId)).thenReturn(