gpt4 book ai didi

JAVA - LocalDate.plusDay() 不能正常工作

转载 作者:行者123 更新时间:2023-11-29 07:26:55 25 4
gpt4 key购买 nike

<分区>

我想创建一种方法,将属于某些培训周期的培训添加到日历中。可能我犯了一些错误,因为它只将所有培训添加到一天。

TrainingCycle 模型类:

@DynamoDBTable(tableName = "trainingCycle")
public class TrainingCycle extends Request {
private String id;
private String cycleName;
private Long cycleTime;
private LocalDateTime startTime;
private List<List<Training>> trainingsForDay;

训练模型类:

@DynamoDBTable(tableName = "training")
@DynamoDBDocument
public class Training extends Request {

private String id;
private String trainingName;
private Integer predictedCaloriesToBurn;
private Integer burnedCalories;
private LocalDateTime startTime;
private LocalDateTime endTime;
private List<Exercise> exerciseList;
private List<TrainingLabels> trainingLabels;
private boolean approved;
private ActivityDay activityDay;

AddTrainingCycle 方法:

    public List<Day> addTrainingCycle(String userId, TrainingCycle trainingCycle, LocalDate localDate) {

List<Day> days = new ArrayList<>();
for (List<Training> trainings : trainingCycle.getTrainingsForDay()) {
if (trainings == null || trainings.isEmpty()) {
localDate.plusDays(1);
} else {
Day actualDay = getActivityBoardDay(localDate, userId);
actualDay.getTrainings().addAll(trainings);
localDate.plusDays(1);
days.add(actualDay);
}
}
return days;
}

我已经创建了测试方法,正如我所说的 - 它添加了所有的训练,但仅从争论开始一天,它没有增加 LocalDate。有人可以帮我吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com