[FIX] 目標カラムの条件と読み取れない問題を修正しました。
This commit is contained in:
@@ -16,7 +16,6 @@ import com.example.demo.app.presentation.form.UserForm;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserServiceImpl implements UserService {
|
||||
@@ -36,19 +35,20 @@ public class UserServiceImpl implements UserService {
|
||||
userEntity.setSecretQuestionAnswer(userForm.getSecretAnswer());
|
||||
userEntity.setBirthDate(userForm.getBirthDate());
|
||||
userEntity.setSaving(userForm.getSaving());
|
||||
userEntity.setBirthDate(userForm. getBirthDate());
|
||||
userEntity.setBirthDate(userForm.getBirthDate());
|
||||
userEntity.setSaving(userForm.getSaving());
|
||||
userEntity.setAnnualIncome(userForm.getAnnualIncome());
|
||||
userEntity.setMonthlyBudget(userForm.getMonthlyBudget());
|
||||
|
||||
QuestionEntity questionEntity =
|
||||
questionRepository.findById(userForm.getSecretQuestionId()).orElse(null);
|
||||
QuestionEntity questionEntity = questionRepository.findById(userForm.getSecretQuestionId()).orElse(null);
|
||||
|
||||
GoalEntity goalEntity =
|
||||
goalRepository.findById(userForm.getGoalId()).orElse(null);
|
||||
GoalEntity goalEntity = new GoalEntity();
|
||||
goalEntity.setTargetAmount(Integer.parseInt(String.valueOf(userForm.getGoalId())));
|
||||
|
||||
CourseEntity courseEntity =
|
||||
courseRepository.findById(courseId).orElse(null);
|
||||
goalRepository.save(
|
||||
goalEntity);
|
||||
|
||||
CourseEntity courseEntity = courseRepository.findById(courseId).orElse(null);
|
||||
|
||||
userEntity.setQuestionEntity(questionEntity);
|
||||
userEntity.setGoalEntity(goalEntity);
|
||||
@@ -70,12 +70,8 @@ public class UserServiceImpl implements UserService {
|
||||
userRepository.save(userEntity);
|
||||
}
|
||||
|
||||
|
||||
public UserModel findByUserId(Long userId) {
|
||||
|
||||
return UserModel.convertFrom(userRepository.findById(userId).get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,14 +32,14 @@ public class GoalEntity {
|
||||
@Column(name = "goal_subtitle", nullable = true)
|
||||
private String goalSubtitle;
|
||||
|
||||
@Column(name = "target_amount", nullable = false)
|
||||
@Column(name = "target_amount", nullable = true)
|
||||
private Integer targetAmount;
|
||||
|
||||
@Column(name = "deadline", nullable = false)
|
||||
private LocalDate deadline;
|
||||
@Column(name = "deadline", nullable = true)
|
||||
private LocalDate deadline = LocalDate.now().plusYears(1L);
|
||||
|
||||
@Column(name = "goal_complete", nullable = true)
|
||||
private Integer goalComplete;
|
||||
@Column(name = "goal_complete", nullable = false)
|
||||
private Integer goalComplete = 0;
|
||||
|
||||
@OneToOne(mappedBy = "goalEntity")
|
||||
private UserEntity userEntity;
|
||||
|
||||
Reference in New Issue
Block a user