diff --git a/src/main/java/com/nexters/moyeomoyeo/common/config/SwaggerConfig.java b/src/main/java/com/nexters/moyeomoyeo/common/config/SwaggerConfig.java index d2ea523..d0b193d 100644 --- a/src/main/java/com/nexters/moyeomoyeo/common/config/SwaggerConfig.java +++ b/src/main/java/com/nexters/moyeomoyeo/common/config/SwaggerConfig.java @@ -3,15 +3,15 @@ import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.servers.Server; import lombok.RequiredArgsConstructor; import org.springdoc.core.models.GroupedOpenApi; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @OpenAPIDefinition( - info = @Info(title = "모여모여 API 명세서", - description = "넥스터즈 팀빌딩 서비스 API 명세서", - version = "v1")) + info = @Info(title = "모여모여 API 명세서", description = "넥스터즈 팀빌딩 서비스 API 명세서", version = "v1"), + servers = @Server(url = "/")) @RequiredArgsConstructor @Configuration public class SwaggerConfig { diff --git a/src/main/java/com/nexters/moyeomoyeo/notification/handler/SseEmitterHandler.java b/src/main/java/com/nexters/moyeomoyeo/notification/handler/SseEmitterHandler.java index be74a97..ef24145 100644 --- a/src/main/java/com/nexters/moyeomoyeo/notification/handler/SseEmitterHandler.java +++ b/src/main/java/com/nexters/moyeomoyeo/notification/handler/SseEmitterHandler.java @@ -15,10 +15,10 @@ public class SseEmitterHandler { // key : teamBuildingUuid - private final Map> emitterMap = new ConcurrentHashMap<>(); + private static final Map> EMITTER_MAP = new ConcurrentHashMap<>(); public List getEmitters(String teamBuildingUuid) { - final List emitterList = emitterMap.get(teamBuildingUuid); + final List emitterList = EMITTER_MAP.get(teamBuildingUuid); if (Objects.isNull(emitterList)) { return Collections.emptyList(); @@ -28,11 +28,11 @@ public List getEmitters(String teamBuildingUuid) { } public void add(String teamBuildingUuid, SseEmitter emitter) { - final List emitterList = Objects.isNull(this.emitterMap.get(teamBuildingUuid)) ? - new CopyOnWriteArrayList<>() : this.emitterMap.get(teamBuildingUuid); + final List emitterList = Objects.isNull(EMITTER_MAP.get(teamBuildingUuid)) ? + new CopyOnWriteArrayList<>() : EMITTER_MAP.get(teamBuildingUuid); emitterList.add(emitter); - emitterMap.put(teamBuildingUuid, emitterList); + EMITTER_MAP.put(teamBuildingUuid, emitterList); log.info("new emitter added: {}, {}", teamBuildingUuid, emitter); log.info("emitter list size: {}", emitterList.size()); diff --git a/src/main/java/com/nexters/moyeomoyeo/team_building/service/TeamBuildingAdminService.java b/src/main/java/com/nexters/moyeomoyeo/team_building/service/TeamBuildingAdminService.java index 57c2573..58ab4b1 100644 --- a/src/main/java/com/nexters/moyeomoyeo/team_building/service/TeamBuildingAdminService.java +++ b/src/main/java/com/nexters/moyeomoyeo/team_building/service/TeamBuildingAdminService.java @@ -15,10 +15,8 @@ import com.nexters.moyeomoyeo.team_building.domain.entity.Team; import com.nexters.moyeomoyeo.team_building.domain.entity.TeamBuilding; import com.nexters.moyeomoyeo.team_building.domain.entity.User; - import java.util.List; import java.util.Objects; - import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,9 +43,11 @@ public UserInfo adjustUser(String teamBuildingUuid, String userUuid, String team .filter(team -> Objects.equals(team.getUuid(), teamUuid)) .findFirst() .orElse(null); + user.adjustTeam(targetTeam); - UserInfo userInfo = makeUserInfo(user); + user.updateSelectedRound(Objects.isNull(targetTeam) ? null : RoundStatus.ADJUSTED_ROUND); + UserInfo userInfo = makeUserInfo(user); notificationService.broadCast(teamBuildingUuid, "adjust-user", userInfo); return userInfo; }