package com.letionik.matinee.controller;

import com.letionik.matinee.UserDto;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Alexey Zyabkin on 12.12.2015.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping(method = RequestMethod.POST)
    public UserDto register(UserDto user) {
        return user;
    }
}

@@ -72,16 +72,76 @@
 serDto;%0A
+import org.springframework.web.bind.annotation.RequestBody;%0A
 import o
@@ -195,16 +195,16 @@
 apping;%0A
-
 import o
@@ -321,16 +321,56 @@
 oller;%0A%0A
+import javax.servlet.http.HttpSession;%0A%0A
 /**%0A * C
@@ -557,32 +557,119 @@
 Dto 
-register(UserDto user) %7B
+authorize(@RequestBody UserDto user, HttpSession session) %7B%0A        session.setAttribute(%22user%22, user.getId());
 %0A   

Save userId in session