Skip to content

Commit

Permalink
#19 [Create] 업장 등록
Browse files Browse the repository at this point in the history
entity 및 dto 생성
  • Loading branch information
Anna-Jin committed Jul 11, 2022
1 parent 98c5c34 commit 16348b3
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.mpnp.baechelin.store.domain;

import com.mpnp.baechelin.util.TimeStamped;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.*;

@Entity
@Getter
Expand All @@ -18,6 +16,38 @@ public class UserRegisterStore extends TimeStamped {
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;


@Column(nullable = false, length = 1)
private String name;

@Column(nullable = false, length = 1)
private String address;

@Column(nullable = false, length = 1)
private String elevator;

@Column(nullable = false, length = 1)
private String toilet;

@Column(nullable = false, length = 1)
private String heightDifferent;

@Column(nullable = false, length = 1)
private String approach;

@Builder
public UserRegisterStore(
String name,
String address,
String elevator,
String toilet,
String heightDifferent,
String approach
) {
this.name = name;
this.address = address;
this.elevator = elevator;
this.toilet = toilet;
this.heightDifferent = heightDifferent;
this.approach = approach;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.mpnp.baechelin.store.dto.userRegisterStore;

public class userRegisterStoreRequestDto {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.mpnp.baechelin.store.dto.userRegisterStore;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class userRegisterStoreResponseDto {
private String name;
private String address;
private String elevator;
private String toilet;
private String heightDifferent;
private String approach;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StoreRepository extends JpaRepository<Store, Integer> {
}
8 changes: 8 additions & 0 deletions src/main/java/com/mpnp/baechelin/user/entity/user/User.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mpnp.baechelin.user.entity.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mpnp.baechelin.bookmark.domain.Folder;
import com.mpnp.baechelin.oauth.entity.ProviderType;
import com.mpnp.baechelin.oauth.entity.RoleType;
import com.mpnp.baechelin.review.domain.Review;
Expand Down Expand Up @@ -53,6 +54,13 @@ public class User extends TimeStamped {
@Enumerated(EnumType.STRING)
private RoleType roleType;

// 연관관계 매핑
@OneToMany(mappedBy = "userId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Folder> folderList;

@OneToMany(mappedBy = "userId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Review> reviewsList;

@Builder
public User(String socialId,
String name,
Expand Down

0 comments on commit 16348b3

Please sign in to comment.