Skip to content

Commit

Permalink
Merge pull request #86 from MacroSoft-Team/feat/#84/logMergeLogicChange
Browse files Browse the repository at this point in the history
[FEAT] 겹치는 장작 기준 위치와 시간 둘다 겹치는 거에서 시간만 겹치는 것으로 변경
  • Loading branch information
dgh06175 authored Nov 26, 2024
2 parents c01ad63 + e36d7b4 commit e8fe352
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/main/java/com/macrosoft/modakserver/domain/log/entity/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ public class Log extends BaseEntity {
@OrderBy("takenAt ASC")
private List<LogImage> logImages = new ArrayList<>();

public void addLogImage(LogImage logImage) {
logImage.setLog(this);
this.logImages.add(logImage);
}

public void removeLogImage(LogImage logImage) {
logImage.setLog(null);
this.logImages.remove(logImage);
}

public static Log of(Campfire campfire, Member member, UploadLog uploadLog) {
LogMetadata logMetadata = uploadLog.logMetadata();
Location location = Location.of(
Expand Down Expand Up @@ -103,8 +93,19 @@ public static Log of(Campfire campfire, Member member, UploadLog uploadLog) {
return log;
}

public void addLogImage(LogImage logImage) {
logImage.setLog(this);
this.logImages.add(logImage);
}

public void removeLogImage(LogImage logImage) {
logImage.setLog(null);
this.logImages.remove(logImage);
}

public boolean isSameEvent(Log other) {
return isTimeOverlap(other) && isLocationOverlap(other);
return isTimeOverlap(other);
// return isTimeOverlap(other) && isLocationOverlap(other);
}

private boolean isTimeOverlap(Log other) {
Expand Down

0 comments on commit e8fe352

Please sign in to comment.