-
Notifications
You must be signed in to change notification settings - Fork 2
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
[feat] 회의 생성 API 작성
- Loading branch information
Showing
23 changed files
with
360 additions
and
32 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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/asap/server/controller/MeetingController.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.asap.server.controller; | ||
|
||
import com.asap.server.common.dto.ApiResponse; | ||
import com.asap.server.controller.dto.request.MeetingSaveRequestDto; | ||
import com.asap.server.controller.dto.response.MeetingSaveResponseDto; | ||
import com.asap.server.exception.Success; | ||
import com.asap.server.service.MeetingService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.validation.Valid; | ||
|
||
@RestController | ||
@RequestMapping("/meeting") | ||
@RequiredArgsConstructor | ||
public class MeetingController { | ||
private final MeetingService meetingService; | ||
|
||
@PostMapping | ||
public ApiResponse<MeetingSaveResponseDto> create(@RequestBody @Valid MeetingSaveRequestDto meetingSaveRequestDto){ | ||
return ApiResponse.success(Success.CREATE_MEETING_SUCCESS, meetingService.create(meetingSaveRequestDto) ); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/asap/server/controller/dto/request/MeetingSaveRequestDto.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.asap.server.controller.dto.request; | ||
|
||
import com.asap.server.domain.enums.Duration; | ||
import com.asap.server.domain.enums.Place; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
import javax.validation.constraints.Size; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class MeetingSaveRequestDto { | ||
|
||
@NotBlank(message = "회의 제목이 입력되지 않았습니다.") | ||
@Size(max = 15 , message = "제목의 최대 입력 길이(15자)를 초과했습니다.") | ||
private String title; | ||
|
||
private List<String> availableDateList; | ||
|
||
private List<PreferTimeSaveRequestDto> preferTimeSaveRequestDtoList; | ||
|
||
@NotNull(message = "회의 형식이 입력되지 않았습니다.") | ||
private Place place; | ||
|
||
private String placeDetail; | ||
|
||
@NotNull(message = "회의 진행 시간이 입력되지 않았습니다.") | ||
private Duration duration; | ||
|
||
@NotBlank(message = "방장의 이름이 입력되지 않았습니다.") | ||
@Size(max = 8 , message = "방장 이름의 최대 입력 길이(8자)를 초과했습니다.") | ||
private String name; | ||
|
||
@NotBlank(message = "회의 비밀번호가 입력되지 않았습니다.") | ||
@Size(min = 4, message = "비밀번호의 최소 입력 길이는 4자입니다.") | ||
@Pattern(regexp = "\\d{4,}", message = "비밀번호는 4자리 이상 숫자입니다.") | ||
private String password; | ||
|
||
@Size(max = 50, message = "추가 내용의 최대 입력 길이(50자)를 초과했습니다.") | ||
private String additionalInfo; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/asap/server/controller/dto/request/PreferTimeSaveRequestDto.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,15 @@ | ||
package com.asap.server.controller.dto.request; | ||
|
||
import com.asap.server.domain.enums.TimeSlot; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class PreferTimeSaveRequestDto { | ||
|
||
private TimeSlot startTime; | ||
|
||
private TimeSlot endTime; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/asap/server/controller/dto/response/MeetingSaveResponseDto.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.asap.server.controller.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class MeetingSaveResponseDto { | ||
private String url; | ||
private String accessToken; | ||
} |
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
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 |
---|---|---|
@@ -1,5 +1,19 @@ | ||
package com.asap.server.domain.enums; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
public enum Duration { | ||
HALF, HOUR, HOUR_HALF, TWO_HOUR, TWO_HOUR_HALF, THREE_HOUR | ||
} | ||
HALF("HALF"), | ||
HOUR("HOUR"), | ||
HOUR_HALF("HOUR_HALF"), | ||
TWO_HOUR("TWO_HOUR"), | ||
TWO_HOUR_HALF("TWO_HOUR_HALF"), | ||
THREE_HOUR("THREE_HOUR"); | ||
|
||
@Getter | ||
@JsonValue | ||
private String duration; | ||
} |
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,5 +1,16 @@ | ||
package com.asap.server.domain.enums; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
public enum Place { | ||
ONLINE, OFFLINE, UNDEFINED | ||
ONLINE("ONLINE"), | ||
OFFLINE("OFFLINE"), | ||
UNDEFINED("UNDEFINED"); | ||
|
||
@Getter | ||
@JsonValue | ||
private String place; | ||
} |
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,5 +1,15 @@ | ||
package com.asap.server.domain.enums; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
public enum Role { | ||
HOST, MEMBER | ||
HOST("HOST"), | ||
MEMBER("MEMBER"); | ||
|
||
@Getter | ||
@JsonValue | ||
private String role; | ||
} |
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
Oops, something went wrong.