Skip to content

Commit 96c784f

Browse files
authored
Merge pull request #36 from dacharyc/java-mismatches
Java final cleanup
2 parents bf1d310 + 2444b1f commit 96c784f

File tree

14 files changed

+40
-349
lines changed

14 files changed

+40
-349
lines changed

mflix/client/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"name": "sample-mflix-front-end",
3+
"description": "Next.js frontend for MongoDB sample mflix application demonstrating CRUD operations, aggregations, and search",
4+
"license": "Apache-2.0",
5+
"author": "MongoDB Documentation Team",
36
"version": "0.1.0",
47
"private": true,
58
"scripts": {

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/controller/MovieControllerImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
* - DELETE /api/movies/{id} - Delete a movie
4141
* - DELETE /api/movies - Delete multiple movies
4242
* - DELETE /api/movies/{id}/find-and-delete - Find and delete a movie
43-
* - GET /api/movies/aggregations/comments - Aggregate movies with most comments
44-
* - GET /api/movies/aggregations/years - Aggregate movies by year with statistics
45-
* - GET /api/movies/aggregations/directors - Aggregate directors with most movies
43+
* - GET /api/movies/aggregations/reportingByComments - Aggregate movies with most comments
44+
* - GET /api/movies/aggregations/reportingByYear - Aggregate movies by year with statistics
45+
* - GET /api/movies/aggregations/reportingByDirectors - Aggregate directors with most movies
4646
* - GET /api/movies/search - Text search using MongoDB Search Index across multiple fields (plot, fullplot, directors, writers, cast)
4747
* - GET /api/movies/vector-search - Vector search using Voyage AI embeddings to find movies with similar plots
4848
* - GET /api/movies/find-similar-movies - Vector search to find similar movies based on plot embeddings
@@ -296,7 +296,7 @@ public ResponseEntity<SuccessResponse<DeleteResponse>> deleteMoviesBatch(
296296
description = "Aggregates movies with their most recent comments using MongoDB $lookup (join) operation. " +
297297
"Demonstrates how to combine data from the movies and comments collections."
298298
)
299-
@GetMapping("/aggregations/comments")
299+
@GetMapping("/aggregations/reportingByComments")
300300
public ResponseEntity<SuccessResponse<List<MovieWithCommentsResult>>> getMoviesWithMostRecentComments(
301301
@Parameter(description = "Maximum number of movies to return (default: 10, max: 50)")
302302
@RequestParam(defaultValue = "10") Integer limit,
@@ -331,7 +331,7 @@ public ResponseEntity<SuccessResponse<List<MovieWithCommentsResult>>> getMoviesW
331331
description = "Aggregates movies by year with statistics including movie count and average rating. " +
332332
"Demonstrates MongoDB $group operation for statistical aggregation."
333333
)
334-
@GetMapping("/aggregations/years")
334+
@GetMapping("/aggregations/reportingByYear")
335335
public ResponseEntity<SuccessResponse<List<MoviesByYearResult>>> getMoviesByYearWithStats() {
336336

337337
List<MoviesByYearResult> results = movieService.getMoviesByYearWithStats();
@@ -352,7 +352,7 @@ public ResponseEntity<SuccessResponse<List<MoviesByYearResult>>> getMoviesByYear
352352
description = "Aggregates directors with the most movies and their statistics. " +
353353
"Demonstrates MongoDB $unwind operation for array flattening and aggregation."
354354
)
355-
@GetMapping("/aggregations/directors")
355+
@GetMapping("/aggregations/reportingByDirectors")
356356
public ResponseEntity<SuccessResponse<List<DirectorStatisticsResult>>> getDirectorsWithMostMovies(
357357
@Parameter(description = "Maximum number of directors to return (default: 20, max: 100)")
358358
@RequestParam(defaultValue = "20") Integer limit) {

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/exception/DatabaseOperationException.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,5 @@ public class DatabaseOperationException extends RuntimeException {
1212
public DatabaseOperationException(String message) {
1313
super(message);
1414
}
15-
16-
public DatabaseOperationException(String message, Throwable cause) {
17-
super(message, cause);
18-
}
1915
}
2016

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/exception/ResourceNotFoundException.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
* Exception thrown when a requested resource is not found.
55
*
66
* This exception results in a 404 Not Found response.
7-
*
8-
* TODO: Phase 7 - Implement custom exception
7+
*
98
*/
109
public class ResourceNotFoundException extends RuntimeException {
1110

1211
public ResourceNotFoundException(String message) {
1312
super(message);
1413
}
15-
16-
public ResourceNotFoundException(String message, Throwable cause) {
17-
super(message, cause);
18-
}
1914
}
2015

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/exception/ValidationException.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
* Exception thrown when request validation fails.
55
*
66
* This exception results in a 400 Bad Request response.
7-
*
8-
* TODO: Phase 7 - Implement custom exception
7+
*
98
*/
109
public class ValidationException extends RuntimeException {
1110

1211
public ValidationException(String message) {
1312
super(message);
1413
}
15-
16-
public ValidationException(String message, Throwable cause) {
17-
super(message, cause);
18-
}
1914
}
2015

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/model/Comment.java

Lines changed: 0 additions & 69 deletions
This file was deleted.

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/model/Theater.java

Lines changed: 0 additions & 119 deletions
This file was deleted.

mflix/server/java-spring/src/main/java/com/mongodb/samplemflix/model/dto/MovieWithCommentsResult.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class MovieWithCommentsResult {
2424
/**
2525
* Movie ID as string.
2626
*/
27-
private String id;
27+
private String _id;
2828

2929
/**
3030
* Movie title.
@@ -52,9 +52,9 @@ public class MovieWithCommentsResult {
5252
private List<String> genres;
5353

5454
/**
55-
* IMDB rating information.
55+
* IMDB rating (0.0 to 10.0).
5656
*/
57-
private ImdbInfo imdb;
57+
private Double imdbRating;
5858

5959
/**
6060
* Most recent comments for this movie.
@@ -71,25 +71,6 @@ public class MovieWithCommentsResult {
7171
*/
7272
private Date mostRecentCommentDate;
7373

74-
/**
75-
* Nested class for IMDB information.
76-
*/
77-
@Data
78-
@Builder
79-
@NoArgsConstructor
80-
@AllArgsConstructor
81-
public static class ImdbInfo {
82-
/**
83-
* IMDB rating (0.0 to 10.0).
84-
*/
85-
private Double rating;
86-
87-
/**
88-
* Number of votes.
89-
*/
90-
private Integer votes;
91-
}
92-
9374
/**
9475
* Nested class for comment information.
9576
*/

0 commit comments

Comments
 (0)