-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Feat] restdocs 관련 gradle 설정 추가 * [Feat] restdocs util 추가 * [Fix] restdocs 관련 gradle task 수정 * [Fix] openapi3 server 실행 프로필 따라 바뀌도록 설정 * [Feat] 유저 엔티티 작성 * [Fix] ActivityPart -> Activity, api 문서 주소 변경
- Loading branch information
1 parent
37f401f
commit 244afd2
Showing
16 changed files
with
243 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
spring: | ||
profiles: | ||
include: domain | ||
|
||
server: | ||
tomcat: | ||
basedir: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ccc.common; | ||
|
||
import ccc.common.enums.LinkType; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Embeddable; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
|
||
@Embeddable | ||
public class Link { | ||
|
||
@Column(name = "url") | ||
private String url; | ||
|
||
@Column(name = "type") | ||
@Enumerated(EnumType.STRING) | ||
private LinkType type; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package ccc.common; | ||
|
||
|
||
public class Photo { | ||
} |
13 changes: 13 additions & 0 deletions
13
bridge-domain/src/main/java/ccc/common/enums/Activity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ccc.common.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public enum Activity { | ||
|
||
KPOP(MainActivity.음악), | ||
축구(MainActivity.운동); | ||
|
||
MainActivity mainActivity; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package ccc.common.enums; | ||
|
||
public enum LinkType { | ||
YOUTUBE, | ||
INSTAGRAM, | ||
} |
6 changes: 6 additions & 0 deletions
6
bridge-domain/src/main/java/ccc/common/enums/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package ccc.common.enums; | ||
|
||
public enum MainActivity { | ||
음악, | ||
운동 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ccc.user; | ||
|
||
import javax.persistence.*; | ||
|
||
import static javax.persistence.FetchType.LAZY; | ||
|
||
@Entity | ||
public class Buddy { | ||
@Id | ||
private Long id; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn(name = "follower_id") | ||
private Profile follower; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn(name = "followee_id") | ||
private Profile followee; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package ccc.user; | ||
|
||
import ccc.common.enums.Activity; | ||
import ccc.user.enums.Privacy; | ||
|
||
import javax.persistence.*; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import static javax.persistence.FetchType.LAZY; | ||
|
||
@Entity | ||
@Table(name = "profile") | ||
public class Profile { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "profile_id") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
@Column(name = "nickname", unique = true, nullable = false) | ||
private String nickname; // 닉네임 | ||
|
||
@Column(name = "link", unique = true, nullable = false) | ||
private String link; // 프로필 링크 | ||
|
||
@Column(name = "privacy") | ||
@Enumerated(EnumType.STRING) | ||
private Privacy privacy; | ||
|
||
@OneToOne | ||
@JoinColumn(name = "profile_photo_id") | ||
private ProfilePhoto profilePhoto; | ||
|
||
@ElementCollection | ||
@Enumerated(EnumType.STRING) | ||
private List<Activity> keywords = new ArrayList<>(); // 나를 나타내는 키워드 목록 | ||
|
||
@OneToMany(mappedBy = "follower", fetch = LAZY) | ||
private List<Buddy> followers = new ArrayList<>(); // 내가 팔로우하는 사람들 | ||
|
||
@OneToMany(mappedBy = "followee", fetch = LAZY) | ||
private List<Buddy> followees = new ArrayList<>(); // 나를 팔로우하는 사람들 | ||
|
||
@OneToMany(mappedBy = "profile", fetch = LAZY) | ||
private List<ProfileLink> socialLinks = new ArrayList<>(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package ccc.user; | ||
|
||
import ccc.common.Link; | ||
import javax.persistence.*; | ||
|
||
import static javax.persistence.FetchType.LAZY; | ||
|
||
@Entity | ||
@Table(name = "profile_link") | ||
public class ProfileLink { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "link_id") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn(name = "profile_id") | ||
private Profile profile; | ||
|
||
@Embedded | ||
private Link link; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ccc.user; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Table(name = "profile_photo") | ||
public class ProfilePhoto { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "profile_photo_id") | ||
private Long id; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package ccc.user; | ||
|
||
import ccc.user.enums.UserStatus; | ||
|
||
import javax.persistence.*; | ||
import java.util.List; | ||
|
||
import static javax.persistence.FetchType.LAZY; | ||
|
||
@Entity | ||
@Table(name = "user") | ||
public class User { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "user_id") | ||
private Long id; | ||
|
||
@Column(name = "email", unique = true) | ||
private String email; // 아이디 | ||
|
||
@Column(name = "password") | ||
private String password; // 비밀번호 | ||
|
||
@Column(name = "phone_number", unique = true) | ||
private String phoneNumber; // 휴대전화 번호 | ||
|
||
//FIXME | ||
// @Column(name = "role") | ||
// @ElementCollection | ||
// @Enumerated(EnumType.STRING) | ||
// private List<UserRole> role; // ~~~/profile/{닉네임} | ||
|
||
@OneToMany(mappedBy = "user", fetch = LAZY) | ||
private List<Profile> profiles; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "status") | ||
private UserStatus status; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package ccc.user.enums; | ||
|
||
public enum Privacy { | ||
PUBLIC, | ||
PRIVATE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package ccc.user.enums; | ||
|
||
public enum UserStatus { | ||
ACTIVE, | ||
INACTIVE, | ||
BLOCKED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
spring: | ||
config: | ||
activate: | ||
on-profile: local | ||
|
||
datasource: | ||
url: jdbc:mysql://localhost:3306/cap2_db | ||
username: cs | ||
password: cs | ||
|
||
jpa: | ||
hibernate: | ||
ddl-auto: none | ||
show-sql: true | ||
open-in-view: false | ||
properties: | ||
hibernate.default_batch_fetch_size: 1000 | ||
|
||
|
||
--- | ||
|
||
spring: | ||
config: | ||
activate: | ||
on-profile: dev |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters