Skip to content

Commit

Permalink
refactor: apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
BomLee427 committed Nov 5, 2024
1 parent 3b9e38d commit eef5f01
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 97 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/compono/ibackend/constants/GoingStatus.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.compono.ibackend.constants;

public enum GoingStatus {
ON_GOING,
DONE,
PAUSE,
ON_GOING,
DONE,
PAUSE,
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.compono.ibackend.constants;

public enum ScheduleStatus {
CONFIRMED,
TENTATIVE,
CANCELLED,
CONFIRMED,
TENTATIVE,
CANCELLED,
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
import org.springframework.stereotype.Repository;

@Repository
public interface LocationRepository extends JpaRepository<Location, Long> {

}
public interface LocationRepository extends JpaRepository<Location, Long> {}
75 changes: 38 additions & 37 deletions src/main/java/com/compono/ibackend/schedule/domain/Schedule.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.compono.ibackend.schedule.domain;


import com.compono.ibackend.constants.GoingStatus;
import com.compono.ibackend.constants.ScheduleStatus;
import com.compono.ibackend.location.domain.Location;
Expand Down Expand Up @@ -30,50 +29,52 @@
@Entity
public class Schedule {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Enumerated(EnumType.STRING)
@Column(name = "status")
private ScheduleStatus status;

@Enumerated(value = EnumType.STRING)
@Column(name = "going_status")
private GoingStatus goingStatus;

@Column(name = "summary")
private String summary;

@Enumerated(EnumType.STRING)
@Column(name = "status")
private ScheduleStatus status;
@Column(name = "description")
private String description;

@Enumerated(value = EnumType.STRING)
@Column(name = "going_status")
private GoingStatus goingStatus;
@Column(name = "start_date_time")
private LocalDateTime startDateTime;

@Column(name = "summary")
private String summary;
@Column(name = "description")
private String description;
@Column(name = "end_date_time")
private LocalDateTime endDateTime;

@Column(name = "start_date_time")
private LocalDateTime startDateTime;
@Column(name = "end_date_time")
private LocalDateTime endDateTime;
@Column(name = "create_date_time", updatable = false)
private LocalDateTime createDateTime;

@Column(name = "create_date_time", updatable = false)
private LocalDateTime createDateTime;
@Column(name = "update_date_time")
private LocalDateTime updateDateTime;
@Column(name = "update_date_time")
private LocalDateTime updateDateTime;

@Column(name = "recurrence")
private String recurrence;
@Column(name = "recurrence")
private String recurrence;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "location_id")
private Location location;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "location_id")
private Location location;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "tag_id")
private Tag tag;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "tag_id")
private Tag tag;

@OneToMany
private List<ScheduleTime> scheduleTime;
@OneToMany private List<ScheduleTime> scheduleTime;

private boolean displayCalendar;
private LocalDateTime totalTime;
private boolean displayCalendar;
private LocalDateTime totalTime;

private Integer priority;
}
private Integer priority;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.compono.ibackend.schedule.dto.response;


import com.compono.ibackend.location.domain.Location;

public record ScheduleDetailPointResponse(Double longitude, Double latitude) {

public static ScheduleDetailPointResponse from(Location point) {
return new ScheduleDetailPointResponse(point.getLongitude(), point.getLatitude());
}
public static ScheduleDetailPointResponse from(Location point) {
return new ScheduleDetailPointResponse(point.getLongitude(), point.getLatitude());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
import org.springframework.stereotype.Repository;

@Repository
public interface ScheduleTimeRepository extends JpaRepository<ScheduleTime, Long> {

}
public interface ScheduleTimeRepository extends JpaRepository<ScheduleTime, Long> {}
21 changes: 11 additions & 10 deletions src/main/java/com/compono/ibackend/tag/domain/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
@Entity
public class Tag {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Column(name = "name")
private String name;
@Column(name = "color")
private String color;
@Column(name = "name")
private String name;

@OneToMany(mappedBy = "tag")
private List<Schedule> schedules;
@Column(name = "color")
private String color;

@OneToMany(mappedBy = "tag")
private List<Schedule> schedules;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
import org.springframework.stereotype.Repository;

@Repository
public interface TagRepository extends JpaRepository<Tag, Long> {

}
public interface TagRepository extends JpaRepository<Tag, Long> {}
33 changes: 16 additions & 17 deletions src/main/java/com/compono/ibackend/timeline/domain/Timeline.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.compono.ibackend.timeline.domain;


import com.compono.ibackend.constants.GoingStatus;
import com.compono.ibackend.location.domain.Location;
import jakarta.persistence.Column;
Expand All @@ -24,25 +23,25 @@
@Getter
public class Timeline {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Column(name = "start_time")
private LocalDateTime startTime;
@Column(name = "end_time")
private LocalDateTime endTime;
@Column(name = "start_time")
private LocalDateTime startTime;

@Column(name = "summary")
private String summary;
@Column(name = "end_time")
private LocalDateTime endTime;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "location_id")
private Location location;
@Column(name = "summary")
private String summary;

@Enumerated(value = EnumType.STRING)
@Column(name = "going_status")
private GoingStatus goingStatus;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "location_id")
private Location location;

@Enumerated(value = EnumType.STRING)
@Column(name = "going_status")
private GoingStatus goingStatus;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
import org.springframework.stereotype.Repository;

@Repository
public interface TimelineRepository extends JpaRepository<Timeline, Long> {

}
public interface TimelineRepository extends JpaRepository<Timeline, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public ScheduleTime buildScheduleTime(ScheduleTime scheduleTime) {
return builderSupporter.scheduleTimeRepository().save(scheduleTime);
}


public User buildUser(User user) {
return builderSupporter.userRepository().save(user);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ public class ScheduleFixtures {
LocalDateTime.of(2024, 04, 17, 13, 00);
public static final LocalDateTime TODAY_PLUS_1_DATE = LocalDateTime.now().plusDays(1);
public static final LocalDateTime TODAY_MINUS_1_DATE = LocalDateTime.now().minusDays(1);


}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
package com.compono.ibackend.factory;

public class ScheduleFactory {


}
public class ScheduleFactory {}
5 changes: 1 addition & 4 deletions src/test/java/com/compono/ibackend/factory/TagFactory.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
package com.compono.ibackend.factory;


public class TagFactory {

}
public class TagFactory {}

0 comments on commit eef5f01

Please sign in to comment.