Skip to content

Commit

Permalink
Merge pull request #124 from themoment-team/feature/popup
Browse files Browse the repository at this point in the history
팝업 제목, 권한 추가
  • Loading branch information
jangwooooo authored Jan 12, 2024
2 parents 8a2797e + 7fc3193 commit 82bbd6d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@NoArgsConstructor
public class AddPopupRequest {

private String title;
private String link;

private LocalDateTime expirationDateTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ public class Popup {
@Column(name = "popup_seq")
private Long popupSeq;

@Column(name = "image_url", nullable = false)
private String imageUrl;
@Column(name = "popup_image_url", nullable = false)
private String popupImageUrl;

@Column(name = "link", nullable = true)
private String link;
@Column(name = "popup_title", nullable = false)
private String popupTitle;

@Column(name = "expiration_date_time", nullable = false)
private LocalDateTime expirationDateTime;
@Column(name = "popup_link", nullable = true)
private String popupLink;

@Column(name = "popup_expiration_date_time", nullable = false)
private LocalDateTime popupExpirationDateTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public class PopupService {
public void addPopup(AddPopupRequest addPopupRequest, MultipartFile image) {
FileDto fileDto = awsS3Util.fileUploadProcess(List.of(image)).get(0);
Popup popup = Popup.builder()
.imageUrl(fileDto.getFileUrl())
.link(addPopupRequest.getLink())
.expirationDateTime(addPopupRequest.getExpirationDateTime())
.popupImageUrl(fileDto.getFileUrl())
.popupTitle(addPopupRequest.getTitle())
.popupLink(addPopupRequest.getLink())
.popupExpirationDateTime(addPopupRequest.getExpirationDateTime())
.build();

popupRepository.save(popup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity)throws Exceptio
.requestMatchers("/api/auth/userinfo").authenticated()
.requestMatchers("/api/auth/username").authenticated()
.requestMatchers("/api/post/**").hasAnyAuthority("ADMIN", "MASTER")
.requestMatchers("/api/popup/**").hasAnyAuthority("ADMIN", "MASTER")
.requestMatchers("/api/auth/unapproved/list").hasAnyAuthority("ADMIN", "MASTER")
.requestMatchers("/api/auth/approved/**").hasAnyAuthority("ADMIN", "MASTER")
.anyRequest().permitAll();
Expand Down

0 comments on commit 82bbd6d

Please sign in to comment.