Skip to content

Commit

Permalink
Merge pull request #98 from AR-TTUBEOG/remove/93
Browse files Browse the repository at this point in the history
[Remove] 미사용 함수 및 변수 삭제
  • Loading branch information
choeun7 authored Mar 22, 2024
2 parents 7585f3e + fb7b896 commit b12d55e
Show file tree
Hide file tree
Showing 30 changed files with 54 additions and 176 deletions.
11 changes: 0 additions & 11 deletions src/main/java/com/ttubeog/domain/area/application/AreaService.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/main/java/com/ttubeog/domain/area/domain/SidoArea.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/main/java/com/ttubeog/domain/area/domain/SiggArea.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class BenefitService {
private final MemberRepository memberRepository;
private final BenefitRepository benefitRepository;
private final MemberBenefitRepository memberBenefitRepository;
private final StoreRepository storeRepository;
private final JwtTokenProvider jwtTokenProvider;

//게임 성공 후 혜택 저장
Expand Down Expand Up @@ -68,7 +67,7 @@ public CommonDto saveBenefit(HttpServletRequest request, Long benefitId) throws
.content(benefit.getContent())
.type(benefit.getType())
.used(memberBenefit.getUsed())
.expried(memberBenefit.getExpired())
.expired(memberBenefit.getExpired())
.createdAt(memberBenefit.getCreatedAt())
.build();

Expand Down Expand Up @@ -100,7 +99,7 @@ public CommonDto useBenefit(HttpServletRequest request, Long benefitId) throws J
.storeId(benefit.getStore().getId())
.storeName(benefit.getStore().getName())
.used(memberBenefit.getUsed())
.expried(memberBenefit.getExpired())
.expired(memberBenefit.getExpired())
.createdAt(memberBenefit.getCreatedAt())
.content(benefit.getContent())
.type(benefit.getType())
Expand All @@ -123,7 +122,7 @@ public CommonDto findMyBenefit(HttpServletRequest request, Integer page) throws
.storeId(memberBenefit.getBenefit().getStore().getId())
.storeName(memberBenefit.getBenefit().getStore().getName())
.used(memberBenefit.getUsed())
.expried(memberBenefit.getExpired())
.expired(memberBenefit.getExpired())
.createdAt(memberBenefit.getCreatedAt())
.content(memberBenefit.getBenefit().getContent())
.type(memberBenefit.getBenefit().getType())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ public class SaveBenefitRes {
private Boolean used;

@Schema(description = "만료 여부", example = "false")
private Boolean expried;
private Boolean expired;

@Schema(description = "혜택 저장 시간", example = "2024-01-12 09:30:50")
private LocalDateTime createdAt;

@Builder
public SaveBenefitRes(Long id, Long benefitId, Long storeId, String storeName, String content, BenefitType type, Boolean used, Boolean expried, LocalDateTime createdAt) {
public SaveBenefitRes(Long id, Long benefitId, Long storeId, String storeName, String content, BenefitType type, Boolean used, Boolean expired, LocalDateTime createdAt) {
this.id = id;
this.benefitId = benefitId;
this.storeId = storeId;
this.storeName = storeName;
this.content = content;
this.type = type;
this.used = used;
this.expried = expried;
this.expired = expired;
this.createdAt = createdAt;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ResponseEntity<CommonDto> saveBenefit(
@ApiResponse(responseCode = "200", description = "혜택 사용 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = SaveBenefitRes.class) ) } ),
@ApiResponse(responseCode = "400", description = "혜택 사용 실패", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class) ) } ),
})
@PatchMapping("{benefitId}/use")
@PatchMapping("/{benefitId}/use")
public ResponseEntity<CommonDto> useBenefit(
HttpServletRequest request,
@PathVariable(value = "benefitId") Long benefitId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ public class GuestBookService {
private final MemberRepository memberRepository;
private final SpotRepository spotRepository;
private final StoreRepository storeRepository;
private final ImageRepository imageRepository;
private final UuidImageRepository uuidImageRepository;

//private final ImageService imageService;

private final AmazonS3Manager amazonS3Manager;

private final JwtTokenProvider jwtTokenProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
@Getter
public enum GuestBookType {
SPOT,
STORE;
STORE
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Tag(name = "GuestBook", description = "GuestBook API(방명록 API)")
@RequiredArgsConstructor
@RestController
@RequestMapping("api/v1/guestbook")
@RequestMapping("/api/v1/guestbook")
public class GuestBookController {

private final GuestBookService guestBookService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public CommonDto createSpotImage(HttpServletRequest request, Long spotId, List<M
.spot(spot)
.build();

String imageUrl = amazonS3Manager.uploadFile(amazonS3Manager.generateStoreKeyName(image), multipartFile);
String imageUrl = amazonS3Manager.uploadFile(amazonS3Manager.generateSpotKeyName(image), multipartFile);
image.updateImageUrl(imageUrl);
Image savedImage = imageRepository.save(image);

Expand Down Expand Up @@ -132,7 +132,7 @@ public CommonDto createGuestBookImage(HttpServletRequest request, Long guestBook
.guestBook(guestBook)
.build();

String imageUrl = amazonS3Manager.uploadFile(amazonS3Manager.generateStoreKeyName(image), multipartFile);
String imageUrl = amazonS3Manager.uploadFile(amazonS3Manager.generateGuestBookKeyName(image), multipartFile);
image.updateImageUrl(imageUrl);
Image savedImage = imageRepository.save(image);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ttubeog/domain/road/domain/RoadType.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
public enum RoadType {

SPOT,
STORE;
STORE
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@Tag(name = "Road", description = "Road API(산책로 API)")
@RequiredArgsConstructor
@RestController
@RequestMapping("api/v1/road")
@RequestMapping("/api/v1/road")
public class RoadController {

private final RoadService roadService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.ttubeog.domain.spot.application;

import com.ttubeog.domain.auth.security.JwtTokenProvider;
import com.ttubeog.domain.benefit.domain.repository.BenefitRepository;
import com.ttubeog.domain.guestbook.domain.GuestBook;
import com.ttubeog.domain.guestbook.domain.repository.GuestBookRepository;
import com.ttubeog.domain.image.application.ImageService;
import com.ttubeog.domain.image.domain.Image;
import com.ttubeog.domain.image.domain.repository.ImageRepository;
import com.ttubeog.domain.likes.domain.repository.LikesRepository;
Expand Down Expand Up @@ -44,9 +42,6 @@ public class SpotService {
private final ImageRepository imageRepository;
private final GuestBookRepository guestBookRepository;
private final LikesRepository likesRepository;
private final BenefitRepository benefitRepository;

private final ImageService imageService;

private final JwtTokenProvider jwtTokenProvider;

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/ttubeog/domain/spot/domain/Spot.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
package com.ttubeog.domain.spot.domain;

import com.ttubeog.domain.area.domain.DongArea;
import com.ttubeog.domain.common.BaseEntity;
import com.ttubeog.domain.image.domain.Image;
import com.ttubeog.domain.member.domain.Member;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Many;
import org.hibernate.annotations.Fetch;

import java.util.List;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import lombok.Builder;
import lombok.Getter;

import java.util.List;

@Schema(description = "게시글 생성 DTO")
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.ttubeog.domain.spot.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ttubeog.domain.benefit.domain.BenefitType;
import com.ttubeog.domain.store.domain.StoreType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import lombok.Builder;
import lombok.Getter;

import java.util.List;


@Getter
@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ttubeog.domain.spot.presentation;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ttubeog.domain.guestbook.application.GuestBookService;
import com.ttubeog.domain.likes.application.LikesService;
import com.ttubeog.domain.member.exception.InvalidMemberException;
import com.ttubeog.domain.spot.application.SpotService;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/ttubeog/domain/store/domain/Store.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.ttubeog.domain.store.domain;

import com.ttubeog.domain.area.domain.DongArea;
import com.ttubeog.domain.common.BaseEntity;
import com.ttubeog.domain.member.domain.Member;
import jakarta.persistence.Table;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ttubeog.domain.store.presentation;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ttubeog.domain.benefit.application.BenefitService;
import com.ttubeog.domain.game.application.GameService;
import com.ttubeog.domain.game.dto.response.FindGameRes;
import com.ttubeog.domain.likes.application.LikesService;
Expand Down Expand Up @@ -37,10 +36,15 @@ public class StoreController {
private final GameService gameService;


// 매장 등록
/**
* 매장 등록 API
* @param request 유저 검증
* @param registerStoreReq 매장 등록 DTO
* @return ApiResponse (check: true, information: registerStoreRes)
*/
@Operation(summary = "매장 등록", description = "매장을 등록합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "매장 등록 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = RegisterStoreRes.class))}),
@ApiResponse(responseCode = "200", description = "OK", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = RegisterStoreRes.class))}),
@ApiResponse(responseCode = "400", description = "매장 등록 실패", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class))})
})
@PostMapping
Expand All @@ -51,10 +55,15 @@ public ResponseEntity<CommonDto> registerStore(
return ResponseEntity.ok(storeService.registerStore(request, registerStoreReq));
}

// 매장 수정
/**
* 매장 수정 API
* @param request 유저 검증
* @param updateStoreReq 매장 수정 DTO
* @return ApiResponse (check: true, information: updateStoreRes)
*/
@Operation(summary = "매장 수정", description = "매장 정보를 수정합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "매장 수정 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = UpdateStoreRes.class))}),
@ApiResponse(responseCode = "200", description = "OK", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = UpdateStoreRes.class))}),
@ApiResponse(responseCode = "400", description = "매장 수정 실패", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class))})
})
@PatchMapping
Expand All @@ -65,10 +74,15 @@ public ResponseEntity<CommonDto> updateStore(
return ResponseEntity.ok(storeService.updateStore(request, updateStoreReq));
}

// 매장 삭제
/**
* 매장 삭제 API
* @param request 유저 검증
* @param storeId 매장 ID
* @return ApiResponse (check: true, information: message)
*/
@Operation(summary = "매장 삭제", description = "매장 정보를 삭제합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "매장 삭제 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = Message.class))}),
@ApiResponse(responseCode = "200", description = "OK", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = Message.class))}),
@ApiResponse(responseCode = "400", description = "매장 삭제 실패", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class))})
})
@DeleteMapping("/{storeId}")
Expand All @@ -79,10 +93,15 @@ public ResponseEntity<CommonDto> deleteStore(
return ResponseEntity.ok(storeService.deleteStore(request, storeId));
}

// 매장 세부사항 조회
/**
* 매장 세부사항 조회 API
* @param request 유저검증
* @param storeId 매장 ID
* @return ApiResponse (check: true, information: getStoreDetailRes)
*/
@Operation(summary = "매장 세부사항 조회", description = "매장 세부사항을 조회합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "매장 세부사항 조회 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = GetStoreDetailRes.class))}),
@ApiResponse(responseCode = "200", description = "매장 ", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = GetStoreDetailRes.class))}),
@ApiResponse(responseCode = "400", description = "매장 세부사항 조회 실패", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class))})
})
@GetMapping("/{storeId}")
Expand All @@ -93,7 +112,12 @@ public ResponseEntity<CommonDto> getStoreDetails(
return ResponseEntity.ok(storeService.getStoreDetails(request, storeId));
}

// 매장 좋아요 누르기
/**
* 매장 좋아요 누르기 API
* @param request 유저 검증
* @param storeId 매장 ID
* @return ApiResponse (check: true, information: message)
*/
@Operation(summary = "매장 좋아요 누르기", description = "매장에 대한 좋아요를 누릅니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "매장 좋아요 누르기 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = Message.class))}),
Expand All @@ -107,7 +131,13 @@ public ResponseEntity<CommonDto> likesStore(
return ResponseEntity.ok(likesService.likesStore(request, storeId));
}

//StoreId로 매장, 혜택 조회
/**
* 매장 혜택 조회 API
* @param request 유저 검증
* @param storeId 매장 ID
* @return ApiResponse (check: true, information: findGameRes)
* @throws JsonProcessingException JSON Processing 에러
*/
@Operation(summary = "매장으로 게임, 혜택 조회", description = "매장ID에 해당하는 모든 게임과 해당 혜택을 조회합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "게임 조회 누르기 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = FindGameRes.class))}),
Expand Down
Loading

0 comments on commit b12d55e

Please sign in to comment.