From 257f77f380345ea646573d10120979a4ef3215cc Mon Sep 17 00:00:00 2001 From: bbbang105 <2018111366@dgu.ac.kr> Date: Tue, 21 May 2024 05:14:40 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[feat]=20:=20=EC=B4=88=EA=B8=B0=20=EC=82=BD?= =?UTF-8?q?=EC=9E=85=EB=AC=B8=EC=97=90=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/data.sql | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 38bd6f9..642786a 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -1,3 +1,27 @@ +-- 테스트 유저 삽입 +INSERT INTO users (id, name, provider, provider_id, users_uuid, created_date, updated_date) +VALUES (100001, '테스트1', 'kakao', '3471511962', UNHEX(REPLACE('159f4542-ebff-4acd-a603-a4fb4c94526a', '-', '')), LOCALTIMESTAMP, LOCALTIMESTAMP), + (100002, '테스트2', 'kakao', '3471511963', UNHEX(REPLACE('159f4542-ebff-4acd-a603-a4fb4c94526b', '-', '')), LOCALTIMESTAMP, LOCALTIMESTAMP) +ON DUPLICATE KEY UPDATE name = VALUES(name); + +-- 테스트 유저 온보딩 정보 삽입 +INSERT INTO users_onboarding_infos (users_id, nickname, job, understanding_score, profile_img_url, created_date, updated_date) VALUES + (100001, '테스트1', '개발자', '100', '1234asdf', LOCALTIMESTAMP, LOCALTIMESTAMP), + (100002, '테스트2', '개발자', '100', '1234asdf', LOCALTIMESTAMP, LOCALTIMESTAMP) +ON DUPLICATE KEY UPDATE nickname = VALUES(nickname); + +-- 테스트 유저 관심분야 정보 삽입 +INSERT INTO users_interests (id, users_id, interests_id, created_date, updated_date) VALUES + (100001, 100001, 1, LOCALTIMESTAMP, LOCALTIMESTAMP), + (100002, 100002, 1, LOCALTIMESTAMP, LOCALTIMESTAMP) +ON DUPLICATE KEY UPDATE id = VALUES(id); + +-- 테스트 유저 키워드 정보 삽입 +INSERT INTO users_keywords (id, users_id, keywords_id, created_date, updated_date) VALUES + (100001, 100001, 1, LOCALTIMESTAMP, LOCALTIMESTAMP), + (100002, 100002, 1, LOCALTIMESTAMP, LOCALTIMESTAMP) +ON DUPLICATE KEY UPDATE id = VALUES(id); + -- 관심 분야 전체 삽입 INSERT INTO interests (interests_id, name) VALUES (1, '드로잉'), From a24ea7fd92057e9c5483c8c0185d53eadc9ef1fa Mon Sep 17 00:00:00 2001 From: bbbang105 <2018111366@dgu.ac.kr> Date: Tue, 21 May 2024 05:15:08 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[refactor]=20:=20=EA=B8=B8=EC=9D=B4=20?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=2020=EC=9C=BC=EB=A1=9C=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/kusitms/jangkku/domain/user/domain/User.java | 2 +- .../kusitms/jangkku/domain/user/domain/UserOnboardingInfo.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/kusitms/jangkku/domain/user/domain/User.java b/src/main/java/kusitms/jangkku/domain/user/domain/User.java index 4a2896f..3322102 100644 --- a/src/main/java/kusitms/jangkku/domain/user/domain/User.java +++ b/src/main/java/kusitms/jangkku/domain/user/domain/User.java @@ -14,7 +14,7 @@ public class User extends BaseEntity { @Column(name = "users_uuid", columnDefinition = "BINARY(16)", unique = true) private UUID userId; - @Column(name = "name", nullable = false, length = 5) + @Column(name = "name", nullable = false, length = 20) private String name; @Column(name = "provider", nullable = false, length = 10) diff --git a/src/main/java/kusitms/jangkku/domain/user/domain/UserOnboardingInfo.java b/src/main/java/kusitms/jangkku/domain/user/domain/UserOnboardingInfo.java index e01b8b9..9e2078f 100644 --- a/src/main/java/kusitms/jangkku/domain/user/domain/UserOnboardingInfo.java +++ b/src/main/java/kusitms/jangkku/domain/user/domain/UserOnboardingInfo.java @@ -16,7 +16,7 @@ public class UserOnboardingInfo extends BaseEntity { @JoinColumn(name = "users_id", foreignKey = @ForeignKey(name = "users_onboarding_infos_fk_users_id")) private User user; - @Column(name = "nickname", nullable = false, length = 10) + @Column(name = "nickname", nullable = false, length = 20) private String nickname; @Column(name = "job", nullable = false, length = 10) From f59b662b59f7d843d2afe2905b8413a5be85e065 Mon Sep 17 00:00:00 2001 From: bbbang105 <2018111366@dgu.ac.kr> Date: Tue, 21 May 2024 05:15:22 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[refactor]=20:=20orElseThrow=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=B2=98=EB=A6=AC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jangkku/domain/persona/dto/DefinePersonaDto.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/kusitms/jangkku/domain/persona/dto/DefinePersonaDto.java b/src/main/java/kusitms/jangkku/domain/persona/dto/DefinePersonaDto.java index 7706df0..fba06d8 100644 --- a/src/main/java/kusitms/jangkku/domain/persona/dto/DefinePersonaDto.java +++ b/src/main/java/kusitms/jangkku/domain/persona/dto/DefinePersonaDto.java @@ -52,11 +52,7 @@ public static DefinePersonaDto.DefinePersonaResponse of(UUID definePersonaId, St Content content = Arrays.stream(Content.values()) .filter(desc -> desc.getCode().equals(definePersonaCode)) .findFirst() - .orElse(null); - - if (content == null) { - throw new PersonaException(PersonaErrorResult.NOT_FOUND_PERSONA_TYPE); - } + .orElseThrow(() -> new PersonaException(PersonaErrorResult.NOT_FOUND_PERSONA_TYPE)); return DefinePersonaDto.DefinePersonaResponse.builder() .definePersonaId(String.valueOf(definePersonaId))