Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1ea412e
Merge branch 'feature/refact-item-detail' into develop
KJBig Dec 6, 2025
d12d1b9
refactor : PaginationResponse 팩토리 메서드명 변경
KJBig Jan 7, 2026
4543cb6
refactor : BrandSearchResponse 팩토리 메서드명 변경
KJBig Jan 7, 2026
f666372
refactor : 변수명 변경
KJBig Jan 7, 2026
b2befc7
feat : 브랜드 검색 테스트 코드 추가
KJBig Jan 8, 2026
5019a1a
feat : 인기 브랜드 조회 테스트 코드 추가
KJBig Jan 8, 2026
ca2b345
feat : 브랜드 검색 domain 모듈 테스트 코드 추가
KJBig Jan 8, 2026
88ac2c5
feat : Top10 브랜드 조회 도메인 모듈 테스트 코드 추가
KJBig Jan 8, 2026
4ae9844
refactor : 최근 선택한 브랜드 기능 이관
KJBig Jan 9, 2026
25323f8
fix : 테스트 코드 오류 수정
KJBig Jan 9, 2026
0643673
feat : 최근 검색한 브랜드 조회 API 테스트 코드 추가
KJBig Jan 9, 2026
e136cdf
feat : 최근 검색한 브랜드 등록 API 테스트코드 추가
KJBig Jan 11, 2026
98014da
feat : 최근 선택한 브랜드 모두 삭제 API 테스트코드 추가
KJBig Jan 11, 2026
0b0e126
feat : 최근 선택한 브랜드 선택 삭제 API 테스트 코드 추가
KJBig Jan 11, 2026
8f3d9b6
feat : 뉴브랜드 등록 API 테스트 코드 추가
KJBig Jan 11, 2026
759c56a
refactor : 컨밴션 및 제거
KJBig Jan 11, 2026
334b0ce
delete : .DS_Store
KJBig Jan 11, 2026
5c66726
Delete sluv-api/src/.DS_Store
KJBig Jan 11, 2026
c17b3de
Merge pull request #328 from CELEBIT/feature/brand-refactor
KJBig Jan 11, 2026
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
Binary file removed sluv-api/src/.DS_Store
Binary file not shown.
Binary file removed sluv-api/src/main/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public ResponseEntity<SuccessDataResponse<AdminUserTokenResponse>> getUserTokenB
@RequestBody AdminUserTokenRequest request) {

AdminUserTokenResponse response = adminService.getUserTokenByAdmin(request);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@PostMapping("")
public ResponseEntity<SuccessDataResponse<AdminResponse>> saveAdmin(@RequestBody AdminRequest request) {
AdminResponse response = adminService.getAdminData(request);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AlarmController {
public ResponseEntity<SuccessDataResponse<PaginationResponse<AlarmResponse>>> getAlarms(
@CurrentUserId Long userId, Pageable pageable) {
PaginationResponse<AlarmResponse> response = alarmService.getAlarmsByUserId(userId, pageable);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@PatchMapping("/read")
Expand All @@ -50,7 +50,7 @@ public ResponseEntity<SuccessResponse> deleteAllAlarm(@CurrentUserId Long userId
@GetMapping("/check")
public ResponseEntity<SuccessDataResponse<AlarmCheckResponse>> checkAlarmAllRead(@CurrentUserId Long userId) {
AlarmCheckResponse response = alarmService.checkAlarmAllRead(userId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public PaginationResponse<AlarmResponse> getAlarmsByUserId(Long userId, Pageable
List<AlarmResponse> content = alarmPage.stream()
.map(alarm -> AlarmResponse.of(alarm, getAlarmImages(alarm)))
.toList();
return PaginationResponse.create(alarmPage, content);
return PaginationResponse.of(alarmPage, content);
}

private AlarmImages getAlarmImages(Alarm alarm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ResponseEntity<SuccessDataResponse<AuthResponse>> socialLogin(@RequestBod
visitCounter.countVisit(loginUser.getId());

AuthResponse response = authService.getAuthResDto(loginUser);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Deprecated
Expand All @@ -59,7 +59,7 @@ public ResponseEntity<SuccessDataResponse<AutoLoginResponse>> autoLogin(@Current
User user = authService.findLogInUser(userId);
// authService.checkFcm(user);
AutoLoginResponse response = AutoLoginResponse.of(user);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*자동 로그인", description = "토큰 만료 시 error code : 4002")
Expand All @@ -73,7 +73,7 @@ public ResponseEntity<SuccessDataResponse<AutoLoginResponse>> autoLoginWithFcm(@
User user = authService.findLogInUser(userId);
// authService.checkFcm(user);
AutoLoginResponse response = AutoLoginResponse.of(user);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*FCM 토큰 갱신", description = "FCM 토큰을 갱신")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class BrandController {
public ResponseEntity<SuccessDataResponse<PaginationResponse<BrandSearchResponse>>> getBrandSearch(
@RequestParam String brandName, Pageable pageable) {
PaginationResponse<BrandSearchResponse> response = brandService.findAllBrand(brandName, pageable);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "인기 브랜드 검색", description = "인기 브랜드 검색(상위 10개)")
@GetMapping("/top")
public ResponseEntity<SuccessDataResponse<List<BrandSearchResponse>>> getTopBrand() {
List<BrandSearchResponse> response = brandService.findTopBrand();
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class NewBrandController {
public ResponseEntity<SuccessDataResponse<NewBrandPostResponse>> postNewBrand(
@RequestBody NewBrandPostRequest request) {
NewBrandPostResponse response = newBrandService.postNewBrand(request);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.sluv.api.brand.dto.request.RecentSelectBrandRequest;
import com.sluv.api.brand.dto.response.RecentSelectBrandResponse;
import com.sluv.api.brand.service.BrandService;
import com.sluv.api.brand.service.RecentSelectBrandService;
import com.sluv.api.common.response.SuccessDataResponse;
import com.sluv.api.common.response.SuccessResponse;
Expand All @@ -18,15 +17,14 @@
@RequiredArgsConstructor
@RequestMapping("/app/brand/recent")
public class RecentSelectBrandController {
private final BrandService brandService;
private final RecentSelectBrandService recentSelectBrandService;

@Operation(summary = "*최근 선택한 브랜드 검색", description = "최근 선택한 브랜드을 검색")
@GetMapping("")
public ResponseEntity<SuccessDataResponse<List<RecentSelectBrandResponse>>> getRecentSelectBrand(
@CurrentUserId Long userId) {
List<RecentSelectBrandResponse> response = brandService.findRecentSelectBrand(userId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
List<RecentSelectBrandResponse> response = recentSelectBrandService.findRecentSelectBrand(userId);
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*최근 선택한 브랜드 등록", description = "User 토큰 필요")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.sluv.api.brand.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class NewBrandPostRequest {
@Schema(description = "새로 등록할 브랜드의 이름")
private String newBrandName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class RecentSelectBrandRequest {
@Schema(description = "브랜드 Id")
private Long brandId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class BrandSearchResponse implements Serializable {
@Schema(description = "브랜드 이미지 URL")
private String brandImgUrl;

public static BrandSearchResponse of(Brand brand) {
public static BrandSearchResponse from(Brand brand) {
return BrandSearchResponse.builder()
.id(brand.getId())
.brandKr(brand.getBrandKr())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class NewBrandPostResponse implements Serializable {
@Schema(description = "생성된 newBrand의 이름")
private String newBrandName;

public static NewBrandPostResponse of(NewBrand newBrand) {
public static NewBrandPostResponse from(NewBrand newBrand) {
return NewBrandPostResponse.builder()
.newBrandId(newBrand.getId())
.newBrandName(newBrand.getBrandName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RecentSelectBrandResponse {
@Schema(description = "브랜드(Y)와 뉴브랜드(N)를 구분하는 플래그")
private String flag;

public static RecentSelectBrandResponse of(RecentSelectBrand recentSelectBrand) {
public static RecentSelectBrandResponse from(RecentSelectBrand recentSelectBrand) {
Long id;
String brandName;
String brandImgUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,18 @@ public class BrandService {
public PaginationResponse<BrandSearchResponse> findAllBrand(String brandName, Pageable pageable) {
Page<Brand> brandPage = brandDomainService.findByAllBrandKrOrBrandEnStartingWith(brandName, pageable);

List<BrandSearchResponse> dtoList = brandPage.stream()
.map(BrandSearchResponse::of)
List<BrandSearchResponse> brandSearchResponses = brandPage.stream()
.map(BrandSearchResponse::from)
.toList();

return PaginationResponse.create(brandPage, dtoList);
return PaginationResponse.of(brandPage, brandSearchResponses);
}

@Transactional(readOnly = true)
public List<BrandSearchResponse> findTopBrand() {
return brandDomainService.findTopBrand()
.stream()
.map(BrandSearchResponse::of)
.toList();
}

@Transactional(readOnly = true)
public List<RecentSelectBrandResponse> findRecentSelectBrand(Long userId) {
User user = userDomainService.findById(userId);
List<RecentSelectBrand> recentSelectBrandList = recentSelectBrandDomainService.getRecentSelectBrandTop20(user);

return recentSelectBrandList.stream()
.map(RecentSelectBrandResponse::of)
.map(BrandSearchResponse::from)
.toList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public NewBrandPostResponse postNewBrand(NewBrandPostRequest request) {
webHookService.sendCreateNewBrandMessage(newBrand);
}

return NewBrandPostResponse.of(newBrand);
return NewBrandPostResponse.from(newBrand);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sluv.api.brand.service;

import com.sluv.api.brand.dto.request.RecentSelectBrandRequest;
import com.sluv.api.brand.dto.response.RecentSelectBrandResponse;
import com.sluv.domain.brand.entity.Brand;
import com.sluv.domain.brand.entity.NewBrand;
import com.sluv.domain.brand.entity.RecentSelectBrand;
Expand All @@ -14,6 +15,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Slf4j
@RequiredArgsConstructor
Expand Down Expand Up @@ -47,4 +50,14 @@ public void deleteRecentSelectBrand(Long userId, Long brandId, String flag) {
}
}

@Transactional(readOnly = true)
public List<RecentSelectBrandResponse> findRecentSelectBrand(Long userId) {
User user = userDomainService.findById(userId);
List<RecentSelectBrand> recentSelectBrands = recentSelectBrandDomainService.getRecentSelectBrandTop20(user);

return recentSelectBrands.stream()
.map(RecentSelectBrandResponse::from)
.toList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class CelebActivityController {
public ResponseEntity<SuccessDataResponse<List<CelebActivityResponse>>> getCelebActivity(
@PathVariable("celebId") Long celebId) {
List<CelebActivityResponse> response = celebActivityService.getCelebActivity(celebId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ public class CelebController {
public ResponseEntity<SuccessDataResponse<PaginationResponse<CelebSearchResponse>>> searchCelebByName(
@RequestParam String celebName, Pageable pageable) {
PaginationResponse<CelebSearchResponse> response = celebService.searchCeleb(celebName, pageable);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "관심셀럽 등록 시 Celeb 검색", description = "멤버 이름을 검색하면 그룹이 검색됨. Pagination X")
@GetMapping("/search/interested")
public ResponseEntity<SuccessDataResponse<List<CelebSearchByCategoryResponse>>> searchInterestedCelebByName(
@RequestParam String celebName) {
List<CelebSearchByCategoryResponse> response = celebService.searchInterestedCelebByName(celebName);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "인기 셀럽 조회", description = "조회가 많이된 Celeb 상위 10개 조회")
@GetMapping("/top")
public ResponseEntity<SuccessDataResponse<List<CelebSearchResponse>>> searchTop10Celeb() {
List<CelebSearchResponse> response = celebService.getTop10Celeb();
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "관심 셀럽 조회 시, 카테고리별 셀럽 조회", description = "카테고리별 최대 30개를 한번에 전달, 카테고리는 순서 X, 셀럽는 가나다 순서.")
@GetMapping("/category")
public ResponseEntity<SuccessDataResponse<List<CelebSearchByCategoryResponse>>> searchCelebByCategory() {
List<CelebSearchByCategoryResponse> response = celebService.getCelebByCategory();
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class NewCelebController {
public ResponseEntity<SuccessDataResponse<NewCelebPostResponse>> postNewCeleb(
@RequestBody NewCelebPostRequest request) {
NewCelebPostResponse response = newCelebService.postNewCeleb(request);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class RecentSelectCelebController {
public ResponseEntity<SuccessDataResponse<List<RecentSelectCelebResponse>>> getRecentSelectCeleb(
@CurrentUserId Long userId) {
List<RecentSelectCelebResponse> response = celebService.getUserRecentSelectCeleb(userId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*최근 선택한 셀럽 등록", description = "User 토큰 필요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public PaginationResponse<CelebSearchResponse> searchCeleb(String celebName, Pag
.map(CelebSearchResponse::of)
.toList();

return PaginationResponse.create(celebPage, content);
return PaginationResponse.of(celebPage, content);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public class ClosetController {
@GetMapping("/list")
public ResponseEntity<SuccessDataResponse<ClosetListCountResponse>> getClosetList(@CurrentUserId Long userId) {
ClosetListCountResponse response = closetService.getClosetList(userId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "옷장 이름 중복 검사", description = "옷장 등록 및 수정 시 호출")
@GetMapping("/check-name")
public ResponseEntity<SuccessDataResponse<ClosetNameCheckResponse>> checkClosetNameDuplicated(
@RequestParam("name") String name, @Nullable @RequestParam("id") Long closetId) {
ClosetNameCheckResponse response = closetService.checkClosetNameDuplicated(name, closetId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*옷장 생성", description = "User 토큰 필요")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ResponseEntity<SuccessDataResponse<PaginationResponse<CommentResponse>>>
@PathVariable("questionId") Long questionId,
Pageable pageable) {
PaginationResponse<CommentResponse> response = commentService.getComment(userId, questionId, pageable);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*Question 게시글의 댓글의 대댓글 조회", description = "User 토큰 필요. Pagination 적용.")
Expand All @@ -37,7 +37,7 @@ public ResponseEntity<SuccessDataResponse<SubCommentPageResponse<CommentResponse
@PathVariable("commentId") Long commentId,
Pageable pageable) {
SubCommentPageResponse<CommentResponse> response = commentService.getSubComment(userId, commentId, pageable);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*댓글 상세 조회", description = "User 토큰 필요. Pagination 적용.")
Expand All @@ -46,7 +46,7 @@ public ResponseEntity<SuccessDataResponse<CommentResponse>> getCommentDetail(
@CurrentUserId Long userId,
@PathVariable("commentId") Long commentId) {
CommentResponse response = commentService.getCommentDetail(userId, commentId);
return ResponseEntity.ok().body(SuccessDataResponse.create(response));
return ResponseEntity.ok().body(SuccessDataResponse.from(response));
}

@Operation(summary = "*댓글 작성", description = "User 토큰 필요")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public PaginationResponse<CommentResponse> getComment(Long userId, Long question
// Content 제작
List<CommentResponse> content = commentHelper.getCommentResDtos(user, commentPage.getContent());

return PaginationResponse.create(commentPage, content);
return PaginationResponse.of(commentPage, content);
}

/**
Expand Down
Loading
Loading