mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-28 16:22:12 -07:00
Ensure backup compatibility with older versions
This commit is contained in:
parent
289e25949f
commit
3f7d590ded
@ -23,7 +23,9 @@ import androidx.room.ColumnInfo;
|
|||||||
import androidx.room.Entity;
|
import androidx.room.Entity;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -65,6 +67,7 @@ public class Workout{
|
|||||||
public double avgPace;
|
public double avgPace;
|
||||||
|
|
||||||
@ColumnInfo(name = "workoutType")
|
@ColumnInfo(name = "workoutType")
|
||||||
|
@JsonProperty(value = "workoutType")
|
||||||
public String workoutTypeId;
|
public String workoutTypeId;
|
||||||
|
|
||||||
public float ascent;
|
public float ascent;
|
||||||
@ -83,14 +86,17 @@ public class Workout{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
public String getDateString(){
|
public String getDateString(){
|
||||||
return SimpleDateFormat.getDateTimeInstance().format(new Date(start));
|
return SimpleDateFormat.getDateTimeInstance().format(new Date(start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
public WorkoutType getWorkoutType() {
|
public WorkoutType getWorkoutType() {
|
||||||
return WorkoutType.getTypeById(workoutTypeId);
|
return WorkoutType.getTypeById(workoutTypeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
public void setWorkoutType(WorkoutType workoutType) {
|
public void setWorkoutType(WorkoutType workoutType) {
|
||||||
this.workoutTypeId = workoutType.id;
|
this.workoutTypeId = workoutType.id;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user