-
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.
Showing
22 changed files
with
822 additions
and
11 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
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
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,28 @@ | ||
package com.easylead.easylead.config; | ||
|
||
import com.amazonaws.auth.AWSStaticCredentialsProvider; | ||
import com.amazonaws.auth.BasicAWSCredentials; | ||
import com.amazonaws.services.s3.AmazonS3Client; | ||
import com.amazonaws.services.s3.AmazonS3ClientBuilder; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class S3Config { | ||
@Value("${cloud.aws.credentials.access-key}") | ||
private String accessKey; | ||
@Value("${cloud.aws.credentials.secret-key}") | ||
private String secretKey; | ||
@Value("${cloud.aws.region.static}") | ||
private String region; | ||
|
||
@Bean | ||
public AmazonS3Client amazonS3Client() { | ||
BasicAWSCredentials awsCredentials= new BasicAWSCredentials(accessKey, secretKey); | ||
return (AmazonS3Client) AmazonS3ClientBuilder.standard() | ||
.withRegion(region) | ||
.withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) | ||
.build(); | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
src/main/java/com/easylead/easylead/domain/books/entity/Book.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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/easylead/easylead/domain/content/entity/Content.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,26 @@ | ||
package com.easylead.easylead.domain.content.entity; | ||
|
||
import com.easylead.easylead.domain.books.entity.Book; | ||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import static jakarta.persistence.FetchType.LAZY; | ||
|
||
@NoArgsConstructor() | ||
@AllArgsConstructor | ||
@Entity | ||
@Getter | ||
public class Content { | ||
@EmbeddedId | ||
private ContentId contentId; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@MapsId("ISBN") | ||
@JoinColumn(name = "ISBN") | ||
private Book book; | ||
|
||
private String pageContent; | ||
private String pageImg; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/easylead/easylead/domain/content/entity/ContentId.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,19 @@ | ||
package com.easylead.easylead.domain.content.entity; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Embeddable | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class ContentId implements Serializable { | ||
private Long pageId; | ||
private String ISBN; | ||
} |
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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/easylead/easylead/domain/read/entity/Read.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,43 @@ | ||
package com.easylead.easylead.domain.read.entity; | ||
|
||
import com.easylead.easylead.domain.books.entity.Book; | ||
import com.easylead.easylead.domain.users.entity.Users; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.CreationTimestamp; | ||
import org.hibernate.annotations.UpdateTimestamp; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import static jakarta.persistence.FetchType.LAZY; | ||
import static lombok.AccessLevel.PROTECTED; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
@NoArgsConstructor(access = PROTECTED) | ||
@Getter | ||
@Entity | ||
public class Read { | ||
@EmbeddedId | ||
private ReadId readId; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@MapsId("userId") | ||
@JoinColumn(name = "read_user_id") | ||
private Users readUser; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@MapsId("ISBN") | ||
@JoinColumn(name = "ISBN") | ||
private Book book; | ||
|
||
private Long page; | ||
|
||
@CreationTimestamp | ||
@Column(nullable = false, updatable = false) | ||
private LocalDateTime createdAt; | ||
|
||
@UpdateTimestamp | ||
private LocalDateTime updateAt; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/easylead/easylead/domain/read/entity/ReadId.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,19 @@ | ||
package com.easylead.easylead.domain.read.entity; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Embeddable | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class ReadId implements Serializable { | ||
private Long userId; | ||
private String ISBN; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/easylead/easylead/domain/request/entity/Progress.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,16 @@ | ||
package com.easylead.easylead.domain.request.entity; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public enum Progress { | ||
P0("접수 완료"), | ||
P1("담당자 확인 중"), | ||
P2("글맞춤 중"), | ||
P3("검수 중"), | ||
P4("글맞춤 완료"); | ||
|
||
private final String description; | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/easylead/easylead/domain/request/entity/Request.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,46 @@ | ||
package com.easylead.easylead.domain.request.entity; | ||
|
||
import com.easylead.easylead.domain.books.entity.Book; | ||
import com.easylead.easylead.domain.users.entity.Users; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import lombok.experimental.SuperBuilder; | ||
import org.hibernate.annotations.CreationTimestamp; | ||
import org.hibernate.annotations.UpdateTimestamp; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import static jakarta.persistence.FetchType.LAZY; | ||
import static lombok.AccessLevel.PROTECTED; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
@NoArgsConstructor(access = PROTECTED) | ||
@Getter | ||
@Entity | ||
public class Request { | ||
@EmbeddedId | ||
private RequestId requestId; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@MapsId("userId") | ||
@JoinColumn(name = "user_id") | ||
private Users readUser; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@MapsId("ISBN") | ||
@JoinColumn(name = "ISBN") | ||
private Book book; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private Progress progress; | ||
|
||
@CreationTimestamp | ||
@Column(nullable = false, updatable = false) | ||
private LocalDateTime createdAt; | ||
|
||
@UpdateTimestamp | ||
private LocalDateTime updateAt; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/easylead/easylead/domain/request/entity/RequestId.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,19 @@ | ||
package com.easylead.easylead.domain.request.entity; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Embeddable | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class RequestId implements Serializable { | ||
private Long userId; | ||
private String ISBN; | ||
} |
Oops, something went wrong.