-
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.
Merge pull request #28 from DuruDuru-UMC-7th/27-feat-채팅-controller-뼈대-작성
feat: 채팅 API 컨트롤러 뼈대 구현
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/com/backend/DuruDuru/global/web/controller/AlertController.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,28 @@ | ||
package com.backend.DuruDuru.global.web.controller; | ||
|
||
|
||
import com.backend.DuruDuru.global.apiPayload.ApiResponse; | ||
import com.backend.DuruDuru.global.apiPayload.code.status.SuccessStatus; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@Validated | ||
@CrossOrigin | ||
@Slf4j | ||
@RequestMapping("/Alert") | ||
@Tag(name = "알림 API", description = "알림 관련 API입니다.") | ||
public class AlertController { | ||
// FCM 토큰 등록 | ||
@PostMapping("/fcm/token") | ||
@Operation(summary = "FCM 토큰 등록 API", description = "사용자의 FCM 토큰 서버에 등록 API") | ||
public ApiResponse<?> registerFcmToken(@RequestBody String fcmToken) { | ||
return ApiResponse.onSuccess(SuccessStatus.CHAT_OK, null); | ||
} | ||
} | ||
|
42 changes: 42 additions & 0 deletions
42
src/main/java/com/backend/DuruDuru/global/web/controller/ChatController.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,42 @@ | ||
package com.backend.DuruDuru.global.web.controller; | ||
|
||
import com.backend.DuruDuru.global.apiPayload.ApiResponse; | ||
import com.backend.DuruDuru.global.apiPayload.code.status.SuccessStatus; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@Validated | ||
@CrossOrigin | ||
@Slf4j | ||
@RequestMapping("/chat") | ||
@Tag(name = "채팅 API", description = "채팅 관련 API입니다.") | ||
public class ChatController { | ||
|
||
// 채팅방 목록 조회 | ||
@GetMapping("/rooms") | ||
@Operation(summary = "채팅방 목록 조회 API", description = "사용자의 채팅방 목록 조회API") | ||
public ApiResponse<?> getChatRooms() { | ||
return ApiResponse.onSuccess(SuccessStatus.CHAT_OK, null); | ||
} | ||
|
||
// 채팅 내역 조회 | ||
@GetMapping("/rooms/{roomId}/messages") | ||
@Operation(summary = "채팅 내역 조회 API", description = "특정 채팅방 채팅 내역을 조회 API") | ||
public ApiResponse<?> getChatMessages(@PathVariable Long roomId) { | ||
return ApiResponse.onSuccess(SuccessStatus.CHAT_OK, null); | ||
} | ||
|
||
// 채팅방 삭제 | ||
@DeleteMapping("/rooms/{roomId}") | ||
@Operation(summary = "채팅방 삭제 API", description = "특정 채팅방 삭제 API") | ||
public ApiResponse<?> deleteChatRoom(@PathVariable Long roomId) { | ||
return ApiResponse.onSuccess(SuccessStatus.CHAT_OK, null); | ||
} | ||
|
||
} |