-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Central-MakeUs/fix/screeningReview
[Fix]screening review
- Loading branch information
Showing
29 changed files
with
520 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
43 changes: 43 additions & 0 deletions
43
Api/src/main/java/com/example/api/fcm/controller/FcmController.java
This file contains 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,43 @@ | ||
package com.example.api.fcm.controller; | ||
|
||
import com.example.api.config.security.SecurityUtil; | ||
import com.example.fcm.request.FcmRegistrationRequest; | ||
import com.example.fcm.service.FcmService; | ||
import com.google.firebase.auth.FirebaseAuth; | ||
import com.google.firebase.auth.FirebaseAuthException; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import static io.netty.handler.codec.http.HttpResponseStatus.CREATED; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequestMapping("/fcm") | ||
@RequiredArgsConstructor | ||
public class FcmController { | ||
|
||
private final FcmService fcmService; | ||
|
||
@PostMapping("/{userId}") | ||
public ResponseEntity<Void> fcmTokenRegistration( | ||
@PathVariable("userId") Long userId, | ||
@RequestBody FcmRegistrationRequest request) { | ||
// Long userId = SecurityUtil.getCurrentUserId(); | ||
fcmService.registerFCMToken(userId, request); | ||
return ResponseEntity | ||
.status(CREATED.code()) | ||
.build(); | ||
} | ||
|
||
@GetMapping | ||
public void fcmToken() throws FirebaseAuthException { | ||
String uid = "some-uid"; | ||
|
||
String customToken = FirebaseAuth.getInstance().createCustomToken(uid); | ||
System.out.println(customToken); | ||
} | ||
|
||
} |
This file contains 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
110 changes: 110 additions & 0 deletions
110
Api/src/main/java/com/example/api/screening/dto/response/ScreeningInfoResponse.java
This file contains 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,110 @@ | ||
package com.example.api.screening.dto.response; | ||
|
||
import com.example.domains.screening.entity.Screening; | ||
import com.example.domains.screening.enums.Category; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
public class ScreeningInfoResponse { | ||
@Schema(defaultValue = "1", description = "스크리닝 id") | ||
private Long screeningId; | ||
|
||
@Schema(defaultValue = "https://jgjfhdjghsdkjhgkjd", description = "상영회 대표 이미지") | ||
private String posterImgUrl; | ||
|
||
@Schema(defaultValue = "홍익대학교 졸업전시회", description = "상영회 제목") | ||
private String screeningTitle; | ||
|
||
@Schema(defaultValue = "이한비", description = "주최자명") | ||
private String hostName; | ||
|
||
@Schema(defaultValue = "졸업상영", description = "카테고리(\"졸업상영\"/\"과제상영\"/\"정기상영\"/\"특별상영\"/\"기타\")") | ||
private Category category; | ||
|
||
@Schema(defaultValue = "2023-02-13", description = "시작 날짜") | ||
private LocalDateTime screeningStartDate; | ||
|
||
@Schema(defaultValue = "2023-02-14", description = "종료 날짜") | ||
private LocalDateTime screeningEndDate; | ||
|
||
@Schema(defaultValue = "13:00", description = "시작 시간") | ||
private LocalDateTime screeningStartTime; | ||
|
||
@Schema(defaultValue = "홍익대학교", description = "주최 장소") | ||
private String location; | ||
|
||
@Schema(defaultValue = "졸업 작품보러오세요", description = "상영회 정보") | ||
private String information; | ||
|
||
@Schema(defaultValue = "https://sdhgfhsdjkfsjjgsh.com", description = "신청 폼 링크") | ||
private String formUrl; | ||
|
||
@Schema(defaultValue = "010-0000-0000", description = "주최자 전화번호") | ||
private String hostPhoneNumber; | ||
|
||
@Schema(defaultValue = "[email protected]", description = "주최자 이메일") | ||
private String hostEmail; | ||
@Schema(defaultValue = "true", description = "정책 동의 여부") | ||
private boolean hasAgreed; | ||
|
||
@Schema(defaultValue = "false", description = "정책 동의 여부") | ||
private boolean isPrivate; | ||
|
||
@Schema(defaultValue = "false", description = "찜하기 여부") | ||
private boolean isBookmarked; | ||
|
||
@Schema(defaultValue = "false", description = "리뷰 여부") | ||
private boolean isReviewed; | ||
|
||
|
||
@Builder | ||
public ScreeningInfoResponse(Long screeningId, | ||
String screeningTitle, String posterImgUrl, String hostName, String hostEmail, String hostPhoneNumber , String location, String formUrl, | ||
String information, boolean hasAgreed, Category category, LocalDateTime screeningStartDate, LocalDateTime screeningEndDate, LocalDateTime screeningStartTime, | ||
boolean isPrivate, boolean isBookmarked, boolean isReviewed | ||
) { | ||
this.screeningId = screeningId; | ||
this.screeningTitle = screeningTitle; | ||
this.posterImgUrl = posterImgUrl; | ||
this.hostName = hostName; | ||
this.location = location; | ||
this.formUrl = formUrl; | ||
this.information = information; | ||
this.hasAgreed = hasAgreed; | ||
this.screeningStartDate = screeningStartDate; | ||
this.screeningEndDate = screeningEndDate; | ||
this.screeningStartTime = screeningStartTime; | ||
this.category = category; | ||
this.hostEmail = hostEmail; | ||
this.hostPhoneNumber = hostPhoneNumber; | ||
this.isPrivate = isPrivate; | ||
this.isBookmarked = isBookmarked; | ||
this.isReviewed = isReviewed; | ||
} | ||
|
||
public static ScreeningInfoResponse from(Screening screening,boolean isBookmarked, boolean isReviewed) { | ||
return ScreeningInfoResponse .builder() | ||
.screeningId(screening.getId()) | ||
.screeningTitle(screening.getTitle()) | ||
.posterImgUrl(screening.getPosterImgUrl()) | ||
.hostName(screening.getHostInfo().getHostName()) | ||
.location(screening.getLocation()) | ||
.formUrl(screening.getParticipationUrl()) | ||
.information(screening.getInformation()) | ||
.hasAgreed(screening.isHasAgreed()) | ||
.screeningStartDate(screening.getScreeningStartDate()) | ||
.screeningEndDate(screening.getScreeningEndDate()) | ||
.screeningStartTime(screening.getScreeningStartTime()) | ||
.category(screening.getCategory()) | ||
.hostEmail(screening.getHostInfo().getHostEmail()) | ||
.isPrivate(screening.isPrivate()) | ||
.isBookmarked(isBookmarked) | ||
.isReviewed(isReviewed) | ||
.build(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
Api/src/main/java/com/example/api/screening/service/GetPastScreeningListUseCase.java
This file contains 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,22 @@ | ||
package com.example.api.screening.service; | ||
|
||
import com.example.adaptor.UseCase; | ||
import com.example.api.config.security.SecurityUtil; | ||
import com.example.domains.screening.adaptor.ScreeningAdaptor; | ||
import com.example.domains.screening.entity.Screening; | ||
import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@UseCase | ||
@RequiredArgsConstructor | ||
public class GetPastScreeningListUseCase { | ||
private final ScreeningAdaptor screeningAdaptor; | ||
public List<Screening> execute() { | ||
Long userId = SecurityUtil.getCurrentUserId(); | ||
|
||
List<Screening> screenings = screeningAdaptor.getBookmarkedScreenings(userId); | ||
return screenings; | ||
} | ||
} |
This file contains 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 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.