diff --git a/core/src/main/java/moa/sms/SmsMessageFactory.java b/core/src/main/java/moa/client/sms/SmsMessageFactory.java similarity index 97% rename from core/src/main/java/moa/sms/SmsMessageFactory.java rename to core/src/main/java/moa/client/sms/SmsMessageFactory.java index 7d84c1ee..c723a511 100644 --- a/core/src/main/java/moa/sms/SmsMessageFactory.java +++ b/core/src/main/java/moa/client/sms/SmsMessageFactory.java @@ -1,4 +1,4 @@ -package moa.sms; +package moa.client.sms; import org.springframework.stereotype.Component; diff --git a/core/src/main/java/moa/member/infrastructure/sms/NHNPhoneVerificationNumberSender.java b/core/src/main/java/moa/member/infrastructure/sms/NHNPhoneVerificationNumberSender.java index 2ac8b954..d2e287f3 100644 --- a/core/src/main/java/moa/member/infrastructure/sms/NHNPhoneVerificationNumberSender.java +++ b/core/src/main/java/moa/member/infrastructure/sms/NHNPhoneVerificationNumberSender.java @@ -5,11 +5,11 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import moa.client.sms.SmsClient; +import moa.client.sms.SmsMessageFactory; import moa.member.domain.phone.Phone; import moa.member.domain.phone.PhoneVerificationNumber; import moa.member.domain.phone.PhoneVerificationNumberSender; import moa.member.exception.MemberException; -import moa.sms.SmsMessageFactory; import org.springframework.stereotype.Component; @Slf4j diff --git a/core/src/main/java/moa/order/application/OrderEventHandler.java b/core/src/main/java/moa/order/application/OrderEventHandler.java index 6fd9bf6f..e45d8411 100644 --- a/core/src/main/java/moa/order/application/OrderEventHandler.java +++ b/core/src/main/java/moa/order/application/OrderEventHandler.java @@ -6,6 +6,7 @@ import java.time.LocalDate; import lombok.RequiredArgsConstructor; +import moa.client.sms.SmsMessageFactory; import moa.client.wincube.WincubeClient; import moa.funding.domain.Funding; import moa.funding.domain.FundingFinishEvent; @@ -18,7 +19,6 @@ import moa.order.domain.OrderRepository; import moa.order.domain.OrderTransaction; import moa.order.domain.OrderTransactionRepository; -import moa.sms.SmsMessageFactory; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; diff --git a/core/src/main/java/moa/sms/SmsHistory.java b/core/src/main/java/moa/sms/SmsHistory.java deleted file mode 100644 index 24b15475..00000000 --- a/core/src/main/java/moa/sms/SmsHistory.java +++ /dev/null @@ -1,59 +0,0 @@ -package moa.sms; - -import static jakarta.persistence.EnumType.STRING; -import static jakarta.persistence.GenerationType.IDENTITY; -import static moa.sms.SmsHistory.SmsStatus.BEFORE_SEND; -import static moa.sms.SmsHistory.SmsStatus.ERROR_OCCUR; -import static moa.sms.SmsHistory.SmsStatus.SEND; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.Enumerated; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import moa.global.domain.RootEntity; - -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@Entity -public class SmsHistory extends RootEntity { - - @Id - @GeneratedValue(strategy = IDENTITY) - private Long id; - - @Column(nullable = false) - private String message; - - @Column(nullable = false) - private String phoneNumber; - - private String errorMessage; - - @Enumerated(STRING) - @Column(nullable = false) - private SmsStatus status = BEFORE_SEND; - - public SmsHistory(String message, String phoneNumber) { - this.message = message; - this.phoneNumber = phoneNumber; - } - - public enum SmsStatus { - BEFORE_SEND, - SEND, - ERROR_OCCUR - } - - public void send() { - this.status = SEND; - } - - public void error(String message) { - this.status = ERROR_OCCUR; - this.errorMessage = message; - } -} diff --git a/core/src/main/java/moa/sms/SmsHistoryRepository.java b/core/src/main/java/moa/sms/SmsHistoryRepository.java deleted file mode 100644 index 043db716..00000000 --- a/core/src/main/java/moa/sms/SmsHistoryRepository.java +++ /dev/null @@ -1,6 +0,0 @@ -package moa.sms; - -import org.springframework.data.jpa.repository.JpaRepository; - -public interface SmsHistoryRepository extends JpaRepository { -} diff --git a/core/src/main/resources/db/migration/dev/V1__init_domain.sql b/core/src/main/resources/db/migration/dev/V1__init_domain.sql index 3ab45b2a..4db73fd4 100644 --- a/core/src/main/resources/db/migration/dev/V1__init_domain.sql +++ b/core/src/main/resources/db/migration/dev/V1__init_domain.sql @@ -287,14 +287,3 @@ create table report constraint FK_report_member foreign key (member_id) references member (id) ); - -create table sms_history -( - id bigint auto_increment primary key, - status varchar(255) not null, - message varchar(255) not null, - phone_number varchar(255) not null, - error_message varchar(255), - created_date datetime(6) not null, - updated_date datetime(6) null -); diff --git a/core/src/main/resources/db/migration/local/V1__init_domain.sql b/core/src/main/resources/db/migration/local/V1__init_domain.sql index 64ceb021..be42d215 100644 --- a/core/src/main/resources/db/migration/local/V1__init_domain.sql +++ b/core/src/main/resources/db/migration/local/V1__init_domain.sql @@ -287,14 +287,3 @@ create table if not exists report constraint FK_report_member foreign key (member_id) references member (id) ); - -create table if not exists sms_history -( - id bigint auto_increment primary key, - status varchar(255) not null, - message varchar(255) not null, - phone_number varchar(255) not null, - error_message varchar(255), - created_date datetime(6) not null, - updated_date datetime(6) null -); diff --git a/core/src/main/resources/db/migration/prod/V1__init_domain.sql b/core/src/main/resources/db/migration/prod/V1__init_domain.sql index 3ab45b2a..4db73fd4 100644 --- a/core/src/main/resources/db/migration/prod/V1__init_domain.sql +++ b/core/src/main/resources/db/migration/prod/V1__init_domain.sql @@ -287,14 +287,3 @@ create table report constraint FK_report_member foreign key (member_id) references member (id) ); - -create table sms_history -( - id bigint auto_increment primary key, - status varchar(255) not null, - message varchar(255) not null, - phone_number varchar(255) not null, - error_message varchar(255), - created_date datetime(6) not null, - updated_date datetime(6) null -);