Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MultipartException;

import io.swagger.v3.oas.annotations.Hidden;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Profile("!swagger") // 또는 커스텀 조건
@Hidden
@RestControllerAdvice
public class GlobalExceptionHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import com.example.gtable.store.dto.StoreUpdateRequest;
import com.example.gtable.store.service.StoreService;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;

@Tag(name = "Store API", description = "주점 API")
@RestController
@RequestMapping("/stores")
@RequiredArgsConstructor
Expand All @@ -29,6 +32,8 @@ public class StoreController {
private final StoreService storeService;

@PostMapping
@Operation(summary = "주점 등록", description = "관리자의 주점 등록")
@ApiResponse(responseCode = "201", description = "주점 생성/등록")
public ResponseEntity<?> createStore(@Valid @RequestBody StoreCreateRequest request) {
StoreCreateResponse response = storeService.createStore(request);

Expand All @@ -42,6 +47,8 @@ public ResponseEntity<?> createStore(@Valid @RequestBody StoreCreateRequest requ
}

@GetMapping("/all-stores")
@Operation(summary = "모든 주점 리스트 조회", description = "등록된 모든 주점 리스트 조회")
@ApiResponse(responseCode = "200", description = "전체 주점 리스트 조회")
public ResponseEntity<?> getAllStores() {
return ResponseEntity
.status(HttpStatus.OK)
Expand All @@ -53,6 +60,8 @@ public ResponseEntity<?> getAllStores() {
}

@GetMapping("/{storeId}")
@Operation(summary = "특정 주점 조회", description = "특정 주점 정보 개별 조회")
@ApiResponse(responseCode = "200", description = "주점 조회")
public ResponseEntity<?> getStoreById(@PathVariable Long storeId) {
return ResponseEntity
.status(HttpStatus.OK)
Expand All @@ -64,6 +73,8 @@ public ResponseEntity<?> getStoreById(@PathVariable Long storeId) {
}

@PatchMapping("/{storeId}")
@Operation(summary = "주점 수정", description = "관리자의 주점 정보 수정")
@ApiResponse(responseCode = "200", description = "주점 수정")
public ResponseEntity<?> updateStore(
@PathVariable Long storeId,
@Valid @RequestBody StoreUpdateRequest request
Expand All @@ -78,6 +89,8 @@ public ResponseEntity<?> updateStore(
}

@DeleteMapping("/{storeId}")
@Operation(summary = "주점 삭제", description = "관리자의 주점 삭제")
@ApiResponse(responseCode = "200", description = "주점 삭제")
public ResponseEntity<?> deleteStore(@PathVariable Long storeId) {
return ResponseEntity
.ok()
Expand All @@ -89,6 +102,8 @@ public ResponseEntity<?> deleteStore(@PathVariable Long storeId) {
}

@GetMapping("/search")
@Operation(summary = "주점 검색", description = "등록된 주점 중 검색")
@ApiResponse(responseCode = "200", description = "주점 검색")
public ResponseEntity<?> searchStores(@RequestParam("name") String name) {
return ResponseEntity
.ok()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
import com.example.gtable.user.entity.User;
import com.example.gtable.user.service.UserService;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Tag(name = "User API", description = "사용자 API")
@RestController
@RequestMapping("/api/users")
@RequiredArgsConstructor
Expand All @@ -30,6 +33,8 @@ public class UserController {

// 관리자 회원가입
@PostMapping("/signup")
@Operation(summary = "회원가입", description = "관리자 회원가입 / 실제로는 화면 구현X")
@ApiResponse(responseCode = "201", description = "회원가입")
public ResponseEntity<?> signup(@RequestBody @Valid ManagerSignupRequestDto managerSignupRequestDto) {
return ResponseEntity
.status(HttpStatus.CREATED)
Expand All @@ -42,6 +47,8 @@ public ResponseEntity<?> signup(@RequestBody @Valid ManagerSignupRequestDto mana

// 로그인된 유저 정보를 확인하는 api
@GetMapping("/me")
@Operation(summary = "내 정보 조회", description = "관리자/사용자 내정보 조회")
@ApiResponse(responseCode = "200", description = "마이페이지에 들어갈 정보")
public ResponseEntity<UserResponseDto> getMyInfo(@AuthenticationPrincipal CustomOAuth2User customOAuth2User) {
User user = customOAuth2User.getUser();

Expand All @@ -53,6 +60,8 @@ public ResponseEntity<UserResponseDto> getMyInfo(@AuthenticationPrincipal Custom
}

@PostMapping("/login")
@Operation(summary = "관리자 로그인", description = "관리자 로그인")
@ApiResponse(responseCode = "200", description = "관리자 로그인")
public ResponseEntity<?> login(@RequestBody @Valid ManagerLoginRequestDto managerLoginRequestDto) {
return ResponseEntity
.ok()
Expand Down
Loading