blob: bf94991c32d4fa8f2b5796aa30ebce939f38dde4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package me.imsonmia.epqapi.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import me.imsonmia.epqapi.model.ChatMessage;
import me.imsonmia.epqapi.repository.ChatMessageRepository;
@RestController
@RequestMapping("/api/v1")
public class ChatMessageController {
private ChatMessageRepository chatMessageRepository;
@GetMapping("/msg/{id}")
public ChatMessage getMessageById(@PathVariable(value = "id") Long id) {
return chatMessageRepository.findById(id).get();
}
}
|