Skip to content

Commit

Permalink
#18 [Refactor] Controller 및 DTO 병합
Browse files Browse the repository at this point in the history
  • Loading branch information
JSoi committed Jul 18, 2022
1 parent 51e80ed commit 39b8560
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 249 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.mpnp.baechelin.store.controller;

import com.mpnp.baechelin.store.domain.Store;
import com.mpnp.baechelin.store.dto.StoreCardResponseDto;
import com.mpnp.baechelin.store.dto.StorePagedResponseDto;
import com.mpnp.baechelin.store.dto.StoreResponseDto;
import com.mpnp.baechelin.store.repository.StoreQueryRepository;
import com.mpnp.baechelin.store.service.StoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
Expand All @@ -13,14 +10,10 @@
import org.springframework.data.web.PageableDefault;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.userdetails.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;

@Api(tags = {"매장 리스트를 반환하는 Controller"})
@RestController
Expand Down Expand Up @@ -69,4 +62,12 @@ public List<StoreCardResponseDto> getStoreInRangeHighBookmark(@RequestParam(requ
@AuthenticationPrincipal User user) {
return storeService.getStoreInRangeHighBookmark(lat, lng, category, facility, limit, user == null ? null : user.getUsername());
}

@ApiOperation(value = "업장 상세정보를 조회하는 메소드")
@GetMapping("/detail/{storeId}")
public StoreCardResponseDto getStore(
@PathVariable(required = false) int storeId,
@AuthenticationPrincipal User user) {
return storeService.getStore(storeId, user.getUsername());
}
}

This file was deleted.

7 changes: 6 additions & 1 deletion src/main/java/com/mpnp/baechelin/store/domain/Store.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mpnp.baechelin.store.domain;

import com.mpnp.baechelin.api.dto.PublicApiResponseDto;
import com.mpnp.baechelin.api.model.PublicApiForm;
import com.mpnp.baechelin.bookmark.domain.Bookmark;
import com.mpnp.baechelin.review.domain.Review;
import lombok.*;
Expand Down Expand Up @@ -108,6 +109,10 @@ public Store updatePointAvg(double changePoint){
return this;
}


public Store publicApiAndTagToStore(PublicApiForm.ServList servList, List<String> barrierTagList) {
// TagList 매핑 및 생성
// Store 매핑 및 생성
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class StoreCardResponseDto implements Comparable<StoreCardResponseDto> {
private String approach;
private List<StoreImgResponseDto> storeImgList;
private int bookmarkCount;
private boolean bookmark;
private String bookmark;

@Builder.Default
private double pointAvg = 0.0;
Expand All @@ -51,7 +51,7 @@ public int compareTo(StoreCardResponseDto sad) {
}


public StoreCardResponseDto(Store store, boolean isBookMark) {
public StoreCardResponseDto(Store store, String isBookMark) {
this.storeId = store.getId();
this.category = store.getCategory();
this.name = store.getName();
Expand Down
63 changes: 0 additions & 63 deletions src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java

This file was deleted.

This file was deleted.

Loading

0 comments on commit 39b8560

Please sign in to comment.