-
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 #22 from f-lab-edu/issue19
issue19
- Loading branch information
Showing
10 changed files
with
61 additions
and
164 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 was deleted.
Oops, something went wrong.
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
44 changes: 0 additions & 44 deletions
44
mitube-app/src/main/java/com/misim/repository/ViewRepository.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
mitube-app/src/main/java/com/misim/service/AsyncService.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,25 @@ | ||
package com.misim.service; | ||
|
||
import com.misim.entity.Video; | ||
import com.misim.entity.WatchingInfo; | ||
import com.misim.repository.VideoRepository; | ||
import com.misim.repository.WatchingInfoRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class AsyncService { | ||
|
||
private final VideoRepository videoRepository; | ||
private final WatchingInfoRepository watchingInfoRepository; | ||
|
||
@Async | ||
public void startWatchingVideo(Video video, WatchingInfo watchingInfo) { | ||
videoRepository.save(video); | ||
if (watchingInfo.getId() == null) { | ||
watchingInfoRepository.save(watchingInfo); | ||
} | ||
} | ||
} |
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
37 changes: 0 additions & 37 deletions
37
mitube-app/src/main/java/com/misim/service/ViewService.java
This file was deleted.
Oops, something went wrong.