Skip to content

Commit

Permalink
#16 refactor: createPartyChattingRoom에 파라미터 PostPartyChattingRoomReq 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaktmchl committed Nov 22, 2022
1 parent f0f410f commit a96c6b9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import shop.geeksasangchat.common.response.BaseResponse;
import shop.geeksasangchat.domain.Chatting;
import shop.geeksasangchat.domain.ChattingRoom;
import shop.geeksasangchat.dto.PostChattingReq;
import shop.geeksasangchat.dto.chattingmember.PostParticipantInfoReq;
import shop.geeksasangchat.dto.partychattingroom.PostPartyChattingRoomReq;
import shop.geeksasangchat.service.PartyChattingService;
import shop.geeksasangchat.utils.jwt.JwtInfo;
import shop.geeksasangchat.utils.jwt.NoIntercept;
Expand All @@ -32,16 +34,9 @@ public class PartyChattingController {
@ApiResponse(code = 4000 ,message ="서버 오류입니다.")
})
@PostMapping
// @NoIntercept //TODO:개발을 위해 임시로 jwt 허용되게한 것. 추후 제거 바람.
// public BaseResponse<Long> createPartyChattingRoom(HttpServletRequest request){
// JwtInfo jwtInfo = (JwtInfo) request.getAttribute("jwtInfo");
// String id = partyChattingService.createChattingRoom(jwtInfo.getUserId(), "title");
// return new BaseResponse(id);
// }
@NoIntercept //TODO:개발을 위해 임시로 jwt 허용되게한 것. 추후 제거 바람.
public BaseResponse<Long> createPartyChattingRoom(HttpServletRequest request){
// JwtInfo jwtInfo = (JwtInfo) request.getAttribute("jwtInfo");
String id = partyChattingService.createChattingRoom(1, "title");
public BaseResponse<Long> createPartyChattingRoom(HttpServletRequest request, @RequestBody @Validated PostPartyChattingRoomReq postPartyChattingRoomReq){
JwtInfo jwtInfo = (JwtInfo) request.getAttribute("jwtInfo");
String id = partyChattingService.createChattingRoom(jwtInfo.getUserId(), postPartyChattingRoomReq.getTitle());
return new BaseResponse(id);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package shop.geeksasangchat.dto.partychattingroom;

import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

@NoArgsConstructor
@Getter
public class PostPartyChattingRoomReq {
@NotBlank
private String title;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String createChattingRoom(@RequestParam String email, @RequestParam Strin

@GetMapping
@NoIntercept//TODO:개발을 위해 임시로 jwt 허용되게한 것. 추후 제거 바람.
public String joinChattingRoom(@RequestParam String email, @RequestParam String chattingRoomUUID){
public String joinChattingRoom(@RequestParam String email, @RequestParam String chattingRoomUUID){

String exchangeName = "chatting-" + "exchange-" + chattingRoomUUID;

Expand Down

0 comments on commit a96c6b9

Please sign in to comment.