Skip to content

Commit 1f8ab95

Browse files
authored
Feat: 과릿 1.3.1 (#393)
* Feat: 과릿 1.3.1 (#392) * Feat: 클래스별 게시판 개발 (#352) * Feat: Question Entity #351 * Feat: File Entity #351 * Feat: Reply Entity #351 * Feat: 질문 상태 ENUM 추가 #351 * Feat: Question 도메인 Exception 분리 #351 * Feat: Question 도메인 기본 파일 생성 #351 * Fix: 도메인 이름 변경에 따른 파일 삭제 #351 * Feat: 게시판 Entity 개발 #351 * Feat: 게시판 종류 Enum 추가 #351 * Feat: 게시판 관련 Controller, Service, Repository 생성 #351 * Feat: 질문 상태 관련 Enum 추가 #351 * Fix: 미사용 파일 삭제 & Board 관련 Exception 분리 #351 * Feat: 게시판 관련 Dto 생성 #351 * Refactor: S3 업로드 코드 리팩토링 #351 * Feat: 게시글 등록 API #351 * Feat: 게시글 수정, 삭제 / 댓글 등록, 삭제 API 개발 진행 #351 * Feat: 게시글 페이지네이션 / 댓글 페이지네이션 API 개발 진행 #351 * Feat: 미해결 질문 리스트 반환, 파일 용량 조회, 질문 상태 수정 API #351 * Fix: 게시글 등록 API 수정 #351 * Fix: 게시글 등록/삭제 API 수정 #351 * Fix: 댓글 등록/삭제, 파일 용량 확인 API 수정 #351 * Fix: 미해결 질문 리스트 반환 API 수정 #351 * Fix: 삭제된 데이터 조회 안 되도록 쿼리 수정 #351 * Feat: 게시글 카테고리 구분 없이 반환하는 부분 추가 (#361) * Style: 메소드 주석 추가 #353 * Test: 게시글 테스트 코드 작성 진행 #353 * Chore: 과릿 1.1.10 (#357) * Chore: 배포 설정 변경 (#356) * Chore: 과릿 1.1.10 (#359) * Chore: 배포 설정 변경 #355 * Chore: Workflow 수정 #355 * Fix: 클래스별로 조회되도록 쿼리 수정 #353 * Feat: 게시글 작성에 따른 알림 전송 개발 (#363) * Feat: 게시글 푸시 알림 추가 진행 #354 * Chore: Local용 yml 변경 #354 * Fix: Notification에 boardId 칼럼 추가 #354 * Feat: 게시글/댓글 작성 시 알림 발송 로직 추가 #354 * Chore: DEV yml 오류 수정 * Feat: 게시글 API 추가 및 로직 수정 (#364) * Fix: 댓글 페이지네이션 오래된 순으로 수정 #362 * Fix: 특정 게시글 반환 시, 상위 댓글 반환하는 로직 제거 #362 * Fix: 특정 게시글 반환 시, 상위 댓글 반환하는 로직 제거 #362 * Fix: 게시글 하나 반환 시, 댓글의 파일 리스트는 반환되지 않도록 쿼리 수정 #362 * Fix: 미해결 상태의 질문 게시글만 반환되도록 쿼리 수정 #362 * Fix: lessonDate 반환하도록 DTO 및 로직 수정 #362 * Fix: 게시글 작성 시, 선생님과 학생 알림 로직 분리 (#366) * Fix: 선생님과 학생의 알림 로직 분리 #365 * Fix: 삭제 파일 검증 빈 리스트 구조이므로 검사 조건문 변경 #365 * Fix: 파일 개수 5개 제한 검증 로직 추가 (#370) * Feat: 수업 리포트에서 관련 게시글 리스트 반환 API (#371) * Fix: 반환 시 사용하는 DTO 변경 (#374) * Refactor: API EndPoint 리팩토링 (#375) * Fix: 파일용량 검사 조건 추가 (#376) * Fix: 게시글 오류 수정 (#378) * Fix: 댓글 페이지네이션 쿼리 오류 수정 #377 * Fix: 게시글 수정 시, 반환하는 파일 리스트가 전체가 되도록 수정 #377 * Fix: 게시글 페이지네이션 쿼리 선생님과 학생용 분리해서 적용 #377 * Fix: 작성자에겐 알림이 가지 않도록 수정 (#380) * Chore: DEV용 워크 플로우 도커 허브로 배포하도록 수정 (#383) * Chore: AWS S3 버킷 옮기기 (#385) * Fix: 댓글 페이지네이션 쿼리 오류 수정 (#386) * Chore: DEV 환경변수는 로컬이 되도록 변경 #381 * Fix: 댓글 페이지네이션 쿼리 수정 #381 * Chore: 댓글 페이지네이션 쿼리 수정 #381 * Chore: DEV 워크플로우 수정 (#388) * Chore: DEV yml 수정 #387 * Chore: DEV 배포 워크플로우 수정 #387 * Chore: DEV 배포 워크플로우 수정 (#389) * Chore: DEV yml 수정 #387 * Chore: DEV 배포 워크플로우 수정 #387 * Chore: DEV 배포 워크플로우 수정 #387 * Fix: 수업 리포트에 연관된 게시물 조회 오류 수정 (#391) * Fix: 수업 리포트에서 연관 게시물 가져오는 쿼리 오류 수정 #390 * Fix: 테스트 계정 관련 오류 수정 #390
1 parent 2459c97 commit 1f8ab95

File tree

61 files changed

+2054
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2054
-256
lines changed

.github/workflows/dev-CD.yml

Lines changed: 107 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Beanstalk Deploy
1+
name: DEV Dockerhub Push
22

33
on:
44
push:
@@ -35,59 +35,122 @@ jobs:
3535
- name: Grant execute permission for gradlew
3636
run: chmod +x gradlew
3737

38-
# yml 반영
38+
# secret.yml 반영
3939
- name: Make application-secret.yml
4040
run: |
4141
cd ./src/main/resources
4242
touch ./application-secret.yml
4343
echo "${{ secrets.APPLICATION_SECRET}}" > ./application-secret.yml
4444
shell: bash
4545

46-
# - name: Make firebase json
47-
# run: |
48-
# mkdir -p ./src/main/resources/firebase
49-
# echo "${{ secrets.FIREBASE_DEV_ADMIN}}" > ./src/main/resources/firebase/firebase-dev-admin.json
50-
# shell: bash
51-
52-
# # makeFiles.config 반영
53-
# - name: Make 00-makeFiles.config
54-
# run: |
55-
# cd ./.ebextensions
56-
# touch ./00-makeFiles.config
57-
# echo "${{ secrets.DEV_MAKEFILES}}" > ./00-makeFiles.config
58-
# shell: bash
46+
# dev.yml 반영
47+
- name: Make application-dev.yml
48+
run: |
49+
cd ./src/main/resources
50+
echo "${{ secrets.APPLICATION_DEV}}" > ./application-dev.yml
51+
shell: bash
5952

6053
# Gradle BootJar
6154
- name: BootJar with Gradle
62-
run: ./gradlew clean bootJar
55+
run: ./gradlew clean bootJar -Dspring.profiles.active=dev
6356

64-
# 현재 시간 반영
65-
- name: Get current time
66-
uses: 1466587594/get-current-time@v2
67-
id: current-time
68-
with:
69-
format: YYYY-MM-DDTHH-mm-ss
70-
utcOffset: "+09:00"
71-
72-
# grandle build를 통해 만들어진 jar를 beanstalk에 배포하기 위한 zip 파일로 만드는 것
73-
- name: Generate deployment package
57+
# Docker Image Push
58+
- name: Docker Image push
7459
run: |
75-
mkdir -p deploy
76-
cp build/libs/*.jar deploy/application.jar
77-
cp Procfile deploy/Procfile
78-
cp -r .ebextensions deploy/.ebextensions
79-
cp -r .platform deploy/.platform
80-
cd deploy && zip -r deploy.zip .
60+
docker login -u ${{ secrets.DEV_DOCKERHUB_USERNAME }} -p ${{ secrets.DEV_DOCKERHUB_PASSWORD }}
61+
docker build -t ${{ secrets.DEV_DOCKERHUB_USERNAME}}/${{ secrets.DEV_DOCKERHUB_REPOSITORY}} ./
62+
docker push ${{ secrets.DEV_DOCKERHUB_USERNAME }}/${{ secrets.DEV_DOCKERHUB_REPOSITORY}}
8163
82-
# Beanstalk Deploy 플러그인 사용
83-
- name: Beanstalk Deploy
84-
uses: einaregilsson/beanstalk-deploy@v14
85-
with:
86-
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} # github secrets로 등록한 값 사용
87-
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # github secrets로 등록한 값 사용
88-
application_name: Gwalit-dev # EB application 이름
89-
environment_name: Gwalit-dev-env # EB environment 이름
90-
version_label: Github Action-${{steps.current-time.outputs.formattedTime}} # 배포 버전은 타임스탬프를 이용하여 구분
91-
region: ap-northeast-2
92-
deployment_package: deploy/deploy.zip
93-
wait_for_environment_recovery: 100 # default wait time은 30초이며, 필자의 EB가 느려서 180초로 지정했습니다(지정 안하면 간혹 timeout 발생).
64+
#name: Beanstalk Deploy
65+
#
66+
#on:
67+
# push:
68+
# branches:
69+
# - dev
70+
#
71+
#jobs:
72+
# build:
73+
# # ubuntu 버전 지정
74+
# runs-on: ubuntu-22.04
75+
# steps:
76+
# # Checkout 진행
77+
# - uses: actions/checkout@v3
78+
#
79+
# # JDK 11 설치
80+
# - name: Set up JDK 11
81+
# uses: actions/setup-java@v3
82+
# with:
83+
# java-version: '11'
84+
# distribution: 'temurin'
85+
#
86+
# # Gradle 캐싱
87+
# - name: Gradle Caching
88+
# uses: actions/cache@v3
89+
# with:
90+
# path: |
91+
# ~/.gradle/caches
92+
# ~/.gradle/wrapper
93+
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
94+
# restore-keys: |
95+
# ${{ runner.os }}-gradle-
96+
#
97+
# # Gradle 권한 부여
98+
# - name: Grant execute permission for gradlew
99+
# run: chmod +x gradlew
100+
#
101+
# # yml 반영
102+
# - name: Make application-secret.yml
103+
# run: |
104+
# cd ./src/main/resources
105+
# touch ./application-secret.yml
106+
# echo "${{ secrets.APPLICATION_SECRET}}" > ./application-secret.yml
107+
# shell: bash
108+
#
109+
## - name: Make firebase json
110+
## run: |
111+
## mkdir -p ./src/main/resources/firebase
112+
## echo "${{ secrets.FIREBASE_DEV_ADMIN}}" > ./src/main/resources/firebase/firebase-dev-admin.json
113+
## shell: bash
114+
#
115+
## # makeFiles.config 반영
116+
## - name: Make 00-makeFiles.config
117+
## run: |
118+
## cd ./.ebextensions
119+
## touch ./00-makeFiles.config
120+
## echo "${{ secrets.DEV_MAKEFILES}}" > ./00-makeFiles.config
121+
## shell: bash
122+
#
123+
# # Gradle BootJar
124+
# - name: BootJar with Gradle
125+
# run: ./gradlew clean bootJar
126+
#
127+
# # 현재 시간 반영
128+
# - name: Get current time
129+
# uses: 1466587594/get-current-time@v2
130+
# id: current-time
131+
# with:
132+
# format: YYYY-MM-DDTHH-mm-ss
133+
# utcOffset: "+09:00"
134+
#
135+
# # grandle build를 통해 만들어진 jar를 beanstalk에 배포하기 위한 zip 파일로 만드는 것
136+
# - name: Generate deployment package
137+
# run: |
138+
# mkdir -p deploy
139+
# cp build/libs/*.jar deploy/application.jar
140+
# cp Procfile deploy/Procfile
141+
# cp -r .ebextensions deploy/.ebextensions
142+
# cp -r .platform deploy/.platform
143+
# cd deploy && zip -r deploy.zip .
144+
#
145+
# # Beanstalk Deploy 플러그인 사용
146+
# - name: Beanstalk Deploy
147+
# uses: einaregilsson/beanstalk-deploy@v14
148+
# with:
149+
# aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} # github secrets로 등록한 값 사용
150+
# aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # github secrets로 등록한 값 사용
151+
# application_name: Gwalit-dev # EB application 이름
152+
# environment_name: Gwalit-dev-env # EB environment 이름
153+
# version_label: Github Action-${{steps.current-time.outputs.formattedTime}} # 배포 버전은 타임스탬프를 이용하여 구분
154+
# region: ap-northeast-2
155+
# deployment_package: deploy/deploy.zip
156+
# wait_for_environment_recovery: 100 # default wait time은 30초이며, 필자의 EB가 느려서 180초로 지정했습니다(지정 안하면 간혹 timeout 발생).

src/main/java/com/selfrunner/gwalit/domain/banner/controller/BannerController.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@
1515

1616
@RestController
1717
@RequiredArgsConstructor
18-
@RequestMapping("")
18+
@RequestMapping("/api/v1/banner")
1919
@Tag(name = "Banner", description = "메인 페이지 배너 관련")
2020
public class BannerController {
2121

2222
private final BannerService bannerService;
2323

24-
@PostMapping({"/banner", "/api/v{version}/banner"})
25-
public ApplicationResponse<BannerRes> register(@PathVariable(name = "version", required = false) Long version, @Valid @RequestPart(value = "data") BannerReq bannerReq, @RequestPart(value = "file") MultipartFile multipartFile) {
24+
@PostMapping("")
25+
public ApplicationResponse<BannerRes> register(@Valid @RequestPart(value = "data") BannerReq bannerReq, @RequestPart(value = "file") MultipartFile multipartFile) {
2626
return ApplicationResponse.create(ErrorCode.SUCCESS, bannerService.register(bannerReq, multipartFile));
2727
}
2828

29-
@PutMapping({"/banner/{banner_id}", "/api/v{version}/banner/{banner_id}"})
30-
public ApplicationResponse<BannerRes> update(@PathVariable(name = "version", required = false) Long version, @PathVariable("banner_id") Long bannerId, @Valid @RequestPart(value = "data") BannerReq bannerReq, @RequestPart(value = "file", required = false) MultipartFile multipartFile) {
29+
@PutMapping("/{banner_id}")
30+
public ApplicationResponse<BannerRes> update(@PathVariable("banner_id") Long bannerId, @Valid @RequestPart(value = "data") BannerReq bannerReq, @RequestPart(value = "file", required = false) MultipartFile multipartFile) {
3131
return ApplicationResponse.ok(ErrorCode.SUCCESS, bannerService.update(bannerId, bannerReq, multipartFile));
3232
}
3333

34-
@GetMapping({"/banner", "/api/v{version}/banner"})
35-
public ApplicationResponse<List<BannerRes>> getAll(@PathVariable(name = "version", required = false) Long version) {
34+
@GetMapping("")
35+
public ApplicationResponse<List<BannerRes>> getAll() {
3636
return ApplicationResponse.ok(ErrorCode.SUCCESS, bannerService.getAll());
3737
}
3838

39-
@GetMapping({"/banner/content", "/api/v{version}/banner/content"})
40-
public ApplicationResponse<List<BannerRes>> getContent(@PathVariable(name = "version", required = false) Long version) {
39+
@GetMapping("/content")
40+
public ApplicationResponse<List<BannerRes>> getContent() {
4141
return ApplicationResponse.ok(ErrorCode.SUCCESS, bannerService.getContent());
4242
}
4343

44-
@DeleteMapping({"/banner/{banner_id}", "/api/v{version}/banner/{banner_id}"})
45-
public ApplicationResponse<Void> delete(@PathVariable(name = "version", required = false) Long version, @PathVariable("banner_id") Long bannerId) {
44+
@DeleteMapping("/{banner_id}")
45+
public ApplicationResponse<Void> delete(@PathVariable("banner_id") Long bannerId) {
4646
bannerService.delete(bannerId);
4747
return ApplicationResponse.ok(ErrorCode.SUCCESS);
4848
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
package com.selfrunner.gwalit.domain.board.controller;
2+
3+
import com.selfrunner.gwalit.domain.board.dto.request.PostBoardReq;
4+
import com.selfrunner.gwalit.domain.board.dto.request.PutBoardReq;
5+
import com.selfrunner.gwalit.domain.board.dto.request.ReplyReq;
6+
import com.selfrunner.gwalit.domain.board.dto.response.*;
7+
import com.selfrunner.gwalit.domain.board.service.BoardService;
8+
import com.selfrunner.gwalit.domain.member.entity.Member;
9+
import com.selfrunner.gwalit.global.common.ApplicationResponse;
10+
import com.selfrunner.gwalit.global.exception.ErrorCode;
11+
import com.selfrunner.gwalit.global.util.jwt.Auth;
12+
import io.swagger.v3.oas.annotations.Operation;
13+
import io.swagger.v3.oas.annotations.tags.Tag;
14+
import lombok.RequiredArgsConstructor;
15+
import org.springframework.data.domain.Pageable;
16+
import org.springframework.data.domain.Slice;
17+
import org.springframework.data.web.PageableDefault;
18+
import org.springframework.web.bind.annotation.*;
19+
import org.springframework.web.multipart.MultipartFile;
20+
21+
import javax.validation.Valid;
22+
import java.util.List;
23+
24+
@RestController
25+
@RequiredArgsConstructor
26+
@RequestMapping("/api/v1/board")
27+
@Tag(name = "board", description = "질문 게시판 기능 API")
28+
public class BoardController {
29+
30+
private final BoardService boardService;
31+
32+
@Operation(summary = "질문 등록")
33+
@PostMapping("")
34+
public ApplicationResponse<BoardRes> registerBoard(@Auth Member member, @RequestPart(value = "file", required = false) List<MultipartFile> multipartFileList, @Valid @RequestPart(value = "data") PostBoardReq postBoardReq) {
35+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.registerBoard(member, multipartFileList, postBoardReq));
36+
}
37+
38+
@Operation(summary = "질문 수정")
39+
@PutMapping("/{board_id}")
40+
public ApplicationResponse<BoardReplyRes> updateBoard(@Auth Member member, @PathVariable(value = "board_id") Long boardId, @RequestPart(value = "file", required = false) List<MultipartFile> multipartFileList, @Valid @RequestPart(value = "data") PutBoardReq putBoardReq) {
41+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.updateBoard(member, boardId, multipartFileList, putBoardReq));
42+
}
43+
44+
@Operation(summary = "질문 삭제")
45+
@DeleteMapping("/{board_id}")
46+
public ApplicationResponse<Void> deleteBoard(@Auth Member member, @PathVariable(value = "board_id") Long boardId) {
47+
boardService.deleteBoard(member, boardId);
48+
return ApplicationResponse.create(ErrorCode.SUCCESS);
49+
}
50+
51+
@Operation(summary = "질문 상태 변경")
52+
@PatchMapping("/{board_id}")
53+
public ApplicationResponse<BoardReplyRes> changeQuestionStatus(@Auth Member member, @PathVariable(value = "board_id") Long boardId) {
54+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.changeQuestionStatus(member, boardId));
55+
}
56+
57+
@Operation(summary = "질문 1개 가져오기")
58+
@GetMapping("/{board_id}")
59+
public ApplicationResponse<BoardReplyRes> getOneBoard(@Auth Member member, @PathVariable(value = "board_id") Long boardId) {
60+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.getOneBoard(member, boardId));
61+
}
62+
63+
@Operation(summary = "질문 페이지네이션")
64+
@GetMapping("/list/{lecture_id}")
65+
public ApplicationResponse<Slice<BoardMetaRes>> getBoardPagination(@Auth Member member, @PathVariable(value = "lecture_id") Long lectureId, @RequestParam(name = "category") String category, @RequestParam(name = "cursor", required = false) Long cursor, @PageableDefault(size = 15)Pageable pageable) {
66+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.getBoardPagination(member, lectureId, category, cursor, pageable));
67+
}
68+
69+
@Operation(summary = "질문 게시 상태만 가져오기 (메인 페이지용)")
70+
@GetMapping("/main")
71+
public ApplicationResponse<List<BoardMetaRes>> getOpenQuestion(@Auth Member member) {
72+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.getOpenQuestion(member));
73+
}
74+
75+
@Operation(summary = "댓글 등록")
76+
@PostMapping("/{board_id}/reply")
77+
public ApplicationResponse<ReplyRes> registerReply(@Auth Member member, @PathVariable(value = "board_id") Long boardId, @RequestPart(value = "file", required = false) List<MultipartFile> multipartFileList, @Valid @RequestPart(value = "data") ReplyReq replyReq) {
78+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.registerReply(member, boardId, multipartFileList, replyReq));
79+
}
80+
81+
@Operation(summary = "댓글 삭제")
82+
@DeleteMapping("/{board_id}/reply/{reply_id}")
83+
public ApplicationResponse<Void> deleteReply(@Auth Member member, @PathVariable(value = "board_id") Long boardId, @PathVariable(value = "reply_id") Long replyId) {
84+
boardService.deleteReply(member, boardId, replyId);
85+
return ApplicationResponse.create(ErrorCode.SUCCESS);
86+
}
87+
88+
@Operation(summary = "댓글 페이지네이션")
89+
@GetMapping("/{board_id}/reply/list")
90+
public ApplicationResponse<Slice<ReplyRes>> getReplyPagination(@Auth Member member, @PathVariable(value = "board_id") Long boardId, @RequestParam(name = "cursor", required = false) Long cursor, @PageableDefault(size = 15) Pageable pageable) {
91+
return ApplicationResponse.create(ErrorCode.SUCCESS, boardService.getReplyPagination(member, boardId, cursor, pageable));
92+
}
93+
94+
@Operation(summary = "파일 용량 조회")
95+
@GetMapping("/capacity/{lecture_id}")
96+
public ApplicationResponse<BoardFileRes> getFileCapacity(@Auth Member member, @PathVariable(value = "lecture_id") Long lectureId) {
97+
return ApplicationResponse.ok(ErrorCode.SUCCESS, boardService.getFileCapacity(member, lectureId));
98+
}
99+
100+
@Operation(summary = "특정 수업 리포트와 연결된 게시글들 반환")
101+
@GetMapping("/lesson/{lesson_id}")
102+
public ApplicationResponse<List<BoardMetaRes>> getBoardMetaList(@Auth Member member, @PathVariable(value = "lesson_id") Long lessonId) {
103+
return ApplicationResponse.ok(ErrorCode.SUCCESS, boardService.getBoardMetaList(member, lessonId));
104+
}
105+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.selfrunner.gwalit.domain.board.dto.request;
2+
3+
import com.selfrunner.gwalit.domain.board.entity.Board;
4+
import com.selfrunner.gwalit.domain.lecture.entity.Lecture;
5+
import com.selfrunner.gwalit.domain.member.entity.Member;
6+
import lombok.Builder;
7+
import lombok.Getter;
8+
9+
import javax.validation.constraints.NotNull;
10+
import javax.validation.constraints.Size;
11+
12+
@Getter
13+
//@Builder
14+
public class PostBoardReq {
15+
16+
@NotNull
17+
private Long lectureId;
18+
19+
@NotNull
20+
private Boolean isPublic;
21+
22+
private Long lessonId;
23+
24+
@Size(min = 1, message = "제목이 입력되어 있어야 합니다.")
25+
private String title;
26+
27+
private String body;
28+
29+
@NotNull
30+
private String category;
31+
32+
@NotNull
33+
private String status;
34+
35+
public Board toEntity(Lecture lecture, Member member) {
36+
return Board.builder()
37+
.lecture(lecture)
38+
.member(member)
39+
.isPublic(this.isPublic)
40+
.lessonId(this.lessonId)
41+
.title(this.title)
42+
.body(this.body)
43+
.category(this.category)
44+
.status(this.status)
45+
.build();
46+
}
47+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.selfrunner.gwalit.domain.board.dto.request;
2+
3+
import lombok.Getter;
4+
5+
import javax.validation.constraints.NotNull;
6+
import javax.validation.constraints.Size;
7+
import java.util.List;
8+
9+
@Getter
10+
public class PutBoardReq {
11+
12+
private Long lessonId;
13+
14+
@Size(min = 1, message = "제목이 입력되어 있어야 합니다.")
15+
private String title;
16+
17+
private String body;
18+
19+
@NotNull
20+
private String status;
21+
22+
@NotNull
23+
private List<String> deleteFileList;
24+
}

0 commit comments

Comments
 (0)