회원등록 수정

This commit is contained in:
byung eun park 2019-08-29 12:20:42 +09:00
parent 45efc8ab8c
commit 4878ecae97
4 changed files with 28 additions and 5 deletions

View File

@ -60,7 +60,7 @@ public class AuthController {
public ResponseEntity<?> authenticateUser(@Valid @RequestBody SigninRequest signinRequest) { public ResponseEntity<?> authenticateUser(@Valid @RequestBody SigninRequest signinRequest) {
String ipAddr = this.getIp(); String ipAddr = this.getIp();
log.debug("ipAddr = " + ipAddr); log.info("ipAddr = " + ipAddr);
Authentication authentication = authenticationManager.authenticate( Authentication authentication = authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(signinRequest.getUsername(), signinRequest.getPassword())); new UsernamePasswordAuthenticationToken(signinRequest.getUsername(), signinRequest.getPassword()));
@ -86,7 +86,8 @@ public class AuthController {
// Creating user's account // Creating user's account
UserEntity user = UserEntity.builder().username(signupRequest.getUsername()).email(signupRequest.getEmail()) 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())); user.setPassword(passwordEncoder.encode(user.getPassword()));

View File

@ -1,19 +1,25 @@
package com.totopia.server.auth.payload; package com.totopia.server.auth.payload;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Email; import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
@Data @Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SignupRequest { public class SignupRequest {
@NotBlank @NotBlank
@Size(min = 4, max = 40) @Size(min = 4, max = 40)
private String name; private String username;
@NotBlank @NotBlank
@Size(min = 3, max = 15) @Size(min = 3, max = 15)
private String username; private String nickname;
@NotBlank @NotBlank
@Size(max = 40) @Size(max = 40)
@ -23,4 +29,12 @@ public class SignupRequest {
@NotBlank @NotBlank
@Size(min = 6, max = 20) @Size(min = 6, max = 20)
private String password; private String password;
@Size(min = 6, max = 200)
private String descriptions;
@NotBlank
@Size(min = 6, max = 20)
private String phone;
} }

View File

@ -92,6 +92,14 @@ public class UserEntity extends DateAuditEntity {
@Basic @Basic
@Column(name = "grade", nullable = true) @Column(name = "grade", nullable = true)
private Short grade; private Short grade;
@Basic
@Column(name = "phone", nullable = true)
private String phone;
@Basic
@Column(name = "descriptions", nullable = true, length = 1000)
private String descriptions;
} }
// 아이디 // 아이디

View File

@ -45,7 +45,7 @@ logging:
pattern: pattern:
console: "%d %-5level %logger : %msg%n" console: "%d %-5level %logger : %msg%n"
level: level:
root: DEBUG root: INFO
org.springframework: INFO org.springframework: INFO
org.hibernate: DEBUG org.hibernate: DEBUG