Skip to content

Commit

Permalink
Add autowired to messageservice
Browse files Browse the repository at this point in the history
  • Loading branch information
milesha committed Nov 25, 2024
1 parent 8ad3fae commit f7809df
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
package de.tum.in.www1.hephaestus.chat.message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/messages")
public class MessageController {
private final MessageService messageService;

public MessageController(MessageService messageService) {
this.messageService = messageService;
}
@Autowired
private MessageService messageService;

@GetMapping("/{sessionId}")
public ResponseEntity<List<MessageDTO>> getMessages(@PathVariable Long sessionId) {
Expand Down

0 comments on commit f7809df

Please sign in to comment.