회원등록 수정

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) {
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()));

View File

@ -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;
}

View File

@ -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;
}
// 아이디

View File

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