Я зарегистрировал модуль времени по адресу:
Код: Выделить всё
@Configuration
public class JacksonConfiguration {
@Bean
@Primary
public ObjectMapper objectMapper() {
ObjectMapper mapper = JsonMapper.builder()
.addModule(new JavaTimeModule())
.build();
return mapper;
}
}
Код: Выделить всё
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
2.17.2
com.fasterxml.jackson.datatype
jackson-datatype-jdk8
на этом этапе:
Код: Выделить всё
PlannedMaintenance maintenance = new PlannedMaintenance();
maintenance.setEquipmentId(Long.parseLong(equipmentId));
maintenance.setPlannedStartTime(plannedStartTime);
maintenance.setPlannedEndTime(plannedEndTime);
maintenance.setCreated(OffsetDateTime.now());
boolean isInserted = plannedMaintenanceDAO.save(maintenance);
StompHeaders replyHeaders = new StompHeaders();
replyHeaders.add("status", isInserted ? "success" : "error");
replyHeaders.add("correlation-id", headers.get("correlation-id").get(0));
List maintenanceReturn = plannedMaintenanceDAO.findAll();
stompService.sendMessage(headers.get("reply-to").get(0), maintenanceReturn, replyHeaders);
Код: Выделить всё
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "PK")
private Long id;
@Column(name = "PLANNED_START_TIME", nullable = false)
private OffsetDateTime plannedStartTime;
@Column(name = "PLANNED_STOP_TIME", nullable = false)
private OffsetDateTime plannedEndTime;
@Column(name = "ACTUAL_END_TIME")
private OffsetDateTime actualEndTime;
@Column(name = "CREATED", nullable = false, updatable = false)
private OffsetDateTime created;
@Column(name = "UPDATED")
private OffsetDateTime updated;
@Column(name = "EQUIPMENT_ID", nullable = false)
private Long equipmentId;
Я использую SpringBoot 3.1.10
Подробнее здесь: https://stackoverflow.com/questions/791 ... -not-suppo