package com.raillearn;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class TripController {

    @Autowired
    TripRepository tripRepository;

    @RequestMapping(value = "/trips", method = RequestMethod.GET)
    public List<Trip> getTrips() {
        return tripRepository.findAll();
    }

    @RequestMapping(value = "/trips", method = RequestMethod.POST)
    public Trip postTrip(@RequestBody Trip trip) {
        return tripRepository.save(trip);
    }

    @RequestMapping(value = "/trips/{id}/join", method = RequestMethod.POST)
    public Trip postTrip(@PathVariable long id) {
        return tripRepository.findOne(id);
    }
}

@@ -744,11 +744,170 @@
 );%0A    %7D
+%0A%0A    @RequestMapping(value = %22/user/login%22, method = RequestMethod.POST)%0A    public String logInUser(@RequestParam String token) %7B%0A        return token;%0A    %7D
 %0A%7D%0A

Add log in user receive.