Skip to content

Commit

Permalink
Merge pull request #78 from mummhy0811/main
Browse files Browse the repository at this point in the history
[#76]Feat: 유저 정보 Read
  • Loading branch information
mummhy0811 authored Nov 14, 2023
2 parents e0c95c7 + e9ad387 commit 246b572
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}
8 changes: 2 additions & 6 deletions src/main/java/com/onestep/server/entity/Family.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/onestep/server/service/user/UserService.java
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit 246b572

Please sign in to comment.