Skip to content

Commit

Permalink
Refactor: 대기열 시스템 구조를 개선한다. (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
hseong3243 authored Aug 17, 2024
2 parents 5b31570 + 020a835 commit 0a99150
Show file tree
Hide file tree
Showing 33 changed files with 45 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import com.thirdparty.ticketing.domain.waiting.room.RunningRoom;
import com.thirdparty.ticketing.domain.waiting.room.WaitingRoom;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class DefaultWaitingManager extends WaitingManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.thirdparty.ticketing.domain.waiting.room.RunningRoom;
import com.thirdparty.ticketing.domain.waiting.room.WaitingRoom;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class DefaultRunningRoom implements RunningRoom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class DefaultWaitingCounter implements WaitingCounter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class DefaultWaitingLine implements WaitingLine {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class DefaultWaitingRoom extends WaitingRoom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public interface RunningRoom {
boolean contains(WaitingMember waitingMember);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.thirdparty.ticketing.domain.waiting.room;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public interface WaitingCounter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public interface WaitingLine {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

import lombok.RequiredArgsConstructor;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.web.context.request.ServletRequestAttributes;

import com.thirdparty.ticketing.domain.waiting.manager.WaitingManager;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

import lombok.RequiredArgsConstructor;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import java.util.Set;

import com.thirdparty.ticketing.domain.common.EventPublisher;
import com.thirdparty.ticketing.domain.waitingsystem.running.RunningManager;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingManager;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.thirdparty.ticketing.domain.waitingsystem.running;

public interface RunningCounter {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.thirdparty.ticketing.domain.waitingsystem;
package com.thirdparty.ticketing.domain.waitingsystem.running;

import java.util.Set;

import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public interface RunningManager {
boolean isReadyToHandle(String email, long performanceId);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.thirdparty.ticketing.domain.waitingsystem.running;

public interface RunningRoom {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.thirdparty.ticketing.domain.waitingsystem.waiting;

public interface WaitingCounter {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.thirdparty.ticketing.domain.waitingsystem.waiting;

public interface WaitingLine {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thirdparty.ticketing.domain.waitingsystem;
package com.thirdparty.ticketing.domain.waitingsystem.waiting;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thirdparty.ticketing.domain.waitingsystem;
package com.thirdparty.ticketing.domain.waitingsystem.waiting;

import java.time.ZonedDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.thirdparty.ticketing.domain.waitingsystem.waiting;

public interface WaitingRoom {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.thirdparty.ticketing.domain.waiting.manager.WaitingManager;
import com.thirdparty.ticketing.domain.waiting.room.RunningRoom;
import com.thirdparty.ticketing.domain.waiting.room.WaitingRoom;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class RedisWaitingManager extends WaitingManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.data.redis.core.SetOperations;

import com.thirdparty.ticketing.domain.waiting.room.RunningRoom;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class RedisRunningRoom implements RunningRoom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.springframework.data.redis.core.ValueOperations;

import com.thirdparty.ticketing.domain.waiting.room.WaitingCounter;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

public class RedisWaitingCounter implements WaitingCounter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.thirdparty.ticketing.domain.waiting.room.WaitingLine;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.ObjectMapperUtils;

public class RedisWaitingLine implements WaitingLine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.thirdparty.ticketing.domain.waiting.room.WaitingCounter;
import com.thirdparty.ticketing.domain.waiting.room.WaitingLine;
import com.thirdparty.ticketing.domain.waiting.room.WaitingRoom;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.ObjectMapperUtils;

public class RedisWaitingRoom extends WaitingRoom {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.thirdparty.ticketing.domain.waiting.room.DefaultWaitingCounter;
import com.thirdparty.ticketing.domain.waiting.room.DefaultWaitingLine;
import com.thirdparty.ticketing.domain.waiting.room.DefaultWaitingRoom;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;

class DefaultWaitingManagerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.StringRedisTemplate;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.room.RedisRunningRoom;
import com.thirdparty.ticketing.support.TestContainerStarter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.room.RedisWaitingCounter;
import com.thirdparty.ticketing.support.TestContainerStarter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.room.RedisWaitingLine;
import com.thirdparty.ticketing.support.TestContainerStarter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;

import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.manager.RedisWaitingManager;
import com.thirdparty.ticketing.support.TestContainerStarter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.thirdparty.ticketing.domain.waitingsystem.WaitingMember;
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember;
import com.thirdparty.ticketing.global.waiting.room.RedisWaitingRoom;
import com.thirdparty.ticketing.support.TestContainerStarter;

Expand Down

0 comments on commit 0a99150

Please sign in to comment.