William Simkins vor 6 Jahren
Ursprung
Commit
da69e16568

+ 4
- 3
src/main/java/com/tyler/motivateme/controller/ForumController.java Datei anzeigen

@@ -1,5 +1,6 @@
1 1
 package com.tyler.motivateme.controller;
2 2
 
3
+import com.tyler.motivateme.model.Comment;
3 4
 import com.tyler.motivateme.model.Topic;
4 5
 import com.tyler.motivateme.service.ForumService;
5 6
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,15 +16,15 @@ public class ForumController {
15 16
     ForumService forumService;
16 17
 
17 18
     @RequestMapping(method = RequestMethod.POST, value = "/forum/{forumid}")
18
-    public void PostComment(int forumID){
19
+    public void PostComment(Comment forumID){
19 20
         forumService.postComment(forumID); }
20 21
 
21 22
     @RequestMapping(method = RequestMethod.PUT, value = "/forum/{commentid}")
22
-    public void updateComment(int commentID){
23
+    public void updateComment(Comment commentID){
23 24
         forumService.updateComment(commentID); }
24 25
 
25 26
     @RequestMapping(method = RequestMethod.DELETE, value = "/forum/{commentid}")
26
-    public void deleteComment(int commentID){
27
+    public void deleteComment(Comment commentID){
27 28
         forumService.deleteComment(commentID); }
28 29
 
29 30
 

+ 10
- 10
src/main/java/com/tyler/motivateme/controller/InboxController.java Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 package com.tyler.motivateme.controller;
2 2
 
3
-import com.tyler.motivateme.model.Topic;
3
+import com.tyler.motivateme.model.Message;
4 4
 import com.tyler.motivateme.service.InboxService;
5 5
 import org.springframework.beans.factory.annotation.Autowired;
6 6
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -14,21 +14,21 @@ public class InboxController {
14 14
     @Autowired
15 15
     InboxService inboxService;
16 16
 
17
-    @RequestMapping(method = RequestMethod.POST, value = "/inbox/{userid}")
18
-    public void sendMessage(int userID){
17
+    @RequestMapping(method = RequestMethod.POST, value = "/inbox/")
18
+    public void sendMessage(Message userID){
19 19
         inboxService.sendMessage(userID); }
20 20
 
21
-    @RequestMapping(method = RequestMethod.GET, value = "/inbox/{messageid}")
22
-    public void viewMessage(int messageID){
23
-        inboxService.viewMessage(messageID); }
21
+    @RequestMapping(method = RequestMethod.GET, value = "/inbox/")
22
+    public void viewMessage(Integer messageID){
23
+        inboxService.getAllMessages(messageID); }
24 24
 
25 25
 
26
-    @RequestMapping(method = RequestMethod.PUT, value = "/inbox/{messageid}")
27
-    public void updateMessage(int messageID){
26
+    @RequestMapping(method = RequestMethod.PUT, value = "/inbox/")
27
+    public void updateMessage(Message messageID){
28 28
         inboxService.updateMessage(messageID); }
29 29
 
30
-    @RequestMapping(method = RequestMethod.DELETE, value = "/inbox/{messageid}")
31
-    public void deleteMessage(int messageID){
30
+    @RequestMapping(method = RequestMethod.DELETE, value = "/inbox/")
31
+    public void deleteMessage(Message messageID){
32 32
         inboxService.deleteMessage(messageID); }
33 33
 
34 34
 

+ 2
- 1
src/main/java/com/tyler/motivateme/service/TopicInfoPageService.java Datei anzeigen

@@ -27,7 +27,8 @@ public class TopicInfoPageService {
27 27
 
28 28
     }
29 29
 
30
-    public String getAdviceAndStrategies() { return adviceAndStrategies;
30
+    public String getAdviceAndStrategies() {
31
+        return adviceAndStrategies;
31 32
 
32 33
     }
33 34