Skip to content

Commit

Permalink
#18 [Refactor] 코드 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna-Jin committed Jul 27, 2022
1 parent 5d9a211 commit a4d58dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.and()
.authorizeRequests()
.requestMatchers(CorsUtils::isPreFlightRequest).permitAll() // cors 요청 허용
.antMatchers("/review", "/api/bookmark", "/store/register", "/userinfo").hasAnyAuthority(RoleType.USER.getCode(), RoleType.ADMIN.getCode())
.antMatchers("/review", "/api/bookmark", "/store/register", "/user").hasAnyAuthority(RoleType.USER.getCode(), RoleType.ADMIN.getCode())
.antMatchers("/admin/**").hasAnyAuthority(RoleType.ADMIN.getCode())
.antMatchers("/**").permitAll() // 그 외 요청은 모두 허용
.anyRequest().authenticated() // 위의 요청 외의 요청은 무조건 권한검사
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Getter @Setter
@Builder
@Slf4j
public class StoreCardResponseDto implements Comparable<StoreCardResponseDto> {
public class StoreCardResponseDto {
private long storeId;
private String category;
private String name;
Expand All @@ -29,7 +29,7 @@ public class StoreCardResponseDto implements Comparable<StoreCardResponseDto> {
private String phoneNumber;
private String heightDifferent;
private String approach;
private List<StoreImgResponseDto> storeImgList = new ArrayList<>();
private List<StoreImgResponseDto> storeImgList;
private int bookmarkCount;
private String bookmark;

Expand All @@ -52,17 +52,6 @@ public StoreCardResponseDto(Store store) {
this.bookmarkCount = store.getBookMarkCount();
}

@Override
public int compareTo(StoreCardResponseDto sad) {
if (this.pointAvg > sad.pointAvg) {
return -1;
} else if (this.pointAvg < sad.pointAvg) {
return 1;
}
return 0;
}


public StoreCardResponseDto(Store store, String isBookMark) {
this.storeId = store.getId();
this.category = store.getCategory();
Expand Down

0 comments on commit a4d58dc

Please sign in to comment.