From 92dc7818ba5d07c07b010f913b6b0af6e790114a Mon Sep 17 00:00:00 2001 From: gunsight1 Date: Tue, 27 Feb 2024 15:45:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?*=20=ED=83=88=ED=87=B4=20=EC=9D=B4=EB=A0=A5?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20*=20=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t_common_code_and_create_withraw_table.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql diff --git a/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql b/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql new file mode 100644 index 00000000..49e13cf7 --- /dev/null +++ b/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql @@ -0,0 +1,35 @@ +CREATE TABLE if not exists withraw_member +( + member_no bigserial NOT NULL, + id varchar NOT NULL, + email varchar NOT NULL, + ip varchar, + created_at date NOT NULL, + created_by varchar(10485760) NULL, + modified_at date NULL, + modified_by varchar(10485760) NULL +); + + +INSERT INTO public.common_code (code_no, code_name, upper_no, upper_name, sort_order, is_used, description, + sub_description, created_at, created_by, modified_at, modified_by) +VALUES (67, 'OTHERS', 48, NULL, 3, true, '변경필요', NULL, '2024-01-10', 'admin', NULL, NULL) +ON CONFLICT DO NOTHING; +INSERT INTO public.common_code (code_no, code_name, upper_no, upper_name, sort_order, is_used, description, + sub_description, created_at, created_by, modified_at, modified_by) +VALUES (68, 'AGE_99', 51, NULL, 6, true, '변경필요', NULL, '2024-01-10', 'admin', NULL, NULL) +ON CONFLICT DO NOTHING; + +UPDATE public.common_code +SET code_name='MALE', + modified_at = CURRENT_TIMESTAMP, + modified_by = 'admin' +WHERE code_no = 49 +; + +UPDATE public.common_code +SET code_name='FEMALE', + modified_at = CURRENT_TIMESTAMP, + modified_by = 'admin' +WHERE code_no = 50 +; \ No newline at end of file From a0850cf082ec664eb6d89d8641228d63ee3210a6 Mon Sep 17 00:00:00 2001 From: gunsight1 Date: Wed, 28 Feb 2024 14:37:15 +0900 Subject: [PATCH 2/2] =?UTF-8?q?*Withraw=20->=20Withdraw=20=EC=98=A4?= =?UTF-8?q?=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kernel360/member/service/MemberService.java | 8 ++++---- ....8__insert_common_code_and_create_withraw_table.sql | 2 +- .../entity/{WithrawMember.java => WithdrawMember.java} | 10 +++++----- ...erRepository.java => WithdrawMemberRepository.java} | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) rename module-domain/src/main/java/com/kernel360/member/entity/{WithrawMember.java => WithdrawMember.java} (77%) rename module-domain/src/main/java/com/kernel360/member/repository/{WithrawMemberRepository.java => WithdrawMemberRepository.java} (50%) diff --git a/module-api/src/main/java/com/kernel360/member/service/MemberService.java b/module-api/src/main/java/com/kernel360/member/service/MemberService.java index 008c4f72..44d8fcbe 100644 --- a/module-api/src/main/java/com/kernel360/member/service/MemberService.java +++ b/module-api/src/main/java/com/kernel360/member/service/MemberService.java @@ -8,11 +8,11 @@ import com.kernel360.member.code.MemberErrorCode; import com.kernel360.member.dto.*; import com.kernel360.member.entity.Member; -import com.kernel360.member.entity.WithrawMember; +import com.kernel360.member.entity.WithdrawMember; import com.kernel360.member.enumset.Age; import com.kernel360.member.enumset.Gender; import com.kernel360.member.repository.MemberRepository; -import com.kernel360.member.repository.WithrawMemberRepository; +import com.kernel360.member.repository.WithdrawMemberRepository; import com.kernel360.utils.ConvertSHA256; import com.kernel360.utils.JWT; import com.kernel360.washinfo.entity.WashInfo; @@ -39,7 +39,7 @@ public class MemberService { private final CarInfoRepository carInfoRepository; private final WashInfoRepository washInfoRepository; private final KakaoRequest kakaoRequest; - private final WithrawMemberRepository withrawMemberRepository; + private final WithdrawMemberRepository withdrawMemberRepository; @Transactional public void joinMember(MemberDto requestDto) { @@ -224,7 +224,7 @@ public MemberDto loginForKakao(String accessToken) { public void signOut(String accessToken) { Member member = memberRepository.findOneById(jwt.ownerId(accessToken)); - withrawMemberRepository.save(WithrawMember.of(member.getMemberNo(),member.getId(), member.getEmail(), null)); + withdrawMemberRepository.save(WithdrawMember.of(member.getMemberNo(),member.getId(), member.getEmail(), null)); memberRepository.delete(member); } diff --git a/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql b/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql index 49e13cf7..cb3bf045 100644 --- a/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql +++ b/module-api/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql @@ -1,4 +1,4 @@ -CREATE TABLE if not exists withraw_member +CREATE TABLE if not exists withdraw_member ( member_no bigserial NOT NULL, id varchar NOT NULL, diff --git a/module-domain/src/main/java/com/kernel360/member/entity/WithrawMember.java b/module-domain/src/main/java/com/kernel360/member/entity/WithdrawMember.java similarity index 77% rename from module-domain/src/main/java/com/kernel360/member/entity/WithrawMember.java rename to module-domain/src/main/java/com/kernel360/member/entity/WithdrawMember.java index 4e6335b3..25f4c976 100644 --- a/module-domain/src/main/java/com/kernel360/member/entity/WithrawMember.java +++ b/module-domain/src/main/java/com/kernel360/member/entity/WithdrawMember.java @@ -11,9 +11,9 @@ @Getter @Entity -@Table(name = "withraw_member") +@Table(name = "withdraw_member") @NoArgsConstructor(access = AccessLevel.PROTECTED) -public class WithrawMember extends BaseEntity { +public class WithdrawMember extends BaseEntity { @Id @Column(name = "member_no", nullable = false) @@ -29,12 +29,12 @@ public class WithrawMember extends BaseEntity { private String ip; - public static WithrawMember of(Long memberNo, String id, String email, String ip) { + public static WithdrawMember of(Long memberNo, String id, String email, String ip) { - return new WithrawMember(memberNo, id, email, ip); + return new WithdrawMember(memberNo, id, email, ip); } - private WithrawMember( + private WithdrawMember( Long memberNo, String id, String email, diff --git a/module-domain/src/main/java/com/kernel360/member/repository/WithrawMemberRepository.java b/module-domain/src/main/java/com/kernel360/member/repository/WithdrawMemberRepository.java similarity index 50% rename from module-domain/src/main/java/com/kernel360/member/repository/WithrawMemberRepository.java rename to module-domain/src/main/java/com/kernel360/member/repository/WithdrawMemberRepository.java index 1073c9e0..356601ff 100644 --- a/module-domain/src/main/java/com/kernel360/member/repository/WithrawMemberRepository.java +++ b/module-domain/src/main/java/com/kernel360/member/repository/WithdrawMemberRepository.java @@ -1,8 +1,8 @@ package com.kernel360.member.repository; -import com.kernel360.member.entity.WithrawMember; +import com.kernel360.member.entity.WithdrawMember; import jakarta.persistence.Id; import org.springframework.data.jpa.repository.JpaRepository; -public interface WithrawMemberRepository extends JpaRepository { +public interface WithdrawMemberRepository extends JpaRepository { }