diff --git a/src/main/java/com/onestep/server/controller/user/UserController.java b/src/main/java/com/onestep/server/controller/user/UserController.java new file mode 100644 index 0000000..82f3c6a --- /dev/null +++ b/src/main/java/com/onestep/server/controller/user/UserController.java @@ -0,0 +1,20 @@ +package com.onestep.server.controller.user; + +import com.onestep.server.entity.User; +import com.onestep.server.service.user.UserService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +public class UserController { + + private final UserService userService; + + @GetMapping(value = "/user/{userId}") + public User getUserInfo(@PathVariable String userId){ + return userService.getUserInfo(userId); + } +} diff --git a/src/main/java/com/onestep/server/entity/Family.java b/src/main/java/com/onestep/server/entity/Family.java index 77662a5..5b27c1c 100644 --- a/src/main/java/com/onestep/server/entity/Family.java +++ b/src/main/java/com/onestep/server/entity/Family.java @@ -1,6 +1,5 @@ package com.onestep.server.entity; -import com.fasterxml.jackson.annotation.JsonIgnore; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Temporal; @@ -29,14 +28,11 @@ public class Family { @ColumnDefault("0") private int level; - @Column(nullable = false) - private Long question_id; - @ColumnDefault("true") private Boolean is_valid; - @ColumnDefault("0") - private Long point; + @Column(nullable = false) + private int fam_number; @Temporal(value = TemporalType.DATE) private Date fam_anniversary; diff --git a/src/main/java/com/onestep/server/service/user/UserService.java b/src/main/java/com/onestep/server/service/user/UserService.java new file mode 100644 index 0000000..7c6afe8 --- /dev/null +++ b/src/main/java/com/onestep/server/service/user/UserService.java @@ -0,0 +1,16 @@ +package com.onestep.server.service.user; + +import com.onestep.server.entity.User; +import com.onestep.server.repository.IUserRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class UserService { + private final IUserRepository iUserRepository; + + public User getUserInfo(String userInfo){ + return iUserRepository.findById(userInfo).get(); + } +}