Skip to content

Commit

Permalink
Release v2.0.2 (#12)
Browse files Browse the repository at this point in the history
* [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 : 오타 변경
  • Loading branch information
kssumin authored Mar 16, 2024
1 parent 53ae503 commit 2a30eb1
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 131 deletions.
7 changes: 5 additions & 2 deletions eeos/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -31,7 +31,7 @@ services:
ports:
- "16379:6379"
environment:
- REDIS_PASSWORD=${DB_PASSWORD}
- REDIS_PASSWORD=root
networks:
- eeos-network
backend:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -15,7 +15,7 @@
@RequiredArgsConstructor
@Slf4j
public class DeletedProgramEventListener {
private final CommandAttendService attendService;
private final AttendRepository attendRepository;

@Async
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
Expand All @@ -24,6 +24,6 @@ public void handleDeletedProgram(DeletedProgramEvent event) {
log.info(
"프로그램 삭제 Transaction committed: {}",
TransactionSynchronizationManager.isActualTransactionActive());
attendService.deleteByProgram(event.getProgramId());
attendRepository.deleteAllByProgramId(event.getProgramId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.blackcompany.eeos.target.application.dto.TargetMember;
import java.util.List;

public interface TargetService {
public interface CommandTargetMemberService {

/** 관련 대상자를 선택한다. */
<T extends TargetMember> void save(final Long eventId, final List<T> members);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@RequiredArgsConstructor
@Transactional(readOnly = true)
public abstract class SelectTargetService {
public abstract class SelectTargetMemberService {
private final MemberRepository memberRepository;
private final MemberEntityConverter memberEntityConverter;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions eeos/src/main/resources/application-redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ spring:
activate:
on-profile: redis
redis:
host: ${REDIS_HOST}
port : ${REDIS_PORT}
password: ${REDIS_PASSWORD}
host: ${SPRING_REDIS_HOST}
port : ${SPRING_REDIS_PORT}
password: ${SPRING_REDIS_PASSWORD}
Empty file.
13 changes: 0 additions & 13 deletions eeos/src/main/resources/db/migration/V01__alter_table.sql

This file was deleted.

22 changes: 0 additions & 22 deletions eeos/src/main/resources/db/migration/V02__add_table.sql

This file was deleted.

This file was deleted.

104 changes: 104 additions & 0 deletions eeos/src/main/resources/db/migration/V1.00.0.0__init_tables.sql
Original file line number Diff line number Diff line change
@@ -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;








5 changes: 4 additions & 1 deletion eeos/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@
</root>
</springProfile>
<springProfile name="dev">
<root level="warn">
<root level="info">
<appender-ref ref="CONSOLE"/>
</root>
<logger name="org.springframework.web" level="warn">
<appender-ref ref="FILE"/>
</logger>
</springProfile>
<springProfile name="prod">
<root level="info">
<appender-ref ref="CONSOLE"/>
</root>
<logger name="org.springframework.web" level="warn">
<appender-ref ref="FILE"/>
</logger>
Expand Down
Loading

0 comments on commit 2a30eb1

Please sign in to comment.