From 4878ecae977611aff8984c10d0b9ba650ef21ae5 Mon Sep 17 00:00:00 2001 From: byung eun park Date: Thu, 29 Aug 2019 12:20:42 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9A=8C=EC=9B=90=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/auth/controller/AuthController.java | 5 +++-- .../server/auth/payload/SignupRequest.java | 18 ++++++++++++++++-- .../server/modules/user/entity/UserEntity.java | 8 ++++++++ src/main/resources/application.yml | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/totopia/server/auth/controller/AuthController.java b/src/main/java/com/totopia/server/auth/controller/AuthController.java index fc3f3f0..5859546 100644 --- a/src/main/java/com/totopia/server/auth/controller/AuthController.java +++ b/src/main/java/com/totopia/server/auth/controller/AuthController.java @@ -60,7 +60,7 @@ public class AuthController { public ResponseEntity authenticateUser(@Valid @RequestBody SigninRequest signinRequest) { String ipAddr = this.getIp(); - log.debug("ipAddr = " + ipAddr); + log.info("ipAddr = " + ipAddr); Authentication authentication = authenticationManager.authenticate( new UsernamePasswordAuthenticationToken(signinRequest.getUsername(), signinRequest.getPassword())); @@ -86,7 +86,8 @@ public class AuthController { // Creating user's account UserEntity user = UserEntity.builder().username(signupRequest.getUsername()).email(signupRequest.getEmail()) - .password(signupRequest.getPassword()).build(); + .nickname(signupRequest.getNickname()).phone(signupRequest.getPhone()).descriptions(signupRequest.getDescriptions()) + .password(signupRequest.getPassword()).block(false).resetCount(0L).sendEmail(true).build(); user.setPassword(passwordEncoder.encode(user.getPassword())); diff --git a/src/main/java/com/totopia/server/auth/payload/SignupRequest.java b/src/main/java/com/totopia/server/auth/payload/SignupRequest.java index a124512..eb9f704 100644 --- a/src/main/java/com/totopia/server/auth/payload/SignupRequest.java +++ b/src/main/java/com/totopia/server/auth/payload/SignupRequest.java @@ -1,19 +1,25 @@ package com.totopia.server.auth.payload; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; @Data +@AllArgsConstructor +@NoArgsConstructor +@Builder public class SignupRequest { @NotBlank @Size(min = 4, max = 40) - private String name; + private String username; @NotBlank @Size(min = 3, max = 15) - private String username; + private String nickname; @NotBlank @Size(max = 40) @@ -23,4 +29,12 @@ public class SignupRequest { @NotBlank @Size(min = 6, max = 20) private String password; + + @Size(min = 6, max = 200) + private String descriptions; + + @NotBlank + @Size(min = 6, max = 20) + private String phone; + } diff --git a/src/main/java/com/totopia/server/modules/user/entity/UserEntity.java b/src/main/java/com/totopia/server/modules/user/entity/UserEntity.java index 6d4a623..8427c37 100644 --- a/src/main/java/com/totopia/server/modules/user/entity/UserEntity.java +++ b/src/main/java/com/totopia/server/modules/user/entity/UserEntity.java @@ -92,6 +92,14 @@ public class UserEntity extends DateAuditEntity { @Basic @Column(name = "grade", nullable = true) private Short grade; + + @Basic + @Column(name = "phone", nullable = true) + private String phone; + + @Basic + @Column(name = "descriptions", nullable = true, length = 1000) + private String descriptions; } // 아이디 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e9404e9..f4e4f52 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -45,7 +45,7 @@ logging: pattern: console: "%d %-5level %logger : %msg%n" level: - root: DEBUG + root: INFO org.springframework: INFO org.hibernate: DEBUG