Merge branch 'tibor' into 'master'
API 1.0.33 tutorials condition, parent step See merge request bossanyit/aitrainer_server!51
This commit is contained in:
commit
e337470411
@ -11,7 +11,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.aitrainer"
|
group = "com.aitrainer"
|
||||||
version = "1.0.32"
|
version = "1.0.33"
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -1396,8 +1396,11 @@ CREATE TABLE `tutorial_steps` (
|
|||||||
`tutorial_text` TEXT NOT NULL COLLATE 'utf8_hungarian_ci',
|
`tutorial_text` TEXT NOT NULL COLLATE 'utf8_hungarian_ci',
|
||||||
`error_text` TEXT NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
|
`error_text` TEXT NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
|
||||||
`check_text` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
|
`check_text` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
|
||||||
|
`condition` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
|
||||||
|
`parent` INT(3) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`tutorial_step_id`) USING BTREE,
|
PRIMARY KEY (`tutorial_step_id`) USING BTREE,
|
||||||
INDEX `tutorial_id` (`tutorial_id`) USING BTREE
|
INDEX `tutorial_id` (`tutorial_id`) USING BTREE,
|
||||||
|
INDEX `parent` (`parent`) USING BTREE
|
||||||
)
|
)
|
||||||
COLLATE='utf8_hungarian_ci'
|
COLLATE='utf8_hungarian_ci'
|
||||||
ENGINE=InnoDB
|
ENGINE=InnoDB
|
||||||
|
14
data/db/update_1_0_33.sql
Normal file
14
data/db/update_1_0_33.sql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `tutorial_steps`
|
||||||
|
ADD COLUMN `condition` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci' AFTER `check_text`;
|
||||||
|
|
||||||
|
ALTER TABLE `tutorial_steps`
|
||||||
|
ADD COLUMN `parent` INT(3) NOT NULL DEFAULT '0' AFTER `condition`;
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE configuration set config_value = "1.0.33", date_change=CURRENT_DATE WHERE config_key = "db_version";
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
@ -15,6 +15,8 @@ data class TutorialSteps (
|
|||||||
@Expose @get: NotBlank var step: Int = 0,
|
@Expose @get: NotBlank var step: Int = 0,
|
||||||
@Expose var errorText: String? = null,
|
@Expose var errorText: String? = null,
|
||||||
@Expose var checkText: String? = null,
|
@Expose var checkText: String? = null,
|
||||||
|
@Expose var condition: String? = null,
|
||||||
|
@Expose @get: NotBlank var parent: Int = 0,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||||
|
@ -17,6 +17,6 @@ logging.config=classpath:logback-spring.xml
|
|||||||
logging.file=logs
|
logging.file=logs
|
||||||
|
|
||||||
# if the database structure has been changed, increment this version number
|
# if the database structure has been changed, increment this version number
|
||||||
application.version=1.0.32
|
application.version=1.0.33
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
@ -17,6 +17,6 @@ logging.config=classpath:logback-spring.xml
|
|||||||
logging.file=logs
|
logging.file=logs
|
||||||
|
|
||||||
# if the database structure has been changed, increment this version number
|
# if the database structure has been changed, increment this version number
|
||||||
application.version=1.0.32
|
application.version=1.0.33
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
@ -135,7 +135,9 @@ class AppPackageTest {
|
|||||||
val tutorials: List<Tutorial> = gson.fromJson(tutorialJson, type)
|
val tutorials: List<Tutorial> = gson.fromJson(tutorialJson, type)
|
||||||
assertEquals(tutorials.size, 1)
|
assertEquals(tutorials.size, 1)
|
||||||
assertEquals(tutorials[0].name, "Basic")
|
assertEquals(tutorials[0].name, "Basic")
|
||||||
assertEquals(tutorials[0].steps.size, 2)
|
assertEquals(tutorials[0].steps.size, 4)
|
||||||
|
assertEquals(tutorials[0].steps[3].parent, 2)
|
||||||
|
assertEquals(tutorials[0].steps[3].condition, "Check2")
|
||||||
assertEquals(tutorials[0].steps[0].translations.size, 2)
|
assertEquals(tutorials[0].steps[0].translations.size, 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user