1 package de.spring.webservices.rest.controller;
 
   3 import java.time.LocalDateTime;
 
   5 import org.springframework.beans.factory.annotation.Autowired;
 
   6 import org.springframework.web.bind.annotation.RequestBody;
 
   7 import org.springframework.web.bind.annotation.RequestMapping;
 
   8 import org.springframework.web.bind.annotation.RequestMethod;
 
  10 import de.spring.stomp.services.UserTradeService;
 
  12 public class UserTradeController {
 
  13         private final UserTradeService userTradeService;
 
  16     public UserTradeController(UserTradeService userTradeService) {
 
  17         this.userTradeService = userTradeService;
 
  20     // Sending data to /topic/greeting from REST service.
 
  21         // POST http://localhost:8080/spring-stomp-server/trade
 
  23         @RequestMapping(path="/trade", method=RequestMethod.POST)
 
  24     public void handle(@RequestBody String user) {
 
  25                 userTradeService.doTrade(user);