Skip to content

Commit

Permalink
[SHIBUI-2165]
Browse files Browse the repository at this point in the history
updated precision for json datetime
  • Loading branch information
jj committed Oct 11, 2021
1 parent 5cdde75 commit 923e62b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public abstract class AbstractAuditable implements Auditable {
@CreationTimestamp
@CreatedDate
@Column(nullable = false, updatable = false, columnDefinition = "DATETIME(9)")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS")
private LocalDateTime createdDate;

@UpdateTimestamp
@LastModifiedDate
@Column(nullable = false, columnDefinition = "DATETIME(9)")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS")
private LocalDateTime modifiedDate;

@Column(name = "created_by")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class UsersControllerIntegrationTests extends AbstractBaseDataJpaTest {
@Bean
ObjectMapper objectMapper() {
JavaTimeModule module = new JavaTimeModule()
LocalDateTimeDeserializer localDateTimeDeserializer = new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSS"))
LocalDateTimeDeserializer localDateTimeDeserializer = new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS"))
module.addDeserializer(LocalDateTime.class, localDateTimeDeserializer)

return Jackson2ObjectMapperBuilder.json().modules(module).featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS).build()
Expand Down

0 comments on commit 923e62b

Please sign in to comment.