Skip to content

Commit

Permalink
[#148] Add v2 meeting api
Browse files Browse the repository at this point in the history
  • Loading branch information
emost22 committed Apr 3, 2023
1 parent 2fae40c commit 9c6c46d
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.promise8.wwwbe.controller.v2;

import com.promise8.wwwbe.config.security.UserPrincipal;
import com.promise8.wwwbe.model.v1.dto.req.MeetingCreateReqDtoV1;
import com.promise8.wwwbe.model.v1.dto.res.MeetingGetResDtoV1;
import com.promise8.wwwbe.model.v1.http.BaseResponse;
import com.promise8.wwwbe.service.MeetingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
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;

@RestController
@RequestMapping("/api/v2/meetings")
@RequiredArgsConstructor
@Api(value = "MeetingController", tags = "MeetingController", description = "약속 방과 관련된 모든 api를 제공한다.")
public class V2MeetingController {
private final MeetingService meetingService;

@ApiOperation(value = "약속방 생성", notes = "약속방을 생성한다.")
@ApiResponses({
@ApiResponse(code = 0, message = "생성 완료"),
@ApiResponse(code = 403, message = "접근 거부"),
@ApiResponse(code = 500, message = "서버 에러 발생"),
@ApiResponse(code = 1000, message = "서버 에러 발생")
})
@PostMapping
public BaseResponse<MeetingGetResDtoV1> createMeeting(
@AuthenticationPrincipal UserPrincipal userPrincipal,
@RequestBody MeetingCreateReqDtoV1 meetingCreateReqDto) {

return BaseResponse.ok();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.promise8.wwwbe.model.v2.dto.res;

import com.promise8.wwwbe.model.v1.dto.PromiseDayOfWeek;
import com.promise8.wwwbe.model.v1.dto.PromiseTime;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;

@Setter
@Getter
@Builder
public class ConfirmedPromise {
@ApiModelProperty(value = "confirmedDate", notes = "확정된 날짜")
private LocalDate promiseDate;
@ApiModelProperty(value = "confirmedDayOfWeek", notes = "요일")
private PromiseDayOfWeek promiseDayOfWeek;
@ApiModelProperty(value = "confirmedTime", notes = "확정된 시간대")
private PromiseTime promiseTime;
@ApiModelProperty(value = "confirmedPlace", notes = "확정된 장소")
private String promisePlace;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.promise8.wwwbe.model.v2.dto.res;

import io.swagger.annotations.ApiModel;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@Builder
@ApiModel(value = "MeetingDetail", description = "약속방 내의 필요한 정보를 모두 담는다.")
public class MeetingGetResDtoV2 {
private Long meetingId;
private String meetingName;
private int minimumAlertMembers;
private String currentUserName;
private Boolean isHost;
private int joinedCount;
private int votingCount;
private String meetingCode;
private String shortLink;
}

0 comments on commit 9c6c46d

Please sign in to comment.