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

feat : 생협 운영시간 API 구현 #643

Merged
merged 14 commits into from
Jul 14, 2024
Merged

Conversation

Choon0414
Copy link
Contributor

@Choon0414 Choon0414 commented Jun 26, 2024

🔥 연관 이슈

🚀 작업 내용

  1. 생협 운영시간 API를 구현했습니다.
    • 생협의 각 매장별 정보를 조회합니다.
  2. Admin 생협 운영시간 API를 구현했습니다.
    • 생협의 각 매장별 정보를 관리합니다.

💬 리뷰 중점사항

@Choon0414 Choon0414 added 기능 새로운 기능을 개발합니다. Team Campus 캠퍼스 팀에서 작업할 이슈입니다 labels Jun 26, 2024
@Choon0414 Choon0414 self-assigned this Jun 26, 2024
Copy link

github-actions bot commented Jun 26, 2024

Unit Test Results

  28 files    28 suites   2m 12s ⏱️
230 tests 229 ✔️ 1 💤 0
231 runs  230 ✔️ 1 💤 0

Results for commit cdbafab.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@dradnats1012 dradnats1012 left a comment

Choose a reason for hiding this comment

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

몇가지 확인 부탁드립니당

String location,

@Schema(example = "공휴일 휴무", description = "생협 매장 특이사항")
String remarks
Copy link
Contributor

Choose a reason for hiding this comment

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

C

remarks 라는 변수명이 뭔가 알기 어려운것 같아요
보통 비고란에 휴무일만 나오면 아예 restDay 로 바꿔도 될것 같아요

Copy link
Contributor

Choose a reason for hiding this comment

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

휴무 뿐만 아니라 다른 특이사항들도 올 수 있어서 remakrs가 맞는거 같아요.

}
)
@Operation(summary = "모든 생협 매장 정보 조회")
@GetMapping("/coop")
Copy link
Contributor

Choose a reason for hiding this comment

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

A

@RequestMapping("/coop") 빼도 될것 같아요

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 final CoopShopService coopShopService;

@GetMapping("/coop")
Copy link
Contributor

Choose a reason for hiding this comment

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

A

@RequestMapping("/coop") 빼도 될것 같아요

그런데 CoopController도 이렇게 빼놔서 두 컨트롤러를 분리하는게 맞나 궁금해요
CoopController는 식단쪽이긴한데 다른 분들 의견이 궁금해요

Copy link
Collaborator

Choose a reason for hiding this comment

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

사용처를 생각해보면 일반 사용자들이 학식당 정보를 조회하는 경우잖아요?
저는 DiningContoller로 넘기는 것이 적절해 보입니다.
CoopController는 영양사님께서 사용하시는 기능이 들어가는 게 좋아 보여요

+) 혹시 CoopApi에서 아래 부분 수정해주실 수 있나요?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

학식당 정보도 있지만 생협의 여러 매장 정보 조회에 대한 API라 Coop이나 Dining이랑은 분리하는게 맞다고 생각합니다!
coop이 원래는 생협을 뜻하는 단어인데 영양사님 페이지에 써버려서.. 혹시 /coopshop 로 바꿔서 따로 유지하는건 어떻게 생각하시나요?

오너 부분은 수정할게용

Copy link
Contributor

Choose a reason for hiding this comment

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

이거 지금 플라이웨이에 파일 많이 생겨서 올리기전에 버전 확인하고 올려야할것 같아요

Copy link
Contributor

@ImTotem ImTotem left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

String location,

@Schema(example = "공휴일 휴무", description = "생협 매장 특이사항")
String remarks
Copy link
Contributor

Choose a reason for hiding this comment

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

휴무 뿐만 아니라 다른 특이사항들도 올 수 있어서 remakrs가 맞는거 같아요.

private final CoopShopRepository coopShopRepository;

public List<CoopShopResponse> getCoopsShops() {
return coopShopRepository.findAll().stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

C

이렇게 반환하면 isDeleted가 true인 값들도 반환되는거 아닌가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정하겠습니다!

Copy link
Collaborator

@songsunkook songsunkook left a comment

Choose a reason for hiding this comment

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

늦었지만 리뷰 남겼습니다! 확인 부탁드려요~

Comment on lines 23 to 32
@GetMapping("/admin/coop")
public ResponseEntity<AdminCoopShopsResponse> getCoopsShops(
@RequestParam(name = "page", defaultValue = "1") Integer page,
@RequestParam(name = "limit", defaultValue = "10", required = false) Integer limit,
@RequestParam(name = "is_deleted", defaultValue = "false") Boolean isDeleted,
@Auth(permit = {ADMIN}) Integer adminId
) {
AdminCoopShopsResponse coopShops = adminCoopShopService.getCoopsShops(page, limit, isDeleted);
return ResponseEntity.ok(coopShops);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

A

페이징은 컨트롤러 파라미터단에서부터 쉽게 받을 수 있도록 제공했던 것 같은데 파라미터 네이밍같은게 어긋나나요? 사용하지 않은 이유가 있는지 궁금합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

찾아보니 admin도 Pageable을 이용해서 구현할 수는 있는데
기존의 admin에서 인자들을 따로 받아 사용하는 이유는 Criteria 라는 클래스를 이용해 페이지나 표시 크기의 범위를 검증하는 단계를 추가하기 위함인 것 같습니다!

Criteria criteria = Criteria.of(page, limit, total);
public static Criteria of(Integer page, Integer limit, Integer total) {
        return new Criteria(validateAndCalculatePage(page, limit, total), validateAndCalculateLimit(limit));
    }


@RestController
@RequiredArgsConstructor
public class AdminCoopShopController implements AdminCoopShopApi {
Copy link
Collaborator

Choose a reason for hiding this comment

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

C

admin api의 수요가 있었나요? 별도로 만든 이유가 궁금합니다.

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 final CoopShopService coopShopService;

@GetMapping("/coop")
Copy link
Collaborator

Choose a reason for hiding this comment

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

사용처를 생각해보면 일반 사용자들이 학식당 정보를 조회하는 경우잖아요?
저는 DiningContoller로 넘기는 것이 적절해 보입니다.
CoopController는 영양사님께서 사용하시는 기능이 들어가는 게 좋아 보여요

+) 혹시 CoopApi에서 아래 부분 수정해주실 수 있나요?
image

private boolean isDeleted = false;

@Builder
public CoopOpen(
Copy link
Collaborator

Choose a reason for hiding this comment

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

C

private으로 수정해주세요!

Comment on lines +51 to +52
@OneToMany(mappedBy = "coopShop", orphanRemoval = true, cascade = {PERSIST, REFRESH, MERGE, REMOVE})
private List<CoopOpen> coopOpens = new ArrayList<>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

A

cascade를 ALL로 두지 않은 이유가 있는 건가요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

사용하는 type들만 명시적으로 하려고 따로 적었습니다!

private List<CoopOpen> coopOpens = new ArrayList<>();

@Builder
public CoopShop(
Copy link
Collaborator

Choose a reason for hiding this comment

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

A

private으로 바꿔주세요~

@Choon0414 Choon0414 marked this pull request as draft July 8, 2024 12:26
@Choon0414 Choon0414 marked this pull request as ready for review July 9, 2024 12:51
Copy link
Contributor

@dradnats1012 dradnats1012 left a comment

Choose a reason for hiding this comment

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

늦어서 죄송합니다 ㅠㅠ
고생하셨습니다!

Copy link
Contributor

@ImTotem ImTotem left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!!

Copy link
Collaborator

@songsunkook songsunkook left a comment

Choose a reason for hiding this comment

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

리뷰를 아주 잘 반영해주셨네요..!!
큰 작업이었을 텐데 고생하셨습니다!!

@Choon0414 Choon0414 merged commit 9996c04 into develop Jul 14, 2024
3 checks passed
@Choon0414 Choon0414 deleted the feature/571-specify-meal-time branch July 14, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Campus 캠퍼스 팀에서 작업할 이슈입니다 기능 새로운 기능을 개발합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

생협 영업장 운영시간 제공
4 participants