William Simkins před 6 roky
rodič
revize
da69e16568

+ 4
- 3
src/main/java/com/tyler/motivateme/controller/ForumController.java Zobrazit soubor

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

+ 10
- 10
src/main/java/com/tyler/motivateme/controller/InboxController.java Zobrazit soubor

1
 package com.tyler.motivateme.controller;
1
 package com.tyler.motivateme.controller;
2
 
2
 
3
-import com.tyler.motivateme.model.Topic;
3
+import com.tyler.motivateme.model.Message;
4
 import com.tyler.motivateme.service.InboxService;
4
 import com.tyler.motivateme.service.InboxService;
5
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.web.bind.annotation.CrossOrigin;
6
 import org.springframework.web.bind.annotation.CrossOrigin;
14
     @Autowired
14
     @Autowired
15
     InboxService inboxService;
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
         inboxService.sendMessage(userID); }
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
         inboxService.updateMessage(messageID); }
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
         inboxService.deleteMessage(messageID); }
32
         inboxService.deleteMessage(messageID); }
33
 
33
 
34
 
34
 

+ 2
- 1
src/main/java/com/tyler/motivateme/service/TopicInfoPageService.java Zobrazit soubor

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