-
Notifications
You must be signed in to change notification settings - Fork 2
[Concert] 공연 좋아요 기능 추가 + admin 기능 분리 #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f762631
feat: 공연 좋아요 / 좋아요 해제 기능 추가
Creamcheesepie 9aca865
feat: AdminController 추가, 공연 갱신용 dto 추가
Creamcheesepie 52db291
feat: 공연 정보 수정, 삭제 추가
Creamcheesepie 4d6b5c2
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-…
Creamcheesepie 8b89be7
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-…
Creamcheesepie 289bb83
Merge branch 'feat/#56' into feat/#41
Creamcheesepie 74a81b1
feat : 좋아요 조회 기능 추가
Creamcheesepie fc724cf
feat : 좋아요 중복 입력시 예외 처리, 좋아요 안한 대상에 좋아요 해제 시 예외 처리, 좋아요 조회시 DTO 적용
Creamcheesepie 180cc1c
feat: 좋아요 한 공연의 목록 조회
Creamcheesepie 8554f97
feat: pageable 처리 수정
Creamcheesepie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
.../java/com/back/web7_9_codecrete_be/domain/concerts/controller/ConcertAdminController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package com.back.web7_9_codecrete_be.domain.concerts.controller; | ||
|
|
||
| import com.back.web7_9_codecrete_be.domain.concerts.dto.KopisApiDto.concert.ConcertListResponse; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.dto.KopisApiDto.concertPlace.ConcertPlaceListResponse; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.dto.concert.ConcertItem; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.dto.concert.ConcertUpdateRequest; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.service.ConcertService; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.service.KopisApiService; | ||
| import com.back.web7_9_codecrete_be.global.rsData.RsData; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Controller; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| @RestController | ||
| @RequiredArgsConstructor | ||
| @RequestMapping("/api/v1/admin/concerts/") | ||
| @Tag(name = "Concerts Admin", description = "공연에 대해서 관리하는 API입니다. ") | ||
| public class ConcertAdminController { // todo : 인증 권한 추가하기 | ||
| private final ConcertService concertService; | ||
| private final KopisApiService kopisApiService; | ||
|
|
||
| @GetMapping("tests") | ||
| public ConcertListResponse tests() { | ||
| return kopisApiService.getConcertsList(); | ||
| } | ||
|
|
||
| @GetMapping("totalGetTest") | ||
| public ConcertListResponse totalGetTest() throws InterruptedException { | ||
| return kopisApiService.setConcertsList(); | ||
| } | ||
|
|
||
| @GetMapping("setConcertPlace") | ||
| public ConcertPlaceListResponse setConcertPlace() throws InterruptedException { | ||
| return kopisApiService.setConcertPlace(); | ||
| } | ||
|
|
||
| @PatchMapping("updateConcert/{concertId}") | ||
| public RsData<ConcertItem> updateConcert( | ||
| @PathVariable Long concertId, | ||
| @RequestBody ConcertUpdateRequest concertUpdateRequest | ||
| ){ | ||
| ConcertItem concertItem = concertService.updateConcert(concertId, concertUpdateRequest); | ||
| return RsData.success("공연 정보 수정이 완료되었습니다.",concertItem); | ||
| } | ||
|
|
||
| @DeleteMapping("deleteConcert/{concertId}") | ||
| public RsData<Void> deleteConcert(@PathVariable Long concertId){ | ||
| concertService.deleteConcert(concertId); | ||
| return RsData.success("공연 정보 삭제에 성공하였습니다.",null); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...in/java/com/back/web7_9_codecrete_be/domain/concerts/dto/concert/ConcertLikeResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.back.web7_9_codecrete_be.domain.concerts.dto.concert; | ||
|
|
||
| import com.back.web7_9_codecrete_be.domain.concerts.entity.Concert; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.entity.ConcertLike; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public class ConcertLikeResponse { | ||
| private Long concertId; | ||
| private Boolean isLike; | ||
|
|
||
| public ConcertLikeResponse(Concert concert, Boolean isLike) { | ||
| this.concertId = concert.getConcertId(); | ||
| this.isLike = isLike; | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
...n/java/com/back/web7_9_codecrete_be/domain/concerts/dto/concert/ConcertUpdateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.back.web7_9_codecrete_be.domain.concerts.dto.concert; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| import java.time.LocalDate; | ||
|
|
||
| @Getter | ||
| public class ConcertUpdateRequest { | ||
| private Long concertId; | ||
| private String name; | ||
| private String description; | ||
| private Long placeId; | ||
| private LocalDate StartDate; | ||
| private LocalDate EndDate; | ||
| private String posterUrl; | ||
| private int maxPrice; | ||
| private int minPrice; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...n/java/com/back/web7_9_codecrete_be/domain/concerts/repository/ConcertLikeRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| package com.back.web7_9_codecrete_be.domain.concerts.repository; | ||
|
|
||
| import com.back.web7_9_codecrete_be.domain.concerts.entity.Concert; | ||
| import com.back.web7_9_codecrete_be.domain.concerts.entity.ConcertLike; | ||
| import com.back.web7_9_codecrete_be.domain.users.entity.User; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| @Repository | ||
| public interface ConcertLikeRepository extends JpaRepository<ConcertLike, Long> { | ||
| ConcertLike findConcertLikeByConcertAndUser(Concert concert, User user); | ||
|
|
||
| boolean existsConcertLikeByConcertAndUser(Concert concert, User user); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erd에 created_date로 되어있어서 아마 의미상으로는 erd쪽 수정이 맞을 것 같습니다!