From 2a30eb1d6d47c79f5ccbfccc0e5bd8256457471f Mon Sep 17 00:00:00 2001 From: mando <88534959+kssumin@users.noreply.github.com> Date: Sat, 16 Mar 2024 21:14:13 +0900 Subject: [PATCH] Release v2.0.2 (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FIX] flyway를 재설정한다. (#5) * refactor : 대상 멤버를 저장하는 클래스명 명시적으로 변경 * refactor : service 호출이 아니라 repository에 직접적으로 의존하도록 변경 * refactor : 대상자 member임을 명시하도록 클래스명 변경 * refactor : 팀빌딩 대상자 멤버 대상자를 저장한다는걸 나타내기 위해 클래스명 변경 * chore : 팀빌딩 대상자 관련 service teambuilding 패키지로 변경 * fix : 모든 테이블을 flyway로 형상관리 하도록 변경 * [FIX] 배포 중 발생한 오류를 해결 (#11) * fix : redis docker-compose로부터 주입받도록 변경 * fix : info부터 console에 출력하도록 변경 * fix : 오타 변경 --- eeos/docker-compose.yml | 7 +- .../event/DeletedProgramEventListener.java | 6 +- .../application/service/ProgramService.java | 4 +- .../service/CommandAttendService.java | 21 ---- ...e.java => CommandTargetMemberService.java} | 2 +- ...tendCommandTargetMemberMemberService.java} | 6 +- ...ce.java => SelectTargetMemberService.java} | 2 +- ...mmandTeamBuildingTargetMemberService.java} | 9 +- .../service/TeamBuildingService.java | 3 +- eeos/src/main/resources/application-redis.yml | 6 +- .../db/migration/V00__init__table.sql | 0 .../db/migration/V01__alter_table.sql | 13 --- .../resources/db/migration/V02__add_table.sql | 22 ---- .../migration/V03__add_teambuilding_table.sql | 46 -------- .../db/migration/V1.00.0.0__init_tables.sql | 104 ++++++++++++++++++ ...l_table.sql => V1.00.0.1__init_values.sql} | 0 eeos/src/main/resources/logback-spring.xml | 5 +- ...AttendCommandTargetMemberServiceTest.java} | 4 +- ...SelectCommandTargetMemberServiceTest.java} | 4 +- ...ildingCommandTargetMemberServiceTest.java} | 6 +- .../service/TeamBuildingServiceTest.java | 3 +- 21 files changed, 142 insertions(+), 131 deletions(-) delete mode 100644 eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandAttendService.java rename eeos/src/main/java/com/blackcompany/eeos/target/application/service/{TargetService.java => CommandTargetMemberService.java} (85%) rename eeos/src/main/java/com/blackcompany/eeos/target/application/service/{SelectAttendTargetService.java => SelectAttendCommandTargetMemberMemberService.java} (96%) rename eeos/src/main/java/com/blackcompany/eeos/target/application/service/{SelectTargetService.java => SelectTargetMemberService.java} (97%) rename eeos/src/main/java/com/blackcompany/eeos/{target/application/service/SelectTeamBuildingTargetService.java => teamBuilding/application/service/CommandTeamBuildingTargetMemberService.java} (78%) delete mode 100644 eeos/src/main/resources/db/migration/V00__init__table.sql delete mode 100644 eeos/src/main/resources/db/migration/V01__alter_table.sql delete mode 100644 eeos/src/main/resources/db/migration/V02__add_table.sql delete mode 100644 eeos/src/main/resources/db/migration/V03__add_teambuilding_table.sql create mode 100644 eeos/src/main/resources/db/migration/V1.00.0.0__init_tables.sql rename eeos/src/main/resources/db/migration/{V04__add_teambuilding_inital_table.sql => V1.00.0.1__init_values.sql} (100%) rename eeos/src/test/java/com/blackcompany/eeos/target/application/service/{SelectAttendTargetServiceTest.java => SelectAttendCommandTargetMemberServiceTest.java} (93%) rename eeos/src/test/java/com/blackcompany/eeos/target/application/service/{SelectTargetServiceTest.java => SelectCommandTargetMemberServiceTest.java} (95%) rename eeos/src/test/java/com/blackcompany/eeos/target/application/service/{SelectTeamBuildingTargetServiceTest.java => SelectTeamBuildingCommandTargetMemberServiceTest.java} (89%) diff --git a/eeos/docker-compose.yml b/eeos/docker-compose.yml index 7c1a6c2e..150e3806 100644 --- a/eeos/docker-compose.yml +++ b/eeos/docker-compose.yml @@ -6,7 +6,7 @@ services: environment: - MYSQL_DATABASE=eeos - MYSQL_ROOT_HOST=% - - MYSQL_ROOT_PASSWORD=${DB_PASSWORD} + - MYSQL_ROOT_PASSWORD=root command: [ "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--skip-character-set-client-handshake", "--lower_case_table_names=1", "--max_connections=2048", "--wait_timeout=3600" ] ports: - "13306:3306" @@ -31,7 +31,7 @@ services: ports: - "16379:6379" environment: - - REDIS_PASSWORD=${DB_PASSWORD} + - REDIS_PASSWORD=root networks: - eeos-network backend: @@ -51,6 +51,9 @@ services: SPRING_DATASOURCE_USERNAME: root SPRING_DATASOURCE_PASSWORD: root SPRING_PROFILES_ACTIVE: ${PROFILE} + SPRING_REDIS_HOST: localhost + SPRING_REDIS_PORT: 6379 + SPRING_REDIS_PASSWORD: root networks: #사용할 네트워크 지정 - eeos-network networks: diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/event/DeletedProgramEventListener.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/event/DeletedProgramEventListener.java index 85508c0f..83edcf4e 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/event/DeletedProgramEventListener.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/application/event/DeletedProgramEventListener.java @@ -1,6 +1,6 @@ package com.blackcompany.eeos.program.application.event; -import com.blackcompany.eeos.target.application.service.CommandAttendService; +import com.blackcompany.eeos.target.persistence.AttendRepository; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; @@ -15,7 +15,7 @@ @RequiredArgsConstructor @Slf4j public class DeletedProgramEventListener { - private final CommandAttendService attendService; + private final AttendRepository attendRepository; @Async @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) @@ -24,6 +24,6 @@ public void handleDeletedProgram(DeletedProgramEvent event) { log.info( "프로그램 삭제 Transaction committed: {}", TransactionSynchronizationManager.isActualTransactionActive()); - attendService.deleteByProgram(event.getProgramId()); + attendRepository.deleteAllByProgramId(event.getProgramId()); } } diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java index 108cfc08..25210dcf 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java @@ -29,7 +29,7 @@ import com.blackcompany.eeos.program.persistence.ProgramCategory; import com.blackcompany.eeos.program.persistence.ProgramEntity; import com.blackcompany.eeos.program.persistence.ProgramRepository; -import com.blackcompany.eeos.target.application.service.SelectAttendTargetService; +import com.blackcompany.eeos.target.application.service.SelectAttendCommandTargetMemberMemberService; import java.sql.Timestamp; import java.time.LocalDate; import java.util.List; @@ -55,7 +55,7 @@ public class ProgramService private final ProgramEntityConverter entityConverter; private final ProgramResponseConverter responseConverter; private final ProgramRepository programRepository; - private final SelectAttendTargetService attendTargetService; + private final SelectAttendCommandTargetMemberMemberService attendTargetService; private final ProgramPageResponseConverter pageResponseConverter; private final ProgramStatusServiceComposite programStatusComposite; private final ApplicationEventPublisher applicationEventPublisher; diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandAttendService.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandAttendService.java deleted file mode 100644 index 4c6f6e18..00000000 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandAttendService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.blackcompany.eeos.target.application.service; - -import com.blackcompany.eeos.target.persistence.AttendRepository; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -@RequiredArgsConstructor -@Transactional(readOnly = true) -@Slf4j -public class CommandAttendService { - private final AttendRepository attendRepository; - - @Transactional - public void deleteByProgram(Long programId) { - log.info("프로그램 삭제로 인한 해당 프로그램의 참석 정보 삭제"); - attendRepository.deleteAllByProgramId(programId); - } -} diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/TargetService.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandTargetMemberService.java similarity index 85% rename from eeos/src/main/java/com/blackcompany/eeos/target/application/service/TargetService.java rename to eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandTargetMemberService.java index 65c532ef..94bbe5bb 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/TargetService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/CommandTargetMemberService.java @@ -3,7 +3,7 @@ import com.blackcompany.eeos.target.application.dto.TargetMember; import java.util.List; -public interface TargetService { +public interface CommandTargetMemberService { /** 관련 대상자를 선택한다. */ void save(final Long eventId, final List members); diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectAttendTargetService.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectAttendCommandTargetMemberMemberService.java similarity index 96% rename from eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectAttendTargetService.java rename to eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectAttendCommandTargetMemberMemberService.java index 26aaafc2..be193b1e 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectAttendTargetService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectAttendCommandTargetMemberMemberService.java @@ -22,12 +22,12 @@ @Service @Transactional(readOnly = true) -public class SelectAttendTargetService extends SelectTargetService - implements TargetService, AttendTargetService { +public class SelectAttendCommandTargetMemberMemberService extends SelectTargetMemberService + implements CommandTargetMemberService, AttendTargetService { private final AttendRepository attendRepository; private final AttendEntityConverter entityConverter; - public SelectAttendTargetService( + public SelectAttendCommandTargetMemberMemberService( MemberRepository memberRepository, MemberEntityConverter memberEntityConverter, AttendRepository attendRepository, diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTargetService.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTargetMemberService.java similarity index 97% rename from eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTargetService.java rename to eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTargetMemberService.java index 1e34be2b..f723b5ac 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTargetService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTargetMemberService.java @@ -13,7 +13,7 @@ @RequiredArgsConstructor @Transactional(readOnly = true) -public abstract class SelectTargetService { +public abstract class SelectTargetMemberService { private final MemberRepository memberRepository; private final MemberEntityConverter memberEntityConverter; diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingTargetService.java b/eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/CommandTeamBuildingTargetMemberService.java similarity index 78% rename from eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingTargetService.java rename to eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/CommandTeamBuildingTargetMemberService.java index 8ee6e2e2..dbdf8f76 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingTargetService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/CommandTeamBuildingTargetMemberService.java @@ -1,9 +1,11 @@ -package com.blackcompany.eeos.target.application.service; +package com.blackcompany.eeos.teamBuilding.application.service; import com.blackcompany.eeos.member.application.model.converter.MemberEntityConverter; import com.blackcompany.eeos.member.persistence.MemberRepository; import com.blackcompany.eeos.target.application.dto.TargetMember; import com.blackcompany.eeos.target.application.model.converter.TeamBuildingTargetEntityConverter; +import com.blackcompany.eeos.target.application.service.CommandTargetMemberService; +import com.blackcompany.eeos.target.application.service.SelectTargetMemberService; import com.blackcompany.eeos.target.persistence.TeamBuildingTargetEntity; import com.blackcompany.eeos.target.persistence.TeamBuildingTargetRepository; import java.util.List; @@ -13,11 +15,12 @@ @Service @Transactional(readOnly = true) -public class SelectTeamBuildingTargetService extends SelectTargetService implements TargetService { +public class CommandTeamBuildingTargetMemberService extends SelectTargetMemberService + implements CommandTargetMemberService { private final TeamBuildingTargetEntityConverter entityConverter; private final TeamBuildingTargetRepository targetRepository; - public SelectTeamBuildingTargetService( + public CommandTeamBuildingTargetMemberService( MemberRepository memberRepository, MemberEntityConverter memberEntityConverter, TeamBuildingTargetEntityConverter entityConverter, diff --git a/eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingService.java b/eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingService.java index 09b49648..a1201d6e 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingService.java @@ -4,7 +4,6 @@ import com.blackcompany.eeos.member.persistence.MemberRepository; import com.blackcompany.eeos.target.application.model.TeamBuildingTargetModel; import com.blackcompany.eeos.target.application.service.QueryTeamBuildingTargetService; -import com.blackcompany.eeos.target.application.service.SelectTeamBuildingTargetService; import com.blackcompany.eeos.teamBuilding.application.dto.CreateTeamBuildingRequest; import com.blackcompany.eeos.teamBuilding.application.dto.EachMemberResponse; import com.blackcompany.eeos.teamBuilding.application.dto.ResultTeamBuildingResponse; @@ -55,7 +54,7 @@ public class TeamBuildingService private final TeamBuildingRequestConverter requestConverter; private final TeamBuildingEntityConverter entityConverter; private final TeamBuildingRepository teamBuildingRepository; - private final SelectTeamBuildingTargetService teamBuildingTargetService; + private final CommandTeamBuildingTargetMemberService teamBuildingTargetService; private final QueryTeamBuildingService queryTeamBuildingService; private final QueryTeamBuildingTargetService queryTeamBuildingTargetService; private final ClusteringTeamApiClient clusteringTeamApiClient; diff --git a/eeos/src/main/resources/application-redis.yml b/eeos/src/main/resources/application-redis.yml index 1f4aa2d1..f7260fca 100644 --- a/eeos/src/main/resources/application-redis.yml +++ b/eeos/src/main/resources/application-redis.yml @@ -3,6 +3,6 @@ spring: activate: on-profile: redis redis: - host: ${REDIS_HOST} - port : ${REDIS_PORT} - password: ${REDIS_PASSWORD} \ No newline at end of file + host: ${SPRING_REDIS_HOST} + port : ${SPRING_REDIS_PORT} + password: ${SPRING_REDIS_PASSWORD} \ No newline at end of file diff --git a/eeos/src/main/resources/db/migration/V00__init__table.sql b/eeos/src/main/resources/db/migration/V00__init__table.sql deleted file mode 100644 index e69de29b..00000000 diff --git a/eeos/src/main/resources/db/migration/V01__alter_table.sql b/eeos/src/main/resources/db/migration/V01__alter_table.sql deleted file mode 100644 index 11944c33..00000000 --- a/eeos/src/main/resources/db/migration/V01__alter_table.sql +++ /dev/null @@ -1,13 +0,0 @@ -use eeos; - -ALTER TABLE member - ADD COLUMN member_oath_server_type VARCHAR(255) NOT NULL; -ALTER TABLE member - ADD COLUMN member_active_status VARCHAR(255) NOT NULL; -ALTER TABLE member - DROP COLUMN member_generation; -CREATE INDEX idx_member_active_status ON member (member_active_status); -CREATE INDEX idx_member_name ON member (member_name); -DROP INDEX idx_generation_name ON member; - -CREATE INDEX idx_attend_status ON attend (attend_status); diff --git a/eeos/src/main/resources/db/migration/V02__add_table.sql b/eeos/src/main/resources/db/migration/V02__add_table.sql deleted file mode 100644 index 9638abae..00000000 --- a/eeos/src/main/resources/db/migration/V02__add_table.sql +++ /dev/null @@ -1,22 +0,0 @@ -create table auth_info -( - auth_info_id BIGINT not null auto_increment, - created_date DATETIME(6) not null, - is_deleted BOOLEAN not null, - updated_date DATETIME(6) not null, - auth_info_member_id BIGINT not null, - auth_info_token varchar(255) not null, - primary key (auth_info_id), - INDEX idx_auth_info_member_id (auth_info_member_id) -) engine = InnoDB; - -create table oauth_info -( - oauth_info_id BIGINT not null auto_increment, - created_date DATETIME(6) not null, - is_deleted BOOLEAN not null, - updated_date DATETIME(6) not null, - oauth_info_member_id BIGINT not null, - oauth_info_oauth_id VARCHAR(255) not null, - primary key (oauth_info_id) -) engine = InnoDB; \ No newline at end of file diff --git a/eeos/src/main/resources/db/migration/V03__add_teambuilding_table.sql b/eeos/src/main/resources/db/migration/V03__add_teambuilding_table.sql deleted file mode 100644 index 8193566f..00000000 --- a/eeos/src/main/resources/db/migration/V03__add_teambuilding_table.sql +++ /dev/null @@ -1,46 +0,0 @@ -create table restrict_team_building ( - restrict_team_building_id bigint not null auto_increment, - created_date datetime(6) not null, - is_deleted bit not null, - updated_date datetime(6) not null, - restrict_team_building_total_active_count bigint not null, - version bigint, - primary key (restrict_team_building_id) -) engine=InnoDB; - - -create table team_building ( - team_building_id bigint not null auto_increment, - created_date datetime(6) not null, - is_deleted bit not null, - updated_date datetime(6) not null, - team_building_content varchar(255) not null, - team_building_max_team_size integer not null, - team_building_member_id bigint not null, - team_building_status varchar(255) not null, - team_building_title varchar(255) not null, - primary key (team_building_id) -) engine=InnoDB; - - -create table team_building_result ( - team_building_result_id bigint not null auto_increment, - created_date datetime(6) not null, - is_deleted bit not null, - updated_date datetime(6) not null, - team_building_result_member_ids varchar(255) not null, - team_building_result_status bigint not null, - primary key (team_building_result_id) -) engine=InnoDB; - -create table team_building_target ( - team_building_target_id bigint not null auto_increment, - created_date datetime(6) not null, - is_deleted bit not null, - updated_date datetime(6) not null, - team_building_input_content varchar(255), - team_building_input_status varchar(255) not null, - team_building_target_member_id bigint not null, - team_building_target_team_building_id bigint not null, - primary key (team_building_target_id) -) engine=InnoDB \ No newline at end of file diff --git a/eeos/src/main/resources/db/migration/V1.00.0.0__init_tables.sql b/eeos/src/main/resources/db/migration/V1.00.0.0__init_tables.sql new file mode 100644 index 00000000..0a267217 --- /dev/null +++ b/eeos/src/main/resources/db/migration/V1.00.0.0__init_tables.sql @@ -0,0 +1,104 @@ +CREATE TABLE `member` ( + `member_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime NOT NULL, + `is_deleted` tinyint(1) NOT NULL, + `updated_date` datetime NOT NULL, + `member_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `member_oath_server_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `member_active_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`member_id`), + KEY `idx_member_active_status` (`member_active_status`), + KEY `idx_member_name` (`member_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `oauth_member` ( + `oauth_member_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime(6) NOT NULL, + `is_deleted` tinyint(1) NOT NULL, + `updated_date` datetime(6) NOT NULL, + `oauth_member_member_id` bigint NOT NULL, + `oauth_member_oauth_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`oauth_member_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `program` ( + `program_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime NOT NULL, + `is_deleted` tinyint(1) NOT NULL, + `updated_date` datetime NOT NULL, + `program_content` text COLLATE utf8mb4_unicode_ci NOT NULL, + `program_date` timestamp NOT NULL, + `program_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `program_category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `program_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `program_writer` bigint NOT NULL, + PRIMARY KEY (`program_id`), + KEY `idx_program_date` (`program_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `attend` ( + `attend_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime NOT NULL, + `is_deleted` tinyint(1) NOT NULL, + `updated_date` datetime NOT NULL, + `attend_program_id` bigint NOT NULL, + `attend_member_id` bigint NOT NULL, + `attend_status` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`attend_id`), + KEY `idx_program` (`attend_program_id`), + KEY `idx_attend_status` (`attend_status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `team_building` ( + `team_building_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime(6) NOT NULL, + `is_deleted` bit(1) NOT NULL, + `updated_date` datetime(6) NOT NULL, + `team_building_content` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `team_building_max_team_size` int NOT NULL, + `team_building_member_id` bigint NOT NULL, + `team_building_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `team_building_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`team_building_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `team_building_target` ( + `team_building_target_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime(6) NOT NULL, + `is_deleted` bit(1) NOT NULL, + `updated_date` datetime(6) NOT NULL, + `team_building_input_content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `team_building_input_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `team_building_target_member_id` bigint NOT NULL, + `team_building_target_team_building_id` bigint NOT NULL, + PRIMARY KEY (`team_building_target_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `team_building_result` ( + `team_building_result_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime(6) NOT NULL, + `is_deleted` bit(1) NOT NULL, + `updated_date` datetime(6) NOT NULL, + `team_building_result_member_ids` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `team_building_result_status` bigint NOT NULL, + PRIMARY KEY (`team_building_result_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE `restrict_team_building` ( + `restrict_team_building_id` bigint NOT NULL AUTO_INCREMENT, + `created_date` datetime(6) NOT NULL, + `is_deleted` bit(1) NOT NULL, + `updated_date` datetime(6) NOT NULL, + `restrict_team_building_total_active_count` bigint NOT NULL, + `version` bigint DEFAULT NULL, + PRIMARY KEY (`restrict_team_building_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + + + + + + + diff --git a/eeos/src/main/resources/db/migration/V04__add_teambuilding_inital_table.sql b/eeos/src/main/resources/db/migration/V1.00.0.1__init_values.sql similarity index 100% rename from eeos/src/main/resources/db/migration/V04__add_teambuilding_inital_table.sql rename to eeos/src/main/resources/db/migration/V1.00.0.1__init_values.sql diff --git a/eeos/src/main/resources/logback-spring.xml b/eeos/src/main/resources/logback-spring.xml index 034a9203..366208f1 100644 --- a/eeos/src/main/resources/logback-spring.xml +++ b/eeos/src/main/resources/logback-spring.xml @@ -37,7 +37,7 @@ - + @@ -45,6 +45,9 @@ + + + diff --git a/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectAttendTargetServiceTest.java b/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectAttendCommandTargetMemberServiceTest.java similarity index 93% rename from eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectAttendTargetServiceTest.java rename to eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectAttendCommandTargetMemberServiceTest.java index 6b637195..c71a9388 100644 --- a/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectAttendTargetServiceTest.java +++ b/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectAttendCommandTargetMemberServiceTest.java @@ -22,12 +22,12 @@ import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -class SelectAttendTargetServiceTest { +class SelectAttendCommandTargetMemberServiceTest { @Mock private AttendRepository attendRepository; @Spy private AttendEntityConverter entityConverter; @Mock private MemberRepository memberRepository; @Spy private MemberEntityConverter memberEntityConverter; - @InjectMocks private SelectAttendTargetService selectAttendTargetService; + @InjectMocks private SelectAttendCommandTargetMemberMemberService selectAttendTargetService; @Test @DisplayName("대상자를 전달받아 참석 대상자로 저장한다.") diff --git a/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTargetServiceTest.java b/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectCommandTargetMemberServiceTest.java similarity index 95% rename from eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTargetServiceTest.java rename to eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectCommandTargetMemberServiceTest.java index bb44dc35..0809f069 100644 --- a/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTargetServiceTest.java +++ b/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectCommandTargetMemberServiceTest.java @@ -23,10 +23,10 @@ import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -class SelectTargetServiceTest { +class SelectCommandTargetMemberServiceTest { @Mock private MemberRepository memberRepository; @Spy private MemberEntityConverter memberEntityConverter; - @InjectMocks private SelectAttendTargetService selectTargetService; + @InjectMocks private SelectAttendCommandTargetMemberMemberService selectTargetService; @Test @DisplayName("주어진 대상 멤버들로 멤버를 조회한다.") diff --git a/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingTargetServiceTest.java b/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingCommandTargetMemberServiceTest.java similarity index 89% rename from eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingTargetServiceTest.java rename to eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingCommandTargetMemberServiceTest.java index 0072cc1b..9ef5306d 100644 --- a/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingTargetServiceTest.java +++ b/eeos/src/test/java/com/blackcompany/eeos/target/application/service/SelectTeamBuildingCommandTargetMemberServiceTest.java @@ -13,6 +13,7 @@ import com.blackcompany.eeos.target.fixture.TargetMemberFixture; import com.blackcompany.eeos.target.persistence.TeamBuildingTargetRepository; import com.blackcompany.eeos.teamBuilding.application.dto.TeamBuildingMember; +import com.blackcompany.eeos.teamBuilding.application.service.CommandTeamBuildingTargetMemberService; import java.util.List; import java.util.stream.Collectors; import org.junit.jupiter.api.DisplayName; @@ -24,12 +25,13 @@ import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -class SelectTeamBuildingTargetServiceTest { +class SelectTeamBuildingCommandTargetMemberServiceTest { @Mock private TeamBuildingTargetRepository teamBuildingTargetRepository; @Spy private TeamBuildingTargetEntityConverter entityConverter; @Mock private MemberRepository memberRepository; @Spy private MemberEntityConverter memberEntityConverter; - @InjectMocks private SelectTeamBuildingTargetService selectTeamBuildingTargetService; + + @InjectMocks private CommandTeamBuildingTargetMemberService selectTeamBuildingTargetService; @Test @DisplayName("대상자를 전달받아 팀빌딩 대상자로 저장한다.") diff --git a/eeos/src/test/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingServiceTest.java b/eeos/src/test/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingServiceTest.java index 58247b03..8b3a624b 100644 --- a/eeos/src/test/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingServiceTest.java +++ b/eeos/src/test/java/com/blackcompany/eeos/teamBuilding/application/service/TeamBuildingServiceTest.java @@ -4,7 +4,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.blackcompany.eeos.target.application.service.SelectTeamBuildingTargetService; import com.blackcompany.eeos.teamBuilding.application.dto.CreateTeamBuildingRequest; import com.blackcompany.eeos.teamBuilding.application.exception.DeniedEditTeamBuilding; import com.blackcompany.eeos.teamBuilding.application.model.converter.TeamBuildingEntityConverter; @@ -29,7 +28,7 @@ class TeamBuildingServiceTest { @Spy private TeamBuildingRequestConverter requestConverter; @Spy private TeamBuildingEntityConverter entityConverter; @Mock private TeamBuildingRepository teamBuildingRepository; - @Mock private SelectTeamBuildingTargetService teamBuildingTargetService; + @Mock private CommandTeamBuildingTargetMemberService teamBuildingTargetService; @Mock private RestrictTeamBuildingService restrictTeamBuildingService; @InjectMocks private TeamBuildingService teamBuildingService;