Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/main/java/io/spring/api/ArticleApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ArticleApi {
private ArticleCommandService articleCommandService;

@GetMapping
public ResponseEntity<?> article(
public ResponseEntity<Map<String, Object>> article(
@PathVariable("slug") String slug, @AuthenticationPrincipal User user) {
return articleQueryService
.findBySlug(slug, user)
Expand All @@ -42,7 +42,7 @@ public ResponseEntity<?> article(
}

@PutMapping
public ResponseEntity<?> updateArticle(
public ResponseEntity<Map<String, Object>> updateArticle(
@PathVariable("slug") String slug,
@AuthenticationPrincipal User user,
@Valid @RequestBody UpdateArticleParam updateArticleParam) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/spring/api/CommentsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class CommentsApi {
private CommentQueryService commentQueryService;

@PostMapping
public ResponseEntity<?> createComment(
public ResponseEntity<Map<String, Object>> createComment(
@PathVariable("slug") String slug,
@AuthenticationPrincipal User user,
@Valid @RequestBody NewCommentParam newCommentParam) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@SuppressWarnings("serial")
public class InvalidRequestException extends RuntimeException {
private final Errors errors;
private final transient Errors errors;

public InvalidRequestException(Errors errors) {
super("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,32 @@
@MappedTypes(DateTime.class)
public class DateTimeHandler implements TypeHandler<DateTime> {

private static final Calendar UTC_CALENDAR = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
private static final TimeZone UTC_TIMEZONE = TimeZone.getTimeZone("UTC");

@Override
public void setParameter(PreparedStatement ps, int i, DateTime parameter, JdbcType jdbcType)
throws SQLException {
ps.setTimestamp(
i, parameter != null ? new Timestamp(parameter.getMillis()) : null, UTC_CALENDAR);
i,
parameter != null ? new Timestamp(parameter.getMillis()) : null,
Calendar.getInstance(UTC_TIMEZONE));
}

@Override
public DateTime getResult(ResultSet rs, String columnName) throws SQLException {
Timestamp timestamp = rs.getTimestamp(columnName, UTC_CALENDAR);
Timestamp timestamp = rs.getTimestamp(columnName, Calendar.getInstance(UTC_TIMEZONE));
return timestamp != null ? new DateTime(timestamp.getTime()) : null;
}

@Override
public DateTime getResult(ResultSet rs, int columnIndex) throws SQLException {
Timestamp timestamp = rs.getTimestamp(columnIndex, UTC_CALENDAR);
Timestamp timestamp = rs.getTimestamp(columnIndex, Calendar.getInstance(UTC_TIMEZONE));
return timestamp != null ? new DateTime(timestamp.getTime()) : null;
}

@Override
public DateTime getResult(CallableStatement cs, int columnIndex) throws SQLException {
Timestamp ts = cs.getTimestamp(columnIndex, UTC_CALENDAR);
Timestamp ts = cs.getTimestamp(columnIndex, Calendar.getInstance(UTC_TIMEZONE));
return ts != null ? new DateTime(ts.getTime()) : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class DefaultJwtServiceTest {

@BeforeEach
public void setUp() {
jwtService = new DefaultJwtService("123123123123123123123123123123123123123123123123123123123123", 3600);
jwtService =
new DefaultJwtService("123123123123123123123123123123123123123123123123123123123123", 3600);
}

@Test
Expand Down