Merge branch 'tibor' into 'master'
API 1.0.39 internal_name in exercise_tree, training_plan See merge request bossanyit/aitrainer_server!60
This commit is contained in:
commit
2e0e775b0b
@ -11,7 +11,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.aitrainer"
|
||||
version = "1.0.38"
|
||||
version = "1.0.39"
|
||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
repositories {
|
||||
|
17
data/db/update_1_0_39.sql
Normal file
17
data/db/update_1_0_39.sql
Normal file
@ -0,0 +1,17 @@
|
||||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `exercise_tree`
|
||||
ADD COLUMN `internal_name` CHAR(50) NULL DEFAULT NULL AFTER `active`;
|
||||
ALTER TABLE `exercise_tree`
|
||||
ADD INDEX `internal_name` (`internal_name`);
|
||||
|
||||
ALTER TABLE `training_plan`
|
||||
ADD COLUMN `internal_name` CHAR(50) NULL DEFAULT NULL AFTER `type`;
|
||||
ALTER TABLE `training_plan`
|
||||
ADD COLUMN `free` TINYINT(1) NULL DEFAULT 0 AFTER `internal_name`;
|
||||
ALTER TABLE `training_plan`
|
||||
ADD INDEX `internal_name` (`internal_name`);
|
||||
|
||||
UPDATE configuration set config_value = "1.0.39", date_change=CURRENT_DATE WHERE config_key = "db_version";
|
||||
|
||||
COMMIT;
|
@ -14,7 +14,8 @@ data class ExerciseTree (
|
||||
@Expose @get: NotBlank var name: String = "",
|
||||
@Expose @get: NotBlank var description: String = "",
|
||||
@Expose @get: NotBlank var imageUrl: String = "",
|
||||
@Expose @get: NonNull var active: Boolean?
|
||||
@Expose @get: NonNull var active: Boolean?,
|
||||
@Expose var internalName: String?,
|
||||
|
||||
) {
|
||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseTree")
|
||||
|
@ -13,6 +13,8 @@ data class TrainingPlan (
|
||||
@Expose @get: NotBlank var name: String = "",
|
||||
@Expose var description: String?,
|
||||
@Expose @get: NotBlank var type: String = "",
|
||||
@Expose var internalName: String?,
|
||||
@Expose var free: Boolean?,
|
||||
) {
|
||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "trainingPlan")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
|
@ -17,6 +17,6 @@ logging.config=classpath:logback-spring.xml
|
||||
logging.file=logs
|
||||
|
||||
# if the database structure has been changed, increment this version number
|
||||
application.version=1.0.38
|
||||
application.version=1.0.39
|
||||
|
||||
jwt.secret=aitrainer
|
@ -17,7 +17,7 @@ logging.config=classpath:logback-spring.xml
|
||||
logging.file=logs
|
||||
|
||||
# if the database structure has been changed, increment this version number
|
||||
application.version=1.0.38
|
||||
application.version=1.0.39
|
||||
|
||||
jwt.secret=aitrainer
|
||||
jasypt.encryptor.password=Tibor
|
||||
|
@ -91,6 +91,7 @@ class AppPackageTest {
|
||||
val listExerciseTree: List<ExerciseTree> = gson.fromJson(exerciseTreeJson, type)
|
||||
assertTrue(listExerciseTree.isNotEmpty())
|
||||
assertEquals(listExerciseTree[1].name, "Strength")
|
||||
assertEquals(listExerciseTree[6].internalName, "one_rep_max")
|
||||
assertEquals(listExerciseTree[1].translations[0].name, "Erő!")
|
||||
} else if (record[0] == Property::class.simpleName) {
|
||||
val propertyJson: String = record[1]
|
||||
@ -170,6 +171,8 @@ class AppPackageTest {
|
||||
val plans: List<TrainingPlan> = gson.fromJson(trainingPlanJson, type)
|
||||
assertEquals(plans.size,2)
|
||||
assertEquals(plans[1].name, "Biceps")
|
||||
assertEquals(plans[1].internalName, "biceps_beginner")
|
||||
assertEquals(plans[1].free, true)
|
||||
assertEquals(plans[0].details[0].exerciseTypeId, 63)
|
||||
assertEquals(plans[0].details[1].weight, -1.0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user