Merge branch 'tibor' into 'master'
API 1.0.34 tutorials action See merge request bossanyit/aitrainer_server!52
This commit is contained in:
commit
a913356498
@ -11,7 +11,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.aitrainer"
|
group = "com.aitrainer"
|
||||||
version = "1.0.33"
|
version = "1.0.34"
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -1398,6 +1398,7 @@ CREATE TABLE `tutorial_steps` (
|
|||||||
`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',
|
`condition` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
|
||||||
`parent` INT(3) NOT NULL DEFAULT '0',
|
`parent` INT(3) NOT NULL DEFAULT '0',
|
||||||
|
`action` TINYINT 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
|
INDEX `parent` (`parent`) USING BTREE
|
||||||
|
13
data/db/update_1_0_34.sql
Normal file
13
data/db/update_1_0_34.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE `tutorial_steps`
|
||||||
|
CHANGE COLUMN `parent` `parent_id` INT(3) NOT NULL DEFAULT '0' AFTER `condition`;
|
||||||
|
|
||||||
|
ALTER TABLE `tutorial_steps`
|
||||||
|
ADD COLUMN `action` TINYINT NULL DEFAULT '0' AFTER `parent_id`;
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE configuration set config_value = "1.0.34", date_change=CURRENT_DATE WHERE config_key = "db_version";
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
@ -16,7 +16,8 @@ data class TutorialSteps (
|
|||||||
@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 var condition: String? = null,
|
||||||
@Expose @get: NotBlank var parent: Int = 0,
|
@Expose @get: NotBlank var parent_id: Int = 0,
|
||||||
|
@Expose var action: 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.33
|
application.version=1.0.34
|
||||||
|
|
||||||
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.33
|
application.version=1.0.34
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
@ -135,9 +135,11 @@ 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, 4)
|
assertEquals(tutorials[0].steps.size, 5)
|
||||||
assertEquals(tutorials[0].steps[3].parent, 2)
|
assertEquals(tutorials[0].steps[3].parent_id, 2)
|
||||||
assertEquals(tutorials[0].steps[3].condition, "Check2")
|
assertEquals(tutorials[0].steps[3].condition, "Check2")
|
||||||
|
assertEquals(tutorials[0].steps[3].action, 0)
|
||||||
|
assertEquals(tutorials[0].steps[4].action, 1)
|
||||||
assertEquals(tutorials[0].steps[0].translations.size, 2)
|
assertEquals(tutorials[0].steps[0].translations.size, 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user