Skip to content

Commit d8d333f

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 1c9abdd + a98215d commit d8d333f

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

src/main/java/com/example/timecoder/gateway/controller/TimecoderController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public Object linkThemes(@PathVariable("id") Long id, @RequestBody List<Long> th
7777
return timecoderServiceProxy.linkThemes(id, themeList);
7878
}
7979

80+
@RequestMapping(value = "/episodes/{id}/theme/{themeId}/unlink", method = RequestMethod.POST)
81+
public Object unlinkThemes(@PathVariable("id") Long id, @PathVariable("themeId") Long themeId) {
82+
return timecoderServiceProxy.unlinkThemes(id, themeId);
83+
}
84+
8085
@RequestMapping(value = "/episodes/{id}/remove", method = RequestMethod.DELETE)
8186
public Object deleteEpisode(@PathVariable("id") Long id) {
8287
return timecoderServiceProxy.deleteEpisode(id);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.example.timecoder.gateway.model;
2+
3+
import java.time.Instant;
4+
import java.util.Date;
5+
6+
public class ThemeDto {
7+
private Long id;
8+
private String title;
9+
private String timecode;
10+
private boolean passed = false;
11+
private Instant timestamp = Instant.now();
12+
private Date createdAt = new Date();
13+
14+
public Long getId() {
15+
return id;
16+
}
17+
18+
public void setId(Long id) {
19+
this.id = id;
20+
}
21+
22+
public String getTitle() {
23+
return title;
24+
}
25+
26+
public void setTitle(String title) {
27+
this.title = title;
28+
}
29+
30+
public String getTimecode() {
31+
return timecode;
32+
}
33+
34+
public void setTimecode(String timecode) {
35+
this.timecode = timecode;
36+
}
37+
38+
public boolean isPassed() {
39+
return passed;
40+
}
41+
42+
public void setPassed(boolean passed) {
43+
this.passed = passed;
44+
}
45+
46+
public Instant getTimestamp() {
47+
return timestamp;
48+
}
49+
50+
public void setTimestamp(Instant timestamp) {
51+
this.timestamp = timestamp;
52+
}
53+
54+
public Date getCreatedAt() {
55+
return createdAt;
56+
}
57+
58+
public void setCreatedAt(Date createdAt) {
59+
this.createdAt = createdAt;
60+
}
61+
}

src/main/java/com/example/timecoder/gateway/proxy/TimecoderServiceProxy.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.example.timecoder.gateway.payload.timecoder.EpisodePayload;
55
import com.example.timecoder.gateway.payload.timecoder.ThemePayload;
66
import org.springframework.cloud.openfeign.FeignClient;
7+
import org.springframework.web.bind.annotation.RequestBody;
78
import org.springframework.web.bind.annotation.RequestMapping;
89
import org.springframework.web.bind.annotation.RequestMethod;
910
import org.springframework.web.bind.annotation.RequestParam;
@@ -43,6 +44,9 @@ public interface TimecoderServiceProxy {
4344
@RequestMapping(value = "/episodes/{id}", method = RequestMethod.POST)
4445
Object linkThemes(@RequestParam Long id, List<Long> themeList);
4546

47+
@RequestMapping(value = "/episodes/{id}/theme/{themeId}/unlink", method = RequestMethod.POST)
48+
Object unlinkThemes(@RequestParam Long id, @RequestParam Long themeId);
49+
4650
@RequestMapping(value = "/episodes/{id}/remove", method = RequestMethod.DELETE)
4751
Object deleteEpisode(@RequestParam Long id);
4852

0 commit comments

Comments
 (0)