Skip to content

Commit

Permalink
refactor: 불필요한 파일 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
jemin committed Jan 28, 2024
1 parent ae9af64 commit b2fc9c3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ public record OAuthSignupRequestDto(
) {

public User toEntity() {
return null;
return User.builder()
.email(email)
.socialId(socialId)
.provider(provider)
.nickname(nickname)
.gender(gender)
.ageGroup(ageGroup)
.fcmToken(fcmToken)
.build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import cmc.mellyserver.auth.common.resolver.LoginUser;
import cmc.mellyserver.controller.notification.dto.request.NotificationCheckRequest;
import cmc.mellyserver.controller.notification.dto.response.NotificationResponse;
import cmc.mellyserver.dbcore.notification.enums.NotificationType;
import cmc.mellyserver.domain.notification.NotificationService;
import cmc.mellyserver.domain.notification.dto.response.NotificationOnOffResponseDto;
import cmc.mellyserver.support.response.ApiResponse;
Expand All @@ -27,6 +26,13 @@ public class NotificationController {

private final NotificationService notificationService;

@GetMapping
public ResponseEntity<ApiResponse<List<NotificationResponse>>> getNotifications(@CurrentUser LoginUser loginUser) {

List<NotificationResponse> notificationList = notificationService.getNotificationList(loginUser.getId());
return ApiResponse.success(SuccessCode.SELECT_SUCCESS, notificationList);
}

@GetMapping("/setting")
public ResponseEntity<ApiResponse<NotificationOnOffResponseDto>> getNotificationStatus(
@CurrentUser LoginUser loginUser) {
Expand All @@ -35,19 +41,6 @@ public ResponseEntity<ApiResponse<NotificationOnOffResponseDto>> getNotification
return ApiResponse.success(SuccessCode.SELECT_SUCCESS, notificationOnOff);
}

@PostMapping
public ResponseEntity<ApiResponse<Void>> saveNotification() {
notificationService.createNotification("내용", NotificationType.COMMENT_ENROLL, 1L, 1L);
return ApiResponse.success(SuccessCode.INSERT_SUCCESS);
}

@GetMapping
public ResponseEntity<ApiResponse<List<NotificationResponse>>> getNotifications(@CurrentUser LoginUser loginUser) {

List<NotificationResponse> notificationList = notificationService.getNotificationList(loginUser.getId());
return ApiResponse.success(SuccessCode.SELECT_SUCCESS, notificationList);
}

@PostMapping("/setting")
public ResponseEntity<ApiResponse<Void>> changeAppPushStatus(@CurrentUser LoginUser loginUser, Boolean status) {

Expand All @@ -62,14 +55,6 @@ public ResponseEntity<ApiResponse<Void>> changeCommentPushStatus(@CurrentUser Lo
return ApiResponse.success(SuccessCode.INSERT_SUCCESS);
}

@PostMapping("/setting/comment/like")
public ResponseEntity<ApiResponse<Void>> changeCommentLikePushStatus(@CurrentUser LoginUser loginUser,
Boolean status) {

notificationService.changeCommentLikePushStatus(loginUser.getId(), status);
return ApiResponse.success(SuccessCode.INSERT_SUCCESS);
}

@PostMapping("/check")
public ResponseEntity<ApiResponse<Void>> checkNotification(
@RequestBody NotificationCheckRequest notificationCheckRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ public void changeAppPushStatus(Long userId, boolean status) {
user.changeAppPushStatus(status);
}

@Transactional
public void changeCommentLikePushStatus(Long userId, boolean status) {

User user = userReader.findById(userId);
user.changeCommentLikePushStatus(status);
}

@Transactional
public void changeCommentPushStatus(Long userId, boolean status) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,21 @@ public class PlaceScrapService {

private final PlaceScrapValidator placeScrapValidator;

public ScrapedPlaceListResponse findScrapedPlace(final Long lastId, final Pageable pageable, final Long userId,
final ScrapType scrapType) {

Slice<ScrapedPlaceResponseDto> scrapedPlaces = placeScrapReader.getUserScrapedPlaces(lastId, pageable, userId,
public ScrapedPlaceListResponse findScrapedPlace(Long lastId, Pageable pageable, Long userId, ScrapType scrapType) {
Slice<ScrapedPlaceResponseDto> places = placeScrapReader.getUserScrapedPlaces(lastId, pageable, userId,
scrapType);
return ScrapedPlaceListResponse.of(scrapedPlaces.getContent(), scrapedPlaces.hasNext());
return ScrapedPlaceListResponse.of(places.getContent(), places.hasNext());
}

@Cacheable(cacheNames = CacheNames.SCRAP, key = "#userId")
public List<PlaceScrapCountResponseDto> countByPlaceScrapType(final Long userId) {

public List<PlaceScrapCountResponseDto> countByPlaceScrapType(Long userId) {
return placeScrapReader.getScrapedPlaceGrouping(userId);
}

@CacheEvict(cacheNames = CacheNames.SCRAP, key = "#userId")
@CheckPlaceExist
@CacheEvict(cacheNames = CacheNames.SCRAP, key = "#userId")
@Transactional
public void createScrap(final Long userId, final CreatePlaceScrapRequestDto createPlaceScrapRequestDto) {
public void createScrap(Long userId, CreatePlaceScrapRequestDto createPlaceScrapRequestDto) {

Place place = placeReader.read(createPlaceScrapRequestDto.getPosition());
User user = userReader.findById(userId);
Expand All @@ -66,7 +63,7 @@ public void createScrap(final Long userId, final CreatePlaceScrapRequestDto crea

@CacheEvict(cacheNames = CacheNames.SCRAP, key = "#userId")
@Transactional
public void removeScrap(final Long userId, final Position position) {
public void removeScrap(Long userId, Position position) {

Place place = placeReader.read(position);
placeScrapValidator.validateExistedScrap(userId, place.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class MockFileService implements FileService {

@Override
public List<String> saveFileList(Long userId, List<FileDto> multipartFiles) {
public List<String> saveFiles(Long userId, List<FileDto> multipartFiles) {
return null;
}

Expand All @@ -29,7 +29,6 @@ public void deleteFile(String fileName) {
}

@Override

public void deleteFileList(List<Long> deleteFileIds) {
public void deleteFiles(List<Long> deleteFileIds) {
}
}

0 comments on commit b2fc9c3

Please sign in to comment.