summaryrefslogtreecommitdiff
path: root/21-implementierungsheft-kolloquium/assets/diagrams/classdiagram-episode-actions.puml
blob: 7a4530e88e184195aefa49480e3302672ecacf8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@startuml

package episodeActionsAPI <<Frame>> {
    package episodeActionDataAccessLayer <<Frame>> {
        class EpisodeActionDataAccessService <<@Repository>> {
            <<create>> EpisodeActionDataAccessService (JpaTemplate jpaTemplate)
            long addEpisodeActions(String username, List<EpisodeActionPost> episodeActionPosts)
            List<EpisodeActionPost> getEpisodeActions(String username)
            List<EpisodeActionPost> getEpisodeActionsOfPodcast(String username, String podcastURL)
            List<EpisodeActionPost> getEpisodeActionsSince(String username, LocalDateTime since)
            List<EpisodeActionPost> getEpisodeActionsOfPodcastSince(String username, String podcastURL, LocalDateTime since)
        }
        
        interface EpisodeActionDao {
            long addEpisodeActions(String username, List<EpisodeActionPost> episodeActionPosts)
            List<EpisodeActionPost> getEpisodeActions(String username)
            List<EpisodeActionPost> getEpisodeActionsOfPodcast(String username, String podcastURL)
            List<EpisodeActionPost> getEpisodeActionsSince(String username, LocalDateTime since)
            List<EpisodeActionPost> getEpisodeActionsOfPodcastSince(String username, String podcastURL, LocalDateTime since)
        }
    }

    package episodeActionService <<Frame>> {
        class EpisodeActionService <<@Service>> {
            <<create>> EpisodeActionService (EpisodeActionDao episodeActionDao)
            LocalDateTime addEpisodeActions(String username, List<EpisodeActionPosts> episodeActionPosts)
            List<EpisodeActionPost> getEpisodeActions(String username)
            List<EpisodeActionPost> getEpisodeActionsOfPodcast(String username, String podcastURL)
            List<EpisodeActionPost> getEpisodeActionsSince(String username, LocalDateTime since)
            List<EpisodeActionPost> getEpisodeActionsOfPodcastSince(String username, String podcastURL, LocalDateTime since)  
        }
    }

    package episodeActionController <<Frame>> {
        class EpisodeActionController <<@Controller>>{
            <<create>> EpisodeActionController (EpisodeActionService episodeActionService)
            ResponseEntity<EpisodeActionPostResponse> addEpisodeActions(String username, EpisodeActionPostRequest episodeActionPostRequest)
            ResponseEntity<EpisodeActionGetResponse> getEpisodeActions(String username, String deviceID, boolean aggregated)
            ResponseEntity<EpisodeActionGetResponse> getEpisodeActionsOfPodcast(String username, String podcastURL, String deviceID, boolean aggregated)
            ResponseEntity<EpisodeActionGetResponse> getEpisodeActionsSince(String username, String deviceID, long since, boolean aggregated)
            ResponseEntity<EpisodeActionGetResponse> getEpisodeActionsOfPodcastSince(String username, String podcastURL, String deviceID, long since, boolean aggregated)
        }

        class EpisodeActionPostResponse {
            <<create>> EpisodeActionPostResponse(List<Pair<String, String>> updateURLs)
            long getTimestamp()
            List<Pair<String, String>> getUpdatedURLs()
        }

        class EpisodeActionPost {
            <<create>> EpisodeActionPost(String podcastURL, String episodeURL, Action action, LocalDateTime timestamp, int started, int position)
            String getPodcastURL()
            String getEpisodeURL()
            int getGUID()
            Action getAction()
            LocalDateTime getTimestamp()
            int getStarted()
            int getPosition()
            EpisodeAction getEpisodeAction()
        }

        class EpisodeActionPostRequest {
            <<create>> EpisodeActionPostRequest(List<EpisodeActionPost> episodeActionPosts)
            List<EpisodeActionPost> getEpisodeActionPosts()
        }

        class EpisodeActionGetResponse {
            <<create>> EpisodeActionGetResponse(List<EpisodeActionPost> episodeActionPosts)
            List<EpisodeActionPost> getEpisodeActionPosts()
            long getTimestamp()
        }
    }
}

EpisodeActionPost -o EpisodeActionGetResponse 
EpisodeActionPost -o EpisodeActionPostRequest
' EpisodeAction <.. EpisodeActionDataAccessService: DB
' Episode <.. EpisodeActionDataAccessService: DB
EpisodeActionDao <.. EpisodeActionService: <<use>>
EpisodeActionService --o EpisodeActionController
EpisodeActionDao <|. EpisodeActionDataAccessService: <<realize>>

@enduml