diff --git a/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java b/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java index 2e23f1f..526e695 100644 --- a/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java +++ b/src/main/java/com/example/demo/aop/handler/GlobalExceptionHandler.java @@ -11,6 +11,7 @@ import org.springframework.ui.Model; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.servlet.resource.NoResourceFoundException; import com.example.demo.exception.NoSessionException; @@ -53,16 +54,31 @@ public class GlobalExceptionHandler { return "error"; } - @ExceptionHandler(Exception.class) - public String AllException(Model model, Exception e, HttpSession session) { + @ExceptionHandler(NoResourceFoundException.class) + public void noResourceException(Model model, Exception e, HttpSession session) { model.addAttribute("error", SEVERE_ERROR_MESSAGE_BAD_REQUEST); - + e.printStackTrace(); LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e); +<<<<<<< HEAD System.out.println("session invalidated exception"); +======= + + System.out.println("session invalidated"); +>>>>>>> aad285f9bad1d407fb32f985aaef2a7c3a7f798d session.invalidate(); + + } + + @ExceptionHandler(Exception.class) + public String AllException(Model model, Exception e, HttpSession session) { + + e.printStackTrace(); + + + System.out.println(" .well-known/appspecific/com.chrome.devtools.json for request error"); return "error"; } diff --git a/src/main/java/com/example/demo/app/domain/model/GoalModel.java b/src/main/java/com/example/demo/app/domain/model/GoalModel.java index b5a7214..aeddc68 100644 --- a/src/main/java/com/example/demo/app/domain/model/GoalModel.java +++ b/src/main/java/com/example/demo/app/domain/model/GoalModel.java @@ -57,7 +57,7 @@ public class GoalModel { goalModel.getTargetAmount(), goalModel.getDeadline(), 0, - userEntity, 0); + userEntity); } public static GoalModel convertFrom(GoalForm goalForm) { diff --git a/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java b/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java index 20b862e..d0ee588 100644 --- a/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java +++ b/src/main/java/com/example/demo/app/domain/service/impl/UserServiceImpl.java @@ -53,13 +53,13 @@ public class UserServiceImpl implements UserService { userEntity.setQuestionEntity(questionEntity); - - userEntity.setCourseEntity(courseEntity); userEntity.setDeleteFlag(0); - userRepository.save(userEntity); + goalEntity.setUserEntity(userRepository.save(userEntity)); + + goalRepository.save(goalEntity); } @Override diff --git a/src/main/java/com/example/demo/app/infra/entity/CategoryEntity.java b/src/main/java/com/example/demo/app/infra/entity/CategoryEntity.java index 17d3ca7..c7568a9 100644 --- a/src/main/java/com/example/demo/app/infra/entity/CategoryEntity.java +++ b/src/main/java/com/example/demo/app/infra/entity/CategoryEntity.java @@ -29,7 +29,7 @@ public class CategoryEntity { @Column(name = "category_id") private Long categoryId; - @Column(name = "category_name", nullable = false) + @Column(name = "category_name", nullable = false, length = 50) private String categoryName; @Column(name = "transaction_type", nullable = false) diff --git a/src/main/java/com/example/demo/app/infra/entity/CourseEntity.java b/src/main/java/com/example/demo/app/infra/entity/CourseEntity.java index 56cb01e..e93b26b 100644 --- a/src/main/java/com/example/demo/app/infra/entity/CourseEntity.java +++ b/src/main/java/com/example/demo/app/infra/entity/CourseEntity.java @@ -27,7 +27,7 @@ public class CourseEntity { @Column(name = "course_id") private Long courseId; - @Column(name = "course_name", nullable = false) + @Column(name = "course_name", nullable = false, length = 50) private String courseName; diff --git a/src/main/java/com/example/demo/app/infra/entity/FixedCostEntity.java b/src/main/java/com/example/demo/app/infra/entity/FixedCostEntity.java index ef131b2..99dadd6 100644 --- a/src/main/java/com/example/demo/app/infra/entity/FixedCostEntity.java +++ b/src/main/java/com/example/demo/app/infra/entity/FixedCostEntity.java @@ -34,7 +34,7 @@ public class FixedCostEntity { @JoinColumn(name = "category_id") private CategoryEntity categoryEntity; - @Column(name = "fixed_cost_name", nullable = false) + @Column(name = "fixed_cost_name", nullable = false, length = 50) private String fixedCostName; @Column(name = "amount", nullable = false) diff --git a/src/main/java/com/example/demo/app/infra/entity/GoalEntity.java b/src/main/java/com/example/demo/app/infra/entity/GoalEntity.java index a7bc3f4..44f044e 100644 --- a/src/main/java/com/example/demo/app/infra/entity/GoalEntity.java +++ b/src/main/java/com/example/demo/app/infra/entity/GoalEntity.java @@ -29,10 +29,10 @@ public class GoalEntity { private Long goalId; @Column(name = "goal_title", nullable = true) - private String goalTitle; + private String goalTitle = "名前を設定してください"; @Column(name = "goal_subtitle", nullable = true) - private String goalSubtitle; + private String goalSubtitle = "説明を書いてください"; @Column(name = "target_amount", nullable = true) private Integer targetAmount; @@ -46,7 +46,5 @@ public class GoalEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private UserEntity userEntity; - - private Integer deleteFlag; } diff --git a/src/main/java/com/example/demo/app/infra/entity/UserEntity.java b/src/main/java/com/example/demo/app/infra/entity/UserEntity.java index f6d52fd..3d86259 100644 --- a/src/main/java/com/example/demo/app/infra/entity/UserEntity.java +++ b/src/main/java/com/example/demo/app/infra/entity/UserEntity.java @@ -30,7 +30,7 @@ public class UserEntity { @Column(name = "user_id") private Long userId; - @Column(name = "user_name", nullable = false) + @Column(name = "user_name", nullable = false, length = 100) private String userName; @Column(name = "mail_address", nullable = false) @@ -39,7 +39,7 @@ public class UserEntity { @Column(name = "password", nullable = false) private String password; - @Column(name = "secret_answer", nullable = false) + @Column(name = "secret_answer", nullable = false, length = 100) private String secretQuestionAnswer; @Column(name = "birth_date", nullable = false) diff --git a/src/main/resources/templates/select_course.html b/src/main/resources/templates/select_course.html index b3ed7fa..635e154 100644 --- a/src/main/resources/templates/select_course.html +++ b/src/main/resources/templates/select_course.html @@ -8,7 +8,7 @@ コース選択 - +

コース選択

diff --git a/src/main/resources/templates/user_register_return.html b/src/main/resources/templates/user_register_return.html index 93569ea..0d4079e 100644 --- a/src/main/resources/templates/user_register_return.html +++ b/src/main/resources/templates/user_register_return.html @@ -80,7 +80,7 @@
- +