|
@@ -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
|
|