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

fix:conflict #144

Merged
merged 78 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
754b1c0
feat: μž₯λ°”κ΅¬λ‹ˆ μΆ”κ°€ κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 19, 2024
9c2f259
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 19, 2024
b5de2ba
feat: μž₯λ°”κ΅¬λ‹ˆ 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 19, 2024
ca6b405
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 19, 2024
5b563b5
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 19, 2024
b4dbfe4
feat: μƒν’ˆ μ£Όλ¬Έκ³Ό μ‹κΆŒ μ‚¬μš© κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 19, 2024
fc50cd6
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 19, 2024
d97a8de
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 19, 2024
74c8af5
style: ν¬μΈνŠΈνŠΈλžœμž­μ…˜ λ ˆν¬μ§€ν† λ¦¬λͺ… λ³€κ²½
LEEJaeHyeok97 Nov 19, 2024
25cb8d0
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 19, 2024
4b89797
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 19, 2024
5976f75
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 19, 2024
eae3903
deploy: 재배포
LEEJaeHyeok97 Nov 19, 2024
7e1ada5
deploy: 재배포2
LEEJaeHyeok97 Nov 19, 2024
ca608fb
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
63413e0
deploy: 둜그인 둜직 μˆ˜μ •μ— λ”°λ₯Έ 재배포
LEEJaeHyeok97 Nov 20, 2024
e20a015
deploy: 둜그인 둜직 μˆ˜μ •μ— λ”°λ₯Έ 재배포2
LEEJaeHyeok97 Nov 20, 2024
c627cc2
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
9829a4b
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
2f66ad9
feat: μ‹κΆŒ μ‚¬μš© κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 20, 2024
163d698
feat: yml μˆ˜μ • 사항 반영
LEEJaeHyeok97 Nov 20, 2024
3de7376
feat: μ‹κΆŒ μ‚¬μš© 둜직 μˆ˜μ •
LEEJaeHyeok97 Nov 20, 2024
ccc6df3
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 20, 2024
f791988
feat: μ£Όλ¬Έ 둜직 μˆ˜μ • μ™„λ£Œ
LEEJaeHyeok97 Nov 20, 2024
36965a7
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 20, 2024
6bc0d02
fix: μž₯λ°”κ΅¬λ‹ˆμ— 아무것도 없을 λ•Œ μ£Όλ¬Έ μ‹œ active λ˜λŠ” ν˜„μƒ μˆ˜μ •
LEEJaeHyeok97 Nov 20, 2024
7ae17ee
feat: μ£Όλ¬Έ μ™„λ£Œ μ‹œ 리턴 κ°’ μˆ˜μ •
LEEJaeHyeok97 Nov 20, 2024
9ca3a35
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 20, 2024
2ffe327
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
e82f58c
feat: λ‚΄ κ·Έλ£Ή 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 20, 2024
a98d6f0
feat: κΈ°λ³Έ ν”„λ‘œν•„ 이미지 url μΆ”κ°€
LEEJaeHyeok97 Nov 20, 2024
9376ed6
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 20, 2024
4c73bf5
feat: κ·Έλ£Ή 멀버 전체 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 21, 2024
125752b
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 21, 2024
9f89029
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 21, 2024
32836c3
feat: 1인당 μ‚¬μš© κ°€λŠ₯ κΈˆμ•‘ μ„€μ • 컬럼 μΆ”κ°€
LEEJaeHyeok97 Nov 21, 2024
ca2a8dc
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 21, 2024
16c56a3
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 21, 2024
f30aa7c
feat: λ‚΄ 지갑 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 21, 2024
5ec891e
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 21, 2024
44827ce
feat: μ„ κ²°μ œ κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 21, 2024
74ca8b0
feat: μœ μ € ν™ˆ ν™”λ©΄ 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 21, 2024
dc09775
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 21, 2024
2864139
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 22, 2024
aef871a
feat: κ·Έλ£Ή 상세 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 22, 2024
f19e93f
feat: κ°€κ²Œ 상세 쑰회 쿼리 μˆ˜μ •
LEEJaeHyeok97 Nov 23, 2024
d15f3a2
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 23, 2024
6109e9f
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
47e29b4
deploy: 변경사항 λ°˜μ˜μ„ μœ„ν•œ 컀밋
LEEJaeHyeok97 Nov 23, 2024
90ba864
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
9400ff1
deploy: μˆ˜μ • 사항 반영 재배포
LEEJaeHyeok97 Nov 23, 2024
8609c35
deploy: rds ꡐ체둜 μΈν•œ 재배포
LEEJaeHyeok97 Nov 23, 2024
3e79389
deploy: rds ꡐ체둜 μΈν•œ 재배포2
LEEJaeHyeok97 Nov 23, 2024
8e7a2a5
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
6aea111
feat: ν™ˆ ν™”λ©΄ μ†Œμ†νŒ€ 쑰회 쿼리 μ œλŒ€λ‘œ μ•ˆλ˜λ˜ ν˜„μƒ ν•΄κ²°, λŒ€ν‘œμ΄λ―Έμ§€ λ°˜ν™˜ μΆ”κ°€
LEEJaeHyeok97 Nov 23, 2024
ab8d7d2
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
a53ef21
feat: κ·Έλ£Ή 상세 쑰회 응닡 컬럼λͺ… λ³€κ²½
LEEJaeHyeok97 Nov 23, 2024
f4b31c2
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
83c7f69
feat: memberLimit 컬럼 μ‚­μ œ
LEEJaeHyeok97 Nov 23, 2024
25be727
feat: μ„ κ²°μ œ μ‹œ κΈ°μ‘΄ 결제 λ‚΄μ—­κ³Ό λ©±λ“±μ„± 문제 ν•΄κ²°
LEEJaeHyeok97 Nov 23, 2024
afdbfbe
fix: νŒ€ 상세 쑰회 μ‹œ 이미지 쿼리가 의미 없이 join 되던 쿼리 μˆ˜μ •
LEEJaeHyeok97 Nov 23, 2024
1f65811
feat: κ°€κ²Œ 검색 κΈ°λŠ₯ λŒ€ν­ μˆ˜μ •
LEEJaeHyeok97 Nov 23, 2024
08f03f7
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
530ca13
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
5a674fb
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
aae5ff4
feat: ν”„λ‘ νŠΈ μš”κ΅¬μ‚¬ 반영
LEEJaeHyeok97 Nov 23, 2024
f2ec318
:wq
LEEJaeHyeok97 Nov 23, 2024
47de53b
feat: searchcondition μ‚­μ œ
LEEJaeHyeok97 Nov 23, 2024
1ca86f0
feat: νŒ€νƒ€μž… desription 리턴 ν•˜λ„λ‘ μˆ˜μ •
LEEJaeHyeok97 Nov 23, 2024
713efe9
feat: μΉ΄ν…Œκ³ λ¦¬λ³„ νŒ€ 쑰회 μ‹œ νŒ€ 생성일 컬럼 μΆ”κ°€
LEEJaeHyeok97 Nov 23, 2024
ef61b17
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 23, 2024
dcfa727
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
4c7bd3c
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
7f1f36e
feat: 맀μž₯μ°ΎκΈ°_상세 νŽ˜μ΄μ§€ 쑰회 κΈ°λŠ₯ κ΅¬ν˜„
LEEJaeHyeok97 Nov 23, 2024
906596b
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 23, 2024
d874384
feat: λΉ„λ°€ μ½”λ“œ 쑰회 κΈ°λŠ₯ μ—”λ“œ 포인트 μˆ˜μ •
LEEJaeHyeok97 Nov 23, 2024
fb598b8
fix: conflict fix
LEEJaeHyeok97 Nov 23, 2024
fe9043d
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 107 additions & 108 deletions src/main/java/com/jangburich/domain/store/controller/StoreController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jangburich.domain.store.controller;

import com.jangburich.domain.store.dto.response.StoreSearchDetailsResponse;
import java.util.List;

import org.springframework.data.domain.Page;
Expand All @@ -20,14 +21,13 @@
import com.jangburich.domain.store.domain.Category;
import com.jangburich.domain.store.domain.StoreCreateRequestDTO;
import com.jangburich.domain.store.domain.StoreGetResponseDTO;
import com.jangburich.domain.store.domain.StoreTeamResponseDTO;
import com.jangburich.domain.store.domain.StoreUpdateRequestDTO;
import com.jangburich.domain.store.dto.StoreTeamResponse;
import com.jangburich.domain.store.dto.response.OrdersDetailResponse;
import com.jangburich.domain.store.dto.response.OrdersGetResponse;
import com.jangburich.domain.store.dto.response.OrdersTodayResponse;
import com.jangburich.domain.store.dto.response.PaymentGroupDetailResponse;
import com.jangburich.domain.store.dto.response.SearchStoresResponse;
import com.jangburich.domain.store.dto.response.StoreSearchDetailsResponse;
import com.jangburich.domain.store.service.StoreService;
import com.jangburich.global.payload.Message;
import com.jangburich.global.payload.ResponseCustom;
Expand All @@ -44,110 +44,109 @@
@RequestMapping("/store")
public class StoreController {

private final StoreService storeService;

@Operation(summary = "μΉ΄ν…Œκ³ λ¦¬ 별 κ°€κ²Œ λͺ©λ‘ 쑰회", description = "μΉ΄ν…Œκ³ λ¦¬ λ³„λ‘œ κ°€κ²Œ λͺ©λ‘μ„ μ‘°νšŒν•©λ‹ˆλ‹€.")
@PostMapping("/category")
public ResponseCustom<Page<SearchStoresResponse>> searchByCategory(
Authentication authentication,
@RequestParam(required = false, defaultValue = "3") Integer searchRadius,
@RequestParam(required = false, defaultValue = "ALL") Category category,
Double lat,
Double lon, Pageable pageable) {
return ResponseCustom.OK(
storeService.searchByCategory(AuthenticationParser.parseUserId(authentication), searchRadius, category, lat,
lon,
pageable));
}

@Operation(summary = "맀μž₯ μ°ΎκΈ°(검색)", description = "검색어와 맀μž₯ μœ ν˜•μ— λ§žλŠ” 맀μž₯을 κ²€μƒ‰ν•©λ‹ˆλ‹€.")
@GetMapping("/search")
public ResponseCustom<Page<SearchStoresResponse>> searchStores(
Authentication authentication,
@RequestParam(required = false, defaultValue = "") String keyword, Pageable pageable) {
return ResponseCustom.OK(
storeService.searchStores(AuthenticationParser.parseUserId(authentication), keyword, pageable));
}

@Operation(summary = "맀μž₯ μ°ΎκΈ° 상세 νŽ˜μ΄μ§€ 쑰회", description = "맀μž₯을 상세 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/{storeId}")
public ResponseCustom<StoreSearchDetailsResponse> storeSearchDetails(
Authentication authentication,
@PathVariable Long storeId
) {
System.out.println("authentication = " + authentication);
return ResponseCustom.OK(
storeService.storeSearchDetails(AuthenticationParser.parseUserId(authentication), storeId));
}

@Operation(summary = "κ°€κ²Œ 등둝", description = "μ‹ κ·œ νŒŒνŠΈλ„ˆ κ°€κ²Œλ₯Ό λ“±λ‘ν•©λ‹ˆλ‹€.")
@PostMapping(value = "/create", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseCustom<Message> createStore(
Authentication authentication,
@Parameter(name = "image", description = "μ—…λ‘œλ“œ 사진 데이터") @RequestPart(value = "image") MultipartFile image,
@RequestPart(value = "store") StoreCreateRequestDTO storeCreateRequestDTO,
@RequestPart(value = "menuImages", required = false) List<MultipartFile> menuImages) {

storeService.createStore(AuthenticationParser.parseUserId(authentication), storeCreateRequestDTO, image,
menuImages);
return ResponseCustom.OK(Message.builder().message("success").build());
}

@Operation(summary = "κ°€κ²Œ 정보 μˆ˜μ •", description = "κ°€κ²Œ 정보λ₯Ό μˆ˜μ •ν•©λ‹ˆλ‹€.")
@PatchMapping("/update")
public ResponseCustom<Message> updateStore(Authentication authentication,
@RequestBody StoreUpdateRequestDTO storeUpdateRequestDTO) {
storeService.updateStore(AuthenticationParser.parseUserId(authentication), storeUpdateRequestDTO);
return ResponseCustom.OK(Message.builder().message("success").build());
}

@Operation(summary = "κ°€κ²Œ 정보 쑰회", description = "κ°€κ²Œ 상세 정보λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("")
public ResponseCustom<StoreGetResponseDTO> getStoreInfo(Authentication authentication) {
return ResponseCustom.OK(storeService.getStoreInfo(AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "결제 κ·Έλ£Ή 쑰회", description = "μž₯λΆ€ 결제 그룹을 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/payment_group")
public ResponseCustom<List<StoreTeamResponse>> getPaymentGroup(Authentication authentication) {
return ResponseCustom.OK(
storeService.getPaymentGroup(AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "결제 κ·Έλ£Ή 상세 쑰회", description = "μž₯λΆ€ 결제 그룹을 상세 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/payment_group/{teamId}")
public ResponseCustom<PaymentGroupDetailResponse> getPaymentGroupDetail(Authentication authentication,
@PathVariable Long teamId) {
return ResponseCustom.OK(
storeService.getPaymentGroupDetail(AuthenticationParser.parseUserId(authentication), teamId));
}

@Operation(summary = "결제 λ‚΄μ—­ 쑰회", description = "κ°€κ²Œμ—μ„œ μΌμ–΄λ‚œ 결제 내역을 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/payment_history")
public ResponseCustom<?> getPaymentHistory(Authentication authentication) {
return ResponseCustom.OK(
storeService.getPaymentHistory(AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "μ§€λ‚œ μ£Όλ¬Έ 쑰회", description = "κ°€κ²Œμ— μžˆλŠ” μ§€λ‚œ 주문을 μ‘°νšŒν•©λ‹ˆλ‹€")
@GetMapping("/orders/last")
public ResponseCustom<List<OrdersGetResponse>> getLastOrders(Authentication authentication) {
List<OrdersGetResponse> ordersLast = storeService.getOrdersLast(
AuthenticationParser.parseUserId(authentication));
return ResponseCustom.OK(ordersLast);
}

@Operation(summary = "였늘 μ£Όλ¬Έ 쑰회", description = "κ°€κ²Œμ— μžˆλŠ” 였늘 주문을 μ‘°νšŒν•©λ‹ˆλ‹€")
@GetMapping("/orders/today")
public ResponseCustom<OrdersTodayResponse> getTodayOrders(Authentication authentication) {
return ResponseCustom.OK(storeService.getTodayOrders(
AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "μ£Όλ¬Έ 상세 쑰회", description = "κ°€κ²Œμ— μžˆλŠ” 주문을 상세 μ‘°νšŒν•©λ‹ˆλ‹€")
@GetMapping("/orders/{ordersId}")
public ResponseCustom<OrdersDetailResponse> getOrders(Authentication authentication, @RequestParam Long orderId) {
return ResponseCustom.OK(
storeService.getOrderDetails(AuthenticationParser.parseUserId(authentication), orderId));
}
private final StoreService storeService;

@Operation(summary = "μΉ΄ν…Œκ³ λ¦¬ 별 κ°€κ²Œ λͺ©λ‘ 쑰회", description = "μΉ΄ν…Œκ³ λ¦¬ λ³„λ‘œ κ°€κ²Œ λͺ©λ‘μ„ μ‘°νšŒν•©λ‹ˆλ‹€.")
@PostMapping("/category")
public ResponseCustom<Page<SearchStoresResponse>> searchByCategory(
Authentication authentication,
@RequestParam(required = false, defaultValue = "3") Integer searchRadius,
@RequestParam(required = false, defaultValue = "ALL") Category category,
Double lat,
Double lon, Pageable pageable) {
return ResponseCustom.OK(
storeService.searchByCategory(AuthenticationParser.parseUserId(authentication), searchRadius, category, lat, lon,
pageable));
}

@Operation(summary = "맀μž₯ μ°ΎκΈ°(검색)", description = "검색어와 맀μž₯ μœ ν˜•μ— λ§žλŠ” 맀μž₯을 κ²€μƒ‰ν•©λ‹ˆλ‹€.")
@GetMapping("/search")
public ResponseCustom<Page<SearchStoresResponse>> searchStores(
Authentication authentication,
@RequestParam(required = false, defaultValue = "") String keyword, Pageable pageable) {
return ResponseCustom.OK(
storeService.searchStores(AuthenticationParser.parseUserId(authentication), keyword, pageable));
}

@Operation(summary = "맀μž₯ μ°ΎκΈ° 상세 νŽ˜μ΄μ§€ 쑰회", description = "맀μž₯을 상세 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/{storeId}")
public ResponseCustom<StoreSearchDetailsResponse> storeSearchDetails(
Authentication authentication,
@PathVariable Long storeId
) {
System.out.println("authentication = " + authentication);
return ResponseCustom.OK(storeService.storeSearchDetails(AuthenticationParser.parseUserId(authentication), storeId));
}

@Operation(summary = "κ°€κ²Œ 등둝", description = "μ‹ κ·œ νŒŒνŠΈλ„ˆ κ°€κ²Œλ₯Ό λ“±λ‘ν•©λ‹ˆλ‹€.")
@PostMapping(value = "/create", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseCustom<Message> createStore(
Authentication authentication,
@Parameter(name = "image", description = "μ—…λ‘œλ“œ 사진 데이터") @RequestPart(value = "image") MultipartFile image,
@RequestPart(value = "store") StoreCreateRequestDTO storeCreateRequestDTO,
@RequestPart(value = "menuImages", required = false) List<MultipartFile> menuImages) {

storeService.createStore(AuthenticationParser.parseUserId(authentication), storeCreateRequestDTO, image,
menuImages);
return ResponseCustom.OK(Message.builder().message("success").build());
}


@Operation(summary = "κ°€κ²Œ 정보 μˆ˜μ •", description = "κ°€κ²Œ 정보λ₯Ό μˆ˜μ •ν•©λ‹ˆλ‹€.")
@PatchMapping("/update")
public ResponseCustom<Message> updateStore(Authentication authentication,
@RequestBody StoreUpdateRequestDTO storeUpdateRequestDTO) {
storeService.updateStore(AuthenticationParser.parseUserId(authentication), storeUpdateRequestDTO);
return ResponseCustom.OK(Message.builder().message("success").build());
}

@Operation(summary = "κ°€κ²Œ 정보 쑰회", description = "κ°€κ²Œ 상세 정보λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("")
public ResponseCustom<StoreGetResponseDTO> getStoreInfo(Authentication authentication) {
return ResponseCustom.OK(storeService.getStoreInfo(AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "결제 κ·Έλ£Ή 쑰회", description = "μž₯λΆ€ 결제 그룹을 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/payment_group")
public ResponseCustom<List<com.jangburich.domain.store.dto.StoreTeamResponse>> getPaymentGroup(Authentication authentication) {
return ResponseCustom.OK(
storeService.getPaymentGroup(AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "결제 κ·Έλ£Ή 상세 쑰회", description = "μž₯λΆ€ 결제 그룹을 상세 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/payment_group/{teamId}")
public ResponseCustom<PaymentGroupDetailResponse> getPaymentGroupDetail(Authentication authentication,
@PathVariable Long teamId) {
return ResponseCustom.OK(
storeService.getPaymentGroupDetail(AuthenticationParser.parseUserId(authentication), teamId));
}

@Operation(summary = "결제 λ‚΄μ—­ 쑰회", description = "κ°€κ²Œμ—μ„œ μΌμ–΄λ‚œ 결제 내역을 μ‘°νšŒν•©λ‹ˆλ‹€.")
@GetMapping("/payment_history")
public ResponseCustom<?> getPaymentHistory(Authentication authentication) {
return ResponseCustom.OK(
storeService.getPaymentHistory(AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "μ§€λ‚œ μ£Όλ¬Έ 쑰회", description = "κ°€κ²Œμ— μžˆλŠ” μ§€λ‚œ 주문을 μ‘°νšŒν•©λ‹ˆλ‹€")
@GetMapping("/orders/last")
public ResponseCustom<List<OrdersGetResponse>> getLastOrders(Authentication authentication) {
List<OrdersGetResponse> ordersLast = storeService.getOrdersLast(
AuthenticationParser.parseUserId(authentication));
return ResponseCustom.OK(ordersLast);
}

@Operation(summary = "였늘 μ£Όλ¬Έ 쑰회", description = "κ°€κ²Œμ— μžˆλŠ” 였늘 주문을 μ‘°νšŒν•©λ‹ˆλ‹€")
@GetMapping("/orders/today")
public ResponseCustom<OrdersTodayResponse> getTodayOrders(Authentication authentication) {
return ResponseCustom.OK(storeService.getTodayOrders(
AuthenticationParser.parseUserId(authentication)));
}

@Operation(summary = "μ£Όλ¬Έ 상세 쑰회", description = "κ°€κ²Œμ— μžˆλŠ” 주문을 상세 μ‘°νšŒν•©λ‹ˆλ‹€")
@GetMapping("/orders/{ordersId}")
public ResponseCustom<OrdersDetailResponse> getOrders(Authentication authentication, @RequestParam Long orderId) {
return ResponseCustom.OK(
storeService.getOrderDetails(AuthenticationParser.parseUserId(authentication), orderId));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

@Builder
public record StoreTeamResponseDTO(
Long id,
Integer remainPoint,
Long teamId,
String teamName,
String teamDescription,
Long storeId,
LocalDateTime updatedAt
Long id,
Integer remainPoint,
Long teamId,
String teamName,
String teamDescription,
Long storeId,
LocalDateTime updatedAt

) {
@QueryProjection
public StoreTeamResponseDTO(Long id, Integer remainPoint, Long teamId, String teamName, String teamDescription,
Long storeId, LocalDateTime updatedAt) {
Long storeId, LocalDateTime updatedAt) {
this.id = id;
this.remainPoint = remainPoint;
this.teamId = teamId;
Expand All @@ -28,4 +28,4 @@ public StoreTeamResponseDTO(Long id, Integer remainPoint, Long teamId, String te
this.storeId = storeId;
this.updatedAt = updatedAt;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,33 @@
import java.time.format.DateTimeFormatter;

public class StoreTeamResponse {
Long id;
Integer remainPoint;
Long teamId;
String teamName;
String teamDescription;
Long storeId;
String period;
Long id;
Integer remainPoint;
Long teamId;
String teamName;
String teamDescription;
Long storeId;
String period;

public StoreTeamResponse(Long id, Integer remainPoint, Long teamId, String teamName, String teamDescription,
Long storeId, LocalDateTime period, long maxReservation) {
this.id = id;
this.remainPoint = remainPoint;
this.teamId = teamId;
this.teamName = teamName;
this.teamDescription = teamDescription;
this.storeId = storeId;
this.period = calculateDateRange(period, maxReservation);
}
public StoreTeamResponse(Long id, Integer remainPoint, Long teamId, String teamName, String teamDescription,
Long storeId, LocalDateTime period, long maxReservation) {
this.id = id;
this.remainPoint = remainPoint;
this.teamId = teamId;
this.teamName = teamName;
this.teamDescription = teamDescription;
this.storeId = storeId;
this.period = calculateDateRange(period, maxReservation);
}

private String calculateDateRange(LocalDateTime updatedAt, long maxReservation) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd");

// μ‹œμž‘ λ‚ μ§œ
String startDate = updatedAt.format(formatter);

// μ’…λ£Œ λ‚ μ§œ
LocalDateTime endDateTime = updatedAt.plusDays(maxReservation);
String endDate = endDateTime.format(formatter);

// λ²”μœ„ λ¬Έμžμ—΄ 생성
return startDate + " ~ " + endDate;
}
private String calculateDateRange(LocalDateTime updatedAt, long maxReservation) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd");
// μ‹œμž‘ λ‚ μ§œ
String startDate = updatedAt.format(formatter);
// μ’…λ£Œ λ‚ μ§œ
LocalDateTime endDateTime = updatedAt.plusDays(maxReservation);
String endDate = endDateTime.format(formatter);
// λ²”μœ„ λ¬Έμžμ—΄ 생성
return startDate + " ~ " + endDate;
}
}
Loading