Skip to content
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

feat: 축제 정보 구현 #188

Merged
merged 97 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
7113e7b
Merge pull request #146 from UnivApp/develop
nyeroni Oct 28, 2024
e1b838c
feat: 알림 시간 변경
nyeroni Oct 28, 2024
5af7ab6
Merge pull request #147 from UnivApp/feature/notification-refactor2
nyeroni Oct 28, 2024
7241d47
feat: firebase 환경 변수 등록
nyeroni Oct 28, 2024
1356c25
Merge pull request #148 from UnivApp/feature/notification-refactor3
nyeroni Oct 28, 2024
b93b9d6
Update gradle.yml
nyeroni Oct 28, 2024
4a35395
feat: firebase 등록
nyeroni Oct 28, 2024
82dcbb6
Merge pull request #149 from UnivApp/feature/notification-refactor4
nyeroni Oct 28, 2024
19c005e
Update gradle.yml
nyeroni Oct 28, 2024
ca174e1
refactor: 주석 제거
nyeroni Oct 28, 2024
2e6036c
Merge pull request #150 from UnivApp/feature/refactor24
nyeroni Oct 28, 2024
ef2820b
Update gradle.yml
nyeroni Oct 28, 2024
f32896a
feat: 환경변수 설정
nyeroni Oct 28, 2024
ac80b92
Merge pull request #151 from UnivApp/feature/refactor25
nyeroni Oct 28, 2024
90fc4bc
feat: 알림 삭제 기능 구현
nyeroni Oct 28, 2024
962346a
Merge pull request #152 from UnivApp/feature/notification-refactor5
nyeroni Oct 28, 2024
1227eb6
feat: 알림 구현 및 회원과 연관관계 설정
nyeroni Oct 28, 2024
f9ced8d
Merge pull request #153 from UnivApp/feature/notification-refactor6
nyeroni Oct 28, 2024
6bc7f84
refactor: 오타 수정
nyeroni Oct 28, 2024
0f646eb
Merge pull request #154 from UnivApp/feature/notification-refactor7
nyeroni Oct 28, 2024
c824755
refactor: 알림 구현 리팩토링
nyeroni Oct 28, 2024
4e500f3
Merge pull request #155 from UnivApp/feature/notification-refactor7
nyeroni Oct 28, 2024
dc515d3
feat: 알림 중복 설정 예외처리
nyeroni Oct 29, 2024
d18ed5b
Merge pull request #156 from UnivApp/feature/notification-refactor8
nyeroni Oct 29, 2024
273b883
feat: 알림 설정 날짜가 해당 이벤트의 날짜와 맞지 않으면 예외처리
nyeroni Oct 29, 2024
242dd61
feat: 해당 날짜만 알림 활성화 및 중복 알림 예외처리 리팩터링
nyeroni Oct 29, 2024
ed2534f
Merge pull request #157 from UnivApp/feature/notification-refactor9
nyeroni Oct 29, 2024
b24276d
feat: 알림 처리 어노테이션 설정
nyeroni Oct 30, 2024
8fbef4d
Merge pull request #158 from UnivApp/feature/notification-refactor10
nyeroni Oct 30, 2024
1ea80a0
refactor: 알림 처리 시간 변경
nyeroni Oct 30, 2024
3b5a53c
Merge pull request #159 from UnivApp/feature/notification-refactor11
nyeroni Oct 30, 2024
8111947
refactor: 알림 처리 시간 변경
nyeroni Oct 30, 2024
1ef1a35
Merge pull request #160 from UnivApp/feature/notification-refactor12
nyeroni Oct 30, 2024
a25f9bc
refactor: 알림 처리 시간 변경
nyeroni Oct 30, 2024
98603c0
Merge pull request #161 from UnivApp/feature/notification-refactor13
nyeroni Oct 30, 2024
c4e3a24
refactor: 알림 처리 시간 변경 및 예외처리 추가
nyeroni Oct 30, 2024
740b8b9
refactor: fcm apns 수정
nyeroni Oct 30, 2024
0d0a30e
refactor: 알림 시간 수정
nyeroni Oct 30, 2024
c08f3f2
refactor: 알림 시간 수정 및 fcm 오류 해결
nyeroni Oct 30, 2024
ad21ba6
refactor: fcm 오류 해결
nyeroni Oct 30, 2024
4172246
refactor: fcm 오류 해결
nyeroni Oct 30, 2024
728f53d
refactor: fcm 오류 해결
nyeroni Oct 30, 2024
a586543
Merge pull request #162 from UnivApp/feature/notification-refactor14
nyeroni Oct 30, 2024
1d7fbdd
refactor: 알림 시간 변경
nyeroni Oct 30, 2024
0805b86
Merge pull request #163 from UnivApp/feature/notification-refactor15
nyeroni Oct 30, 2024
c6a528c
refactor: 알림 시간 변경
nyeroni Oct 30, 2024
e97b249
Merge pull request #164 from UnivApp/feature/notification-refactor16
nyeroni Oct 30, 2024
34ec645
refactor: 알림 시간 변경
nyeroni Oct 30, 2024
9d37b46
Merge pull request #165 from UnivApp/feature/notification-refactor17
nyeroni Oct 30, 2024
4bd25f9
refactor: 알림 시간 변경 및 예외처리 수정
nyeroni Oct 30, 2024
27f9c42
Merge pull request #166 from UnivApp/feature/notification-refactor18
nyeroni Oct 30, 2024
88c2cec
refactor: 알림 시간 변경 및 통신 인자 수정
nyeroni Oct 30, 2024
6e8581b
Merge pull request #167 from UnivApp/feature/notification-refactor19
nyeroni Oct 30, 2024
00eeff9
feat: 닉네임 구현
nyeroni Oct 31, 2024
0266e63
Merge pull request #168 from UnivApp/feature/member-nickname
nyeroni Oct 31, 2024
2903bee
refactor: 알림 시간 수정 및 문구 수정
nyeroni Oct 31, 2024
ca544af
Merge pull request #169 from UnivApp/feature/notification-refactor20
nyeroni Oct 31, 2024
7bb4f46
refactor: 알림 생성 반환 필드 수정
nyeroni Nov 1, 2024
47cbdd7
Merge pull request #170 from UnivApp/feature/notification-refactor21
nyeroni Nov 1, 2024
414399f
feat: 닉네임 중복 체크 구현
nyeroni Nov 1, 2024
c6235b4
Merge pull request #171 from UnivApp/feature/member-nickname-refactor
nyeroni Nov 1, 2024
1ed11a7
feat: 닉네임 존재 여부 체크
nyeroni Nov 2, 2024
aede68c
feat: 닉네임 존재 여부 체크
nyeroni Nov 2, 2024
18aedf2
Merge pull request #172 from UnivApp/feature/member-nickname-refactor2
nyeroni Nov 2, 2024
43af2ea
feat: 학교 맛집 kakao api 사용하여 받아옴
nyeroni Nov 4, 2024
4cf5268
Merge pull request #173 from UnivApp/feature/kakao-api
nyeroni Nov 4, 2024
3ad41b9
feat: swagger 문서 작성
nyeroni Nov 4, 2024
fbd9308
Merge pull request #174 from UnivApp/feature/kakao-api-refactor
nyeroni Nov 4, 2024
f42025d
feat: 알림 조회 수정
nyeroni Nov 5, 2024
6982c0c
Merge pull request #175 from UnivApp/feature/notification-refactor22
nyeroni Nov 5, 2024
ee3a8ce
feat: 맛집 조회 위도 경도 반환
nyeroni Nov 5, 2024
e8996be
Merge pull request #176 from UnivApp/feature/restaurant-refactor7
nyeroni Nov 5, 2024
b8ca7f4
feat: 맛집 조회 서브 네임 추가
nyeroni Nov 6, 2024
a268f14
Merge pull request #177 from UnivApp/feature/restaurant-refactor8
nyeroni Nov 6, 2024
dba92bc
feat: 핫플 TOP10 설정
nyeroni Nov 13, 2024
596578b
Merge pull request #178 from UnivApp/feature/activiy-refactor2
nyeroni Nov 13, 2024
ae1ec19
feat: 기타 카테고리 추가
nyeroni Nov 14, 2024
65aed3d
Merge pull request #179 from UnivApp/feature/expo-refactor
nyeroni Nov 14, 2024
e0265fb
feat: link null 허용
nyeroni Nov 14, 2024
20b1ef0
Merge pull request #180 from UnivApp/feature/expo-refactor2
nyeroni Nov 14, 2024
3b6f7f1
refactor: 닉네임 처리 수정
nyeroni Nov 14, 2024
78add53
Merge pull request #181 from UnivApp/feature/nickname-refactor
nyeroni Nov 14, 2024
5fdce63
refactor: 닉네임 처리 수정
nyeroni Nov 14, 2024
07b3e48
refactor: 닉네임 처리 수정
nyeroni Nov 14, 2024
f98d126
Merge pull request #182 from UnivApp/feature/nickname-refactor2
nyeroni Nov 14, 2024
862f944
refactor: 등록금 반환 수정
nyeroni Nov 14, 2024
80a9d6a
Merge pull request #183 from UnivApp/feature/tuition-fee-refactor1
nyeroni Nov 14, 2024
62281c6
refactor: 등록금 타입명 한글로 변경
nyeroni Nov 14, 2024
2d3cbc1
Merge pull request #184 from UnivApp/feature/tuition-fee-refactor2
nyeroni Nov 14, 2024
dbc844e
refactor: 알림 설정 반환 리팩토링
nyeroni Nov 14, 2024
369aadf
Merge pull request #185 from UnivApp/feature/notification-refactor23
nyeroni Nov 14, 2024
1872e31
refactor: 알림 설정 반환 리팩토링
nyeroni Nov 14, 2024
8a4e901
Merge pull request #186 from UnivApp/feature/notification-refactor24
nyeroni Nov 14, 2024
eaf88af
refactor: 점수 범위 수정
nyeroni Nov 15, 2024
70d1db5
Merge pull request #187 from UnivApp/feature/matching-refactor
nyeroni Nov 15, 2024
77c0225
feat: 축제 정보 구현
nyeroni Nov 20, 2024
a12f424
feat: 축제 정보 구현
nyeroni Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Set environment variables
run: echo "FIREBASE_CONFIG=${{ secrets.FIREBASE_CONFIG }}"

- name: Zip the JAR file
run: zip -r myapp.zip build/libs/*.jar appspec.yml scripts

Expand Down Expand Up @@ -79,4 +82,4 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
distribution: 'temurin'
2 changes: 2 additions & 0 deletions src/main/java/yerong/wedle/WedleApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@EnableJpaAuditing
@SpringBootApplication
public class WedleApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import yerong.wedle.calendar.dto.CalendarEventResponse;
import yerong.wedle.calendar.service.CalendarEventService;
Expand All @@ -34,5 +31,4 @@ public ResponseEntity<List<CalendarEventResponse>> getAllEvents() {
List<CalendarEventResponse> responses = calendarEventService.getAll();
return ResponseEntity.ok(responses);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
@AllArgsConstructor
public class CalendarEventResponse {

private Long id;
private Long calendarEventId;
private String title;
private LocalDate date;
private String type;

private boolean notificationActive;
private Long notificationId;
}
Original file line number Diff line number Diff line change
@@ -1,54 +1,83 @@
package yerong.wedle.calendar.service;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import yerong.wedle.calendar.domain.CalendarEvent;
import yerong.wedle.calendar.dto.CalendarEventResponse;
import yerong.wedle.calendar.exception.CalendarEventNotFoundException;
import yerong.wedle.calendar.repository.CalendarEventRepository;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import yerong.wedle.member.domain.Member;
import yerong.wedle.member.exception.MemberNotFoundException;
import yerong.wedle.member.repository.MemberRepository;
import yerong.wedle.notification.domain.Notification;
import yerong.wedle.notification.repository.NotificationRepository;

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class CalendarEventService {

private final CalendarEventRepository calendarEventRepository;
private final NotificationRepository notificationRepository;
private final MemberRepository memberRepository;

public List<CalendarEventResponse> getAll() {
List<CalendarEvent> calendarEvents = calendarEventRepository.findAll();

return calendarEvents.stream()
.flatMap(event -> convertToDto(event).stream())
.collect(Collectors.toList());
return convertToDto(calendarEvents);
}

public List<CalendarEventResponse> convertToDto(CalendarEvent calendarEvent) {
LocalDate startDate = calendarEvent.getStartDate();
LocalDate endDate = calendarEvent.getEndDate();

if (endDate == null) {
return List.of(new CalendarEventResponse(
calendarEvent.getId(),
calendarEvent.getTitle(),
startDate,
calendarEvent.getCalendarEventType().getDisplayName()
));
}
public List<CalendarEventResponse> convertToDto(List<CalendarEvent> calendarEvents) {
List<CalendarEventResponse> calendarEventResponses = new ArrayList<>();
String socialId = getCurrentUserId();
Member member = memberRepository.findBySocialId(socialId)
.orElseThrow(MemberNotFoundException::new);
for (CalendarEvent calendarEvent : calendarEvents) {
LocalDate startDate = calendarEvent.getStartDate();
LocalDate endDate = calendarEvent.getEndDate();

return startDate.datesUntil(endDate.plusDays(1))
.map(date -> new CalendarEventResponse(
if (endDate == null) {
Notification notification = notificationRepository.findByMemberAndEventAndNotificationDate(member,
calendarEvent, startDate).orElse(null);
Long notificationId = notification != null ? notification.getNotificationId() : null;
calendarEventResponses.add(new CalendarEventResponse(
calendarEvent.getId(),
calendarEvent.getTitle(),
date,
calendarEvent.getCalendarEventType().getDisplayName()
))
.collect(Collectors.toList());
startDate,
calendarEvent.getCalendarEventType().getDisplayName(),
notification != null && notification.isActive() && notification.getNotificationDate()
.equals(startDate),
notificationId
));
} else {
startDate.datesUntil(endDate.plusDays(1))
.forEach(date -> {
Notification notification = notificationRepository.findByMemberAndEventAndNotificationDate(
member, calendarEvent, date).orElse(null);
Long notificationId = notification != null ? notification.getNotificationId() : null;
boolean isActive = notification != null && notification.isActive()
&& notification.getNotificationDate().equals(date);

calendarEventResponses.add(new CalendarEventResponse(
calendarEvent.getId(),
calendarEvent.getTitle(),
date,
calendarEvent.getCalendarEventType().getDisplayName(),
isActive,
notificationId
));
});
}
}
return calendarEventResponses;
}

private String getCurrentUserId() {
String socialId = SecurityContextHolder.getContext().getAuthentication().getName();

return socialId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public List<ActivityResponse> getActivitiesByUniversityId(Long universityId) {

@Transactional
public List<ActivityResponse> getActivitiesByIds() {
List<Long> activityIds = Arrays.asList(45L, 51L, 94L, 59L, 48L, 18L, 16L, 11L, 19L, 114L);
List<Long> activityIds = Arrays.asList(45L, 50L, 101L, 59L, 138L, 18L, 53L, 13L, 19L, 128L);

List<Activity> activities = activityRepository.findByActivityIdIn(activityIds);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package yerong.wedle.category.event.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yerong.wedle.category.event.dto.ArtistTop10Response;
import yerong.wedle.category.event.service.ArtistService;

@Tag(name = "Artist API", description = "아티스트 정보 API")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/artists")
public class ArtistController {

private final ArtistService artistService;

@Operation(
summary = "가장 많이 방문한 아티스트 조회",
description = "대학교에서 가장 많이 방문한 아티스트 TOP 10을 조회합니다."
)
@GetMapping("/top")
public ResponseEntity<List<ArtistTop10Response>> getTopArtists() {
List<ArtistTop10Response> topArtists = artistService.getTopArtists();
return ResponseEntity.ok(topArtists);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package yerong.wedle.category.event.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import yerong.wedle.category.event.dto.UniversityFestivalResponse;
import yerong.wedle.category.event.service.FestivalService;

@Tag(name = "Festival API", description = "대학교 관련 축제 정보 API")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/festivals")
public class FestivalApiController {
private final FestivalService eventService;

@Operation(
summary = "대학교 이벤트 조회",
description = "대학교 ID를 이용해 해당 대학교에서 진행된 이벤트 목록을 조회합니다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공적으로 축제 목록 조회"),
@ApiResponse(responseCode = "404", description = "해당 대학교를 찾을 수 없음")
}
)
@GetMapping
public ResponseEntity<UniversityFestivalResponse> getEventsByUniversityId(@RequestParam Long universityId) {
UniversityFestivalResponse eventsByUniversityId = eventService.getFestivalsByUniversityId(universityId);
return ResponseEntity.ok(eventsByUniversityId);
}
}
35 changes: 35 additions & 0 deletions src/main/java/yerong/wedle/category/event/domain/Artist.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package yerong.wedle.category.event.domain;

import static lombok.AccessLevel.PROTECTED;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import java.util.Set;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(access = PROTECTED)
@Entity
public class Artist {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "artist_id")
private Long artistId;

@Column(nullable = false)
private String name;
@Column(nullable = false)
private String subname;

private final String image = "";

@OneToMany(mappedBy = "artist", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<FestivalArtist> eventArtists;
}
47 changes: 0 additions & 47 deletions src/main/java/yerong/wedle/category/event/domain/Event.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/main/java/yerong/wedle/category/event/domain/EventDetails.java

This file was deleted.

Loading