반응형
01. 프로필 사진
Signup.html
<input type="file" name="photo" multiple="사진"/><br>
02. gender & location Dropbox 생성
Signup.html
성별
<select type="text" name="gender" placeholder="성별">
<option>-- 선택 --</option>
<option>남성</option>
<option>여성</option>
</select> <br>
<input type="text" name="age" placeholder="나이"><br>
주소
<select type="text" name="location" placeholder="주소">
<option>-- 선택 --</option>
<option>종로구</option>
<option>중구</option>
<option>용산구</option>
<option>성동구</option>
<option>광진구</option>
<option>동대문구</option>
<option>중랑구</option>
<option>성북구</option>
<option>강북구</option>
<option>도봉구</option>
<option>노원구</option>
<option>은평구</option>
<option>서대문구</option>
<option>마포구</option>
<option>양천구</option>
<option>강서구</option>
<option>구로구</option>
<option>금천구</option>
<option>영등포구</option>
<option>동작구</option>
<option>관악구</option>
<option>서초구</option>
<option>강남구</option>
<option>송파구</option>
<option>강동구</option>
</select> <br>
03. 가입 날짜(join_date) & authority
MemberEntity.java
package com.mygg.mygg.domain.entity;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.time.LocalDateTime;
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "member")
public class MemberEntity {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
@Column(length = 20, nullable = false)
private String email;
@Column(length = 100, nullable = false)
private String password;
@Column(length = 100, nullable = false)
private String name;
@Column(length = 100, nullable = false)
private String nickname;
@Column(length = 100, nullable = false)
private String phone_number;
@Column(length = 100, nullable = false)
private String gender;
@Column(length = 100, nullable = false)
private int age;
@Column(length = 100, nullable = false)
private String location;
@Column(length = 100, nullable = true)
private String photo;
@Column(length = 100, nullable = false)
private int authority = 1;
@Column(length = 100, nullable = true)
private LocalDateTime join_date;
@Column(length = 100, nullable = true)
private String role;
@Builder
public MemberEntity(Long id, String email, String password, String name, String nickname, String phone_number, String gender, int age, String location, String photo, String authority, String join_date, String role) {
this.id = id;
this.email = email;
this.password = password;
this.name = name;
this.nickname = nickname;
this.phone_number = phone_number;
this.gender = gender;
this.age = age;
this.location = location;
this.photo = photo;
this.authority = 1;
this.role =role;
}
@PrePersist
public void Join_date() {
this.join_date = LocalDateTime.now();
}
}
- authority : "1 - 일반회원, 2 - 관리자, 3 - 블랙리스트" 로 관리 예정
- @PrePersist : DB에 넣을 때 날짜가 만들어집니다.
전체 소스코드는 GitHub 참고
반응형
'CodeSiri > Project' 카테고리의 다른 글
[Googoos🕊] 04. Spring | 회원가입 중복체크 | ajax, MyBatis (0) | 2021.06.11 |
---|---|
[Googoos🕊] 03. Spring | login Session & Join (0) | 2021.05.26 |
[Googoos🕊] 01. Spring | Spring Security 회원가입/로그인/로그아웃 (0) | 2021.05.14 |
[Mini Project 🚴🏻♀️] 12. 게시글 수정 및 삭제 기능 구현 & 회고 (0) | 2021.02.22 |
[Mini Project 🚴🏻♀️] 11. 게시글 보기 기능 구현 (0) | 2021.02.22 |