-
Notifications
You must be signed in to change notification settings - Fork 0
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 #117 from TEAM-DAWM/feat/116
[feat] 동기화 기능 추가 및 카테고리와 스케줄 db 저장 로직 구현
- Loading branch information
Showing
15 changed files
with
438 additions
and
154 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package nutshell.server.domain; | ||
|
||
|
||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.redis.core.RedisHash; | ||
import org.springframework.data.redis.core.index.Indexed; | ||
|
||
@Getter | ||
@RedisHash(value="google_category") | ||
@NoArgsConstructor(access= AccessLevel.PROTECTED) | ||
public class GoogleCategory { | ||
@Id | ||
private String id; | ||
@Indexed | ||
private Long googleCalendarId; | ||
private String name; | ||
private String color; | ||
|
||
|
||
@Builder | ||
public GoogleCategory(String id, Long googleCalendarId, String name, String color) { | ||
this.id = id; | ||
this.googleCalendarId = googleCalendarId; | ||
this.name = name; | ||
this.color = color; | ||
} | ||
} |
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,37 @@ | ||
package nutshell.server.domain; | ||
|
||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import nutshell.server.dto.googleCalender.response.GoogleSchedulesDto; | ||
import org.springframework.data.redis.core.RedisHash; | ||
import org.springframework.data.redis.core.index.Indexed; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@RedisHash(value="google_schedule") | ||
@NoArgsConstructor(access= AccessLevel.PROTECTED) | ||
public class GoogleSchedule { | ||
@Id | ||
private String id; | ||
@Indexed | ||
private Long googleCalendarId; | ||
@Indexed | ||
private String googleCategoryId; | ||
private String name; | ||
private String color; | ||
private List<GoogleSchedulesDto.GoogleScheduleDto> schedules; | ||
|
||
@Builder | ||
public GoogleSchedule(String id, Long googleCalendarId, String googleCategoryId, String name, String color, List<GoogleSchedulesDto.GoogleScheduleDto> schedules) { | ||
this.id = id; | ||
this.googleCalendarId = googleCalendarId; | ||
this.googleCategoryId = googleCategoryId; | ||
this.name = name; | ||
this.color = color; | ||
this.schedules = schedules; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/nutshell/server/repository/GoogleCategoryRepository.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,10 @@ | ||
package nutshell.server.repository; | ||
|
||
import nutshell.server.domain.GoogleCategory; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface GoogleCategoryRepository extends CrudRepository<GoogleCategory, String> { | ||
List<GoogleCategory> findAllByGoogleCalendarId(final Long googleCalendarId); | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/nutshell/server/repository/GoogleScheduleRepository.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,10 @@ | ||
package nutshell.server.repository; | ||
|
||
import nutshell.server.domain.GoogleSchedule; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface GoogleScheduleRepository extends CrudRepository<GoogleSchedule, String> { | ||
List<GoogleSchedule> findAllByGoogleCalendarId(Long googleCalendarId); | ||
} |
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.