-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUserController.java
More file actions
53 lines (44 loc) · 1.59 KB
/
UserController.java
File metadata and controls
53 lines (44 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.makefire.anonymous.rest.controller.api;
import com.makefire.anonymous.rest.RestSupport;
import com.makefire.anonymous.rest.dto.request.UserRequest;
import com.makefire.anonymous.rest.dto.response.Response;
import com.makefire.anonymous.rest.dto.response.UserResponse;
import com.makefire.anonymous.service.user.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
*packageName : com.makefire.anonymous
* fileName : UserController
* author : 최푸름
* date : 22-01-14
* description : 유저 E2E
* =================================
* DATE AUTHOR NOTE
* 22-02-16 김민철
* ---------------------------------
*/
@Controller
@RequiredArgsConstructor
@RequestMapping("/api/user")
public class UserController extends RestSupport{
private final UserService userService;
//사용자 등록
@PostMapping("/userSignUp")
public ResponseEntity<Response> insertUser(@Valid @RequestBody UserRequest userRequest){
return response(userService.save(userRequest));
//ResponseEntity.ok(userService.save(userRequest));
}
//사용자 조회
@GetMapping("/findUserId/{id}")
public ResponseEntity<Response> getUser(@PathVariable("id") long userId){
return response(userService.getUser(userId));
}
//사용자 목록
@GetMapping("/userList")
public ResponseEntity<Response> getUserList(){
return response(userService.getUserList());
}
}