Skip to content

Commit

Permalink
Feat : 유저 회원가입 API 수정
Browse files Browse the repository at this point in the history
유저 회원가입 관련 API 수정

Related to: #5
  • Loading branch information
crayon committed Mar 15, 2022
2 parents ddf2c96 + af4baee commit fefa07c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/main/java/com/moodstation/springboot/entity/PostImg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.moodstation.springboot.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;

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

@Entity
@Getter
@NoArgsConstructor
public class PostImg {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String imgName;

private String filePath;

private String fileFullPath;
}
3 changes: 3 additions & 0 deletions src/main/java/com/moodstation/springboot/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public class User {
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDateTime updatedAt;

@Column(nullable = false)
private String accessToken;

@Builder
public User(String email, String nickname, String password) {
this.email = email;
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/moodstation/springboot/entity/UserPost.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.moodstation.springboot.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Getter
@NoArgsConstructor
public class UserPost {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
private User user;

private LocalDateTime regDate;

private String color;

@OneToOne(cascade = CascadeType.ALL)
private PostImg postImg;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.moodstation.springboot.repository;

import com.moodstation.springboot.entity.PostImg;
import org.springframework.data.jpa.repository.JpaRepository;

public interface PostImgRepository extends JpaRepository<PostImg,Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.moodstation.springboot.repository;

import com.moodstation.springboot.entity.UserPost;
import org.springframework.data.jpa.repository.JpaRepository;

public interface UserPostRepository extends JpaRepository<UserPost,Long> {
}

0 comments on commit fefa07c

Please sign in to comment.