Skip to content

Commit

Permalink
fix:conflict (#144)
Browse files Browse the repository at this point in the history
* feat: ์žฅ๋ฐ”๊ตฌ๋‹ˆ ์ถ”๊ฐ€ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ์žฅ๋ฐ”๊ตฌ๋‹ˆ ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ์ƒํ’ˆ ์ฃผ๋ฌธ๊ณผ ์‹๊ถŒ ์‚ฌ์šฉ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* style: ํฌ์ธํŠธํŠธ๋žœ์žญ์…˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ช… ๋ณ€๊ฒฝ

* deploy: ์žฌ๋ฐฐํฌ

* deploy: ์žฌ๋ฐฐํฌ2

* deploy: ๋กœ๊ทธ์ธ ๋กœ์ง ์ˆ˜์ •์— ๋”ฐ๋ฅธ ์žฌ๋ฐฐํฌ

* deploy: ๋กœ๊ทธ์ธ ๋กœ์ง ์ˆ˜์ •์— ๋”ฐ๋ฅธ ์žฌ๋ฐฐํฌ2

* feat: ์‹๊ถŒ ์‚ฌ์šฉ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: yml ์ˆ˜์ • ์‚ฌํ•ญ ๋ฐ˜์˜

* feat: ์‹๊ถŒ ์‚ฌ์šฉ ๋กœ์ง ์ˆ˜์ •

* feat: ์ฃผ๋ฌธ ๋กœ์ง ์ˆ˜์ • ์™„๋ฃŒ

* fix: ์žฅ๋ฐ”๊ตฌ๋‹ˆ์— ์•„๋ฌด๊ฒƒ๋„ ์—†์„ ๋•Œ ์ฃผ๋ฌธ ์‹œ active ๋˜๋Š” ํ˜„์ƒ ์ˆ˜์ •

* feat: ์ฃผ๋ฌธ ์™„๋ฃŒ ์‹œ ๋ฆฌํ„ด ๊ฐ’ ์ˆ˜์ •

* feat: ๋‚ด ๊ทธ๋ฃน ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ๊ธฐ๋ณธ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€ url ์ถ”๊ฐ€

* feat: ๊ทธ๋ฃน ๋ฉค๋ฒ„ ์ „์ฒด ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: 1์ธ๋‹น ์‚ฌ์šฉ ๊ฐ€๋Šฅ ๊ธˆ์•ก ์„ค์ • ์ปฌ๋Ÿผ ์ถ”๊ฐ€

* feat: ๋‚ด ์ง€๊ฐ‘ ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ์„ ๊ฒฐ์ œ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ์œ ์ € ํ™ˆ ํ™”๋ฉด ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ๊ทธ๋ฃน ์ƒ์„ธ ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ๊ฐ€๊ฒŒ ์ƒ์„ธ ์กฐํšŒ ์ฟผ๋ฆฌ ์ˆ˜์ •

* deploy: ๋ณ€๊ฒฝ์‚ฌํ•ญ ๋ฐ˜์˜์„ ์œ„ํ•œ ์ปค๋ฐ‹

* deploy: ์ˆ˜์ • ์‚ฌํ•ญ ๋ฐ˜์˜ ์žฌ๋ฐฐํฌ

* deploy: rds ๊ต์ฒด๋กœ ์ธํ•œ ์žฌ๋ฐฐํฌ

* deploy: rds ๊ต์ฒด๋กœ ์ธํ•œ ์žฌ๋ฐฐํฌ2

* feat: ํ™ˆ ํ™”๋ฉด ์†Œ์†ํŒ€ ์กฐํšŒ ์ฟผ๋ฆฌ ์ œ๋Œ€๋กœ ์•ˆ๋˜๋˜ ํ˜„์ƒ ํ•ด๊ฒฐ, ๋Œ€ํ‘œ์ด๋ฏธ์ง€ ๋ฐ˜ํ™˜ ์ถ”๊ฐ€

* feat: ๊ทธ๋ฃน ์ƒ์„ธ ์กฐํšŒ ์‘๋‹ต ์ปฌ๋Ÿผ๋ช… ๋ณ€๊ฒฝ

* feat: memberLimit ์ปฌ๋Ÿผ ์‚ญ์ œ

* feat: ์„ ๊ฒฐ์ œ ์‹œ ๊ธฐ์กด ๊ฒฐ์ œ ๋‚ด์—ญ๊ณผ ๋ฉฑ๋“ฑ์„ฑ ๋ฌธ์ œ ํ•ด๊ฒฐ

* fix: ํŒ€ ์ƒ์„ธ ์กฐํšŒ ์‹œ ์ด๋ฏธ์ง€ ์ฟผ๋ฆฌ๊ฐ€ ์˜๋ฏธ ์—†์ด join ๋˜๋˜ ์ฟผ๋ฆฌ ์ˆ˜์ •

* feat: ๊ฐ€๊ฒŒ ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ ๋Œ€ํญ ์ˆ˜์ •

* feat: ํ”„๋ก ํŠธ ์š”๊ตฌ์‚ฌ ๋ฐ˜์˜

* feat: searchcondition ์‚ญ์ œ

* feat: ํŒ€ํƒ€์ž… desription ๋ฆฌํ„ด ํ•˜๋„๋ก ์ˆ˜์ •

* feat: ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„ ํŒ€ ์กฐํšŒ ์‹œ ํŒ€ ์ƒ์„ฑ์ผ ์ปฌ๋Ÿผ ์ถ”๊ฐ€

* feat: ๋งค์žฅ์ฐพ๊ธฐ_์ƒ์„ธ ํŽ˜์ด์ง€ ์กฐํšŒ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* feat: ๋น„๋ฐ€ ์ฝ”๋“œ ์กฐํšŒ ๊ธฐ๋Šฅ ์—”๋“œ ํฌ์ธํŠธ ์ˆ˜์ •

* fix: conflict fix
  • Loading branch information
LEEJaeHyeok97 authored Nov 23, 2024
1 parent 462a66c commit ef1aa65
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 165 deletions.
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

0 comments on commit ef1aa65

Please sign in to comment.