-
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.
Browse files
Browse the repository at this point in the history
Feature/#3/subscribe
- Loading branch information
Showing
11 changed files
with
192 additions
and
6 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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/example/DayClassBack/controller/SubscribeController.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,11 @@ | ||
package com.example.DayClassBack.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/homebody/subscribe") | ||
public class SubscribeController { | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/example/DayClassBack/dto/request/PartyRequestDto.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,44 @@ | ||
package com.example.DayClassBack.dto.request; | ||
|
||
import com.example.DayClassBack.enums.Ott; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import javax.validation.constraints.NotEmpty; | ||
// import javax.validation.constraints.Pattern; | ||
import java.time.LocalDateTime; | ||
|
||
public class PartyRequestDto { | ||
|
||
@Getter | ||
@Setter | ||
public static class Write { | ||
|
||
@NotEmpty(message = "title은 필수 입력값입니다.") | ||
// @Pattern(regexp = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,6}$", message = "이메일 형식에 맞지 않습니다.") | ||
private String title; | ||
|
||
@NotEmpty(message = "content는 필수 입력값입니다.") | ||
// @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[~!@#$%^&*()+|=])[A-Za-z\\d~!@#$%^&*()+|=]{8,16}$", message = "비밀번호는 8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.") | ||
private String content; | ||
|
||
@NotEmpty(message = "필수 입력값입니다.") | ||
private int number_of_people; | ||
|
||
@NotEmpty(message = "필수 입력값입니다.") | ||
private LocalDateTime start_date; | ||
|
||
@NotEmpty(message = "필수 입력값입니다.") | ||
private LocalDateTime end_date; | ||
|
||
@NotEmpty(message = "필수 입력값입니다.") | ||
private int cost; | ||
|
||
@NotEmpty(message = "ott는 필수 입력값입니다.") | ||
private Ott ott; | ||
|
||
@NotEmpty(message = "o필수 입력값입니다.") | ||
private boolean is_completed; | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/example/DayClassBack/dto/response/PartyResponseDto.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.example.DayClassBack.dto.response; | ||
|
||
import com.example.DayClassBack.enums.Type; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
public class PartyResponseDto { | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
public static class PartyWriteInfo { | ||
private int id; | ||
private int user_id; | ||
|
||
private String title; | ||
private String content; | ||
|
||
private Type type; | ||
|
||
private String refreshToken; | ||
private Long refreshTokenExpirationTime; | ||
} | ||
|
||
} |
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,65 @@ | ||
package com.example.DayClassBack.entity; | ||
|
||
import com.example.DayClassBack.enums.Ott; | ||
import com.example.DayClassBack.enums.Type; | ||
import lombok.*; | ||
import org.springframework.data.annotation.CreatedDate; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Setter | ||
@Getter | ||
@Entity | ||
public class Party extends BaseTime { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne // Many = Party, Users = One 한명의 유저는 여러개의 게시글을 쓸 수 있다. | ||
@JoinColumn(name="user_id") // foreign key (userId) references User (id) | ||
private Users users; | ||
|
||
/* | ||
@Column | ||
@CreatedDate | ||
private LocalDateTime created_at; | ||
@Column | ||
private LocalDateTime updated_at; | ||
*/ | ||
|
||
@Column(nullable = false) | ||
@Enumerated(EnumType.STRING) // enum의 이름으로 지정 | ||
private Type type; | ||
|
||
@Column(nullable = false) | ||
private int number_of_people; | ||
|
||
@Column(nullable = false) | ||
private LocalDateTime start_date; | ||
|
||
@Column | ||
private LocalDateTime end_date; | ||
|
||
@Column(nullable = false) | ||
private int cost; | ||
|
||
@Column(nullable = false) | ||
@Enumerated(EnumType.STRING) // enum의 이름으로 지정 | ||
private Ott ott; | ||
|
||
@Column(nullable = false) | ||
private boolean is_completed; | ||
|
||
@Column(nullable = false) | ||
private String title; | ||
|
||
@Column(nullable = false) | ||
private String contents; | ||
|
||
} |
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,10 @@ | ||
package com.example.DayClassBack.enums; | ||
|
||
public enum Ott { | ||
Netflix, | ||
Watcha, | ||
Disney_Plus, | ||
Wavve, | ||
Apple_TV, | ||
TVING | ||
} |
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 com.example.DayClassBack.enums; | ||
|
||
public enum Type { | ||
Gather, // 모집 | ||
Rental // 대여 | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/example/DayClassBack/repository/PartyRepository.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,7 @@ | ||
package com.example.DayClassBack.repository; | ||
|
||
import com.example.DayClassBack.entity.Party; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface PartyRepository extends JpaRepository<Party, Long> { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/DayClassBack/service/PartyService.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,4 @@ | ||
package com.example.DayClassBack.service; | ||
|
||
public class PartyService { | ||
} |