Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/notes")
@RequestMapping("/api/v1")
@RequiredArgsConstructor
public class NoteController {

private final NoteCommandService noteCommandService;
private final NoteQueryService noteQueryService;
private final ViewCommandService viewCommandService;

@PostMapping
@PostMapping("/notes")
public ResponseEntity<NoteCreateResponse> create(
@Authenticated AuthContext authContext,
@RequestBody @Valid NoteCreateRequest request
Expand All @@ -49,7 +49,7 @@ public ResponseEntity<NoteCreateResponse> create(
.body(new NoteCreateResponse(true));
}

@PatchMapping("/{noteId}")
@PatchMapping("/notes/{noteId}")
public ResponseEntity<NoteUpdateResponse> update(
@Authenticated AuthContext authContext,
@PathVariable(name = "noteId") Long noteId,
Expand All @@ -62,7 +62,7 @@ public ResponseEntity<NoteUpdateResponse> update(
.body(new NoteUpdateResponse(true));
}

@DeleteMapping("/{noteId}")
@DeleteMapping("/notes/{noteId}")
public ResponseEntity<NoteDeleteResponse> delete(
@Authenticated AuthContext authContext,
@PathVariable(name = "noteId") Long noteId
Expand All @@ -74,7 +74,7 @@ public ResponseEntity<NoteDeleteResponse> delete(
.body(new NoteDeleteResponse(true));
}

@GetMapping("/{noteId}")
@GetMapping("/notes/{noteId}")
public ResponseEntity<NoteDetailResponse> getNote(
@Authenticated AuthContext authContext,
@RequestHeader("Device-Id") String deviceId,
Expand All @@ -91,7 +91,7 @@ public ResponseEntity<NoteDetailResponse> getNote(
.body(noteQueryService.getNoteById(noteId, authContext.getId()));
}

@GetMapping
@GetMapping("/users/notes")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/user로 시작하는데도 NoteController에 적은 이유가 따로 있나요? 수정을 할 필요는 없을 것 같은데 궁금해요

public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfUser(
@Authenticated AuthContext authContext,
@RequestParam(name = "hasLyrics") boolean hasLyrics,
Expand All @@ -106,7 +106,7 @@ public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfUs
.body(response);
}

@GetMapping("/favorite-artists")
@GetMapping("/notes/favorite-artists")
public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfFavoriteArtists(
@Authenticated AuthContext authContext,
@RequestParam(name = "hasLyrics") boolean hasLyrics,
Expand All @@ -120,7 +120,7 @@ public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfFa
.body(response);
}

@GetMapping("/artists")
@GetMapping("/notes/artists")
public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfArtist(
@Authenticated AuthContext authContext,
@RequestParam(name = "hasLyrics") boolean hasLyrics,
Expand All @@ -135,7 +135,7 @@ public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfAr
.body(response);
}

@GetMapping("/songs")
@GetMapping("/notes/songs")
public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfSong(
@Authenticated AuthContext authContext,
@RequestParam(name = "hasLyrics") boolean hasLyrics,
Expand All @@ -150,7 +150,7 @@ public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesOfSo
.body(response);
}

@GetMapping("/bookmarked")
@GetMapping("/notes/bookmarked")
public ResponseEntity<CursorBasePaginatedResponse<NoteGetResponse>> getNotesBookmarked(
@Authenticated AuthContext authContext,
@RequestParam(name = "hasLyrics") boolean hasLyrics,
Expand Down