Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #28 - waiting, review - controller 작성 #40

Merged
merged 15 commits into from
Nov 21, 2022
Merged

Conversation

chanwooo
Copy link
Contributor

WaitingController 작성

* #23-스프링 액추에이터 추가, 어드민 클라이언트 추가

* #23-springboot admin 버전 명시
* #21-변수명 변경 phone -> phoneNumber

* #21-타입변경 Integer -> int

* #21-안쓰는 파일 삭제

* #21-사용하지않는 필드 제거

* #21-QuingService 일부 구현
append
getList
countForward
doneWaiting

* #21-QuingService test 일부 구현

* #21-주석 삭제

* #21-append 중복 방지 로직 추가

* #21-waiting cancel 구현

* #21-exception 패키지 이동

* #21-test코드 작성

* Feature #22-waiting - 사용자에게 메시지 send 구현 (#27)

* #21-cancel 리턴 타입 변경

* #22-message 전송 관련 부분 print로 임시 구현

* #22-message 전송 관련 부분 test 작성

* #22-test에 불필요한 공백 제거

* #22- test코드 logger 적용

* #22- test코드 given, when, then 분리

* #22- test코드 logger 적용

* #22-리뷰반영
- 테스트 공백, 주석 정리
- 테스트 이름 변경 appendExistThrowDuplicateException

* # Conflicts:
#	src/main/java/flab/quing/user/User.java
#	src/main/java/flab/quing/user/UserRepository.java

* #21-user response import
- 로그인한 가게(storeManager-store)의 대기열 목록(get quing)
- 로그인한 유저의 현재 대기순서(get quing/count-forward)
- 대기 생성 (post quing)
- WaitingRequest 생성자 추가(jackson에서 필요)
@chanwooo chanwooo changed the base branch from develop to feature-#21 November 13, 2022 20:33
@chanwooo chanwooo changed the base branch from feature-#21 to feature-#37 November 13, 2022 20:33
@chanwooo chanwooo changed the base branch from feature-#37 to develop November 13, 2022 20:33
@chanwooo chanwooo changed the base branch from develop to feature-#21 November 13, 2022 20:34
@chanwooo chanwooo self-assigned this Nov 13, 2022
@chanwooo chanwooo marked this pull request as draft November 13, 2022 21:11
@chanwooo chanwooo linked an issue Nov 14, 2022 that may be closed by this pull request
private final QuingService quingService;


@GetMapping("")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q]
""이 꼭 들어가야 compile 되나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경로를 통째로 지워도 잘 동작하네요~! 삭제했습니다!

@GetMapping("")
public List<WaitingResponse> list(
@SessionAttribute(name = "AUTH_STORE")
StoreManagerResponse storeManagerResponse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor]
private이 붙으면 좋겠네요.

Copy link
Contributor Author

@chanwooo chanwooo Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

controller method에 접근지시자가 실제 동작에는 별 의미가 없다는 글을 봤는데
그렇다면 다른 경로에서 해당 메소드에 접근할수 없도록 private를 추천한다는걸로 이해를 해도 좋을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private으로 하니까 테스트작성이 안되어서 default로 변경하였는데 어떤게 좋을지 잘 모르겠네요
b09ebdd

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method에 붙이면 호출이 안되지 않나요? 모든 parameter에 붙여달라는 의미였습니다. Method는 모두 public으로 해도 상관없을 거 같습니다.


@GetMapping("count-forward")
public long countForward(@SessionAttribute(name = "AUTH_USER")
UserResponse userResponse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

public WaitingResponse append(
@SessionAttribute(name = "AUTH_USER")
UserResponse userResponse,
@RequestBody long storeId
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RequestBodyWaitingRequest가 와야하지 않을까요? 현재 상태면, caller가 JSON 형태의 body를 어떤 형태로 서버로 전송해야되나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인이 되어있다면 userid가 채워지니 storeid만 입력받으면 된다고 생각했는데
둘다 받고 입력값을 비교하거나 storeid를 받기위한 request를 만들어야겠네요!

- 기본경로 의미없는 ("") 삭제
- method private로 변경
- done, cancel을 하기위해 userid로 waiting을 가져오는게 필요해서 추가
- controller는 다른데서 호출될일이 없겠거니 하고 private를 달았는데 이것 때문에 테스트가 불가하여 Access Modifier를 defualt로 변경..
@chanwooo
Copy link
Contributor Author

chanwooo commented Nov 19, 2022

review controller작성은 다른 이슈로 분리하려고해요.
일단 quing controller 완료되었으니 pr로 변경하겠습니다.

@chanwooo chanwooo marked this pull request as ready for review November 19, 2022 23:42
@chanwooo chanwooo merged commit ba97718 into feature-#21 Nov 21, 2022
@chanwooo chanwooo deleted the feature-#28 branch November 21, 2022 10:19
@chanwooo chanwooo restored the feature-#28 branch November 22, 2022 16:37
@chanwooo chanwooo deleted the feature-#28 branch November 22, 2022 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

waiting - controller 작성
2 participants