Merge branch 'tibor' into 'master'

API 1.0.27 TreeParents.sort, Tracking.event_value is TEXT

See merge request bossanyit/aitrainer_server!42
This commit is contained in:
Bossányi Tibor 2021-03-07 11:56:25 +00:00
commit 4bb4ab50aa
8 changed files with 41 additions and 33 deletions

View File

@ -11,7 +11,7 @@ plugins {
} }
group = "com.aitrainer" group = "com.aitrainer"
version = "1.0.26" version = "1.0.27"
java.sourceCompatibility = JavaVersion.VERSION_1_8 java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories { repositories {

View File

@ -610,32 +610,35 @@ REPLACE INTO `exercise_tree` (`tree_id`, `name`, `image_url`, `active`) VALUES
(18, 'Thigh', 'images/2.1.4.squats.png', 1), (18, 'Thigh', 'images/2.1.4.squats.png', 1),
(19, 'Calf', 'images/2.1.4.squats.png', 1), (19, 'Calf', 'images/2.1.4.squats.png', 1),
(20, 'Back', 'images/2.2.1.5.shoulders.png', 1); (20, 'Back', 'images/2.2.1.5.shoulders.png', 1);
(21, 'Test Center', 'images/2.2.1.5.shoulders.png', 1);
CREATE TABLE IF NOT EXISTS `exercise_tree_parents` ( CREATE TABLE IF NOT EXISTS `exercise_tree_parents` (
`exercise_tree_parents_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `exercise_tree_parents_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`exercise_tree_parent_id` int(11) NOT NULL DEFAULT 0, `exercise_tree_parent_id` int(11) NOT NULL DEFAULT 0,
`exercise_tree_child_id` int(11) NOT NULL DEFAULT 0, `exercise_tree_child_id` int(11) NOT NULL DEFAULT 0,
`sort` INT(3) NULL DEFAULT '0',
PRIMARY KEY (`exercise_tree_parents_id`) USING BTREE PRIMARY KEY (`exercise_tree_parents_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (15, 0, 3); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (15, 0, 3, 3);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (16, 0, 4); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (16, 0, 4, 2);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (17, 0, 5); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (17, 0, 5, 4);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (18, 2, 6); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (18, 2, 6, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (19, 3, 7); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (20, 3, 8, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (20, 3, 8); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (19, 3, 7, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (21, 4, 9); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (21, 4, 9, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (22, 4, 10); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (22, 4, 10, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (23, 5, 11); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (32, 9, 20, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (24, 5, 12); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (31, 9, 19, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (25, 5, 13); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (30, 9, 18, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (26, 9, 14); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (29, 9, 17, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (27, 9, 15); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (28, 9, 16, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (28, 9, 16); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (27, 9, 15, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (29, 9, 17); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (26, 9, 14, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (30, 9, 18); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (46, 10, 20, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (31, 9, 19); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (47, 10, 15, 0);
REPLACE INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`) VALUES (32, 9, 20); INSERT INTO `exercise_tree_parents` (`exercise_tree_parents_id`, `exercise_tree_parent_id`, `exercise_tree_child_id`, `sort`) VALUES (49, 0, 21, 1);
-- Struktúra mentése tábla aitrainer2. exercise_tree_translation -- Struktúra mentése tábla aitrainer2. exercise_tree_translation
@ -928,7 +931,7 @@ CREATE TABLE `tracking` (
`customer_id` INT(20) NOT NULL DEFAULT '0', `customer_id` INT(20) NOT NULL DEFAULT '0',
`date_add` DATETIME NOT NULL, `date_add` DATETIME NOT NULL,
`event` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci', `event` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
`event_value` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci', `event_value` TEXT NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
`area` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci', `area` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
`platform` CHAR(20) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci', `platform` CHAR(20) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
`version` CHAR(20) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci', `version` CHAR(20) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',

12
data/db/update_1_0_27.sql Normal file
View File

@ -0,0 +1,12 @@
START TRANSACTION;
ALTER TABLE `tracking`
CHANGE COLUMN `event_value` `event_value` TEXT NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci' AFTER `event`;
ALTER TABLE `exercise_tree_parents`
ADD COLUMN `sort` INT(3) NULL DEFAULT '0' AFTER `exercise_tree_child_id`;
UPDATE configuration set config_value = "1.0.27", date_change=CURRENT_DATE WHERE config_key = "db_version";
COMMIT;

View File

@ -21,15 +21,6 @@ class ControllerAspect {
@Autowired @Autowired
private lateinit var properties: ApplicationProperties private lateinit var properties: ApplicationProperties
/* @Suppress("unused")
@Pointcut("execution(* com.aitrainer.api.controller.*.*())")
fun controllerAspect() {
}
@Before("controllerAspect()")
fun loggingAop() {
Singleton.checkDBUpdate(configurationRepository, properties)
}*/
@Before("execution(* com.aitrainer.api.controller.CustomerController.*(..))") @Before("execution(* com.aitrainer.api.controller.CustomerController.*(..))")
fun customerControllerAspect(joinPoint: JoinPoint) { fun customerControllerAspect(joinPoint: JoinPoint) {

View File

@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull
data class ExerciseTreeParents ( data class ExerciseTreeParents (
@Expose @Id @GeneratedValue(strategy = GenerationType.IDENTITY) var exerciseTreeParentsId: Long = 0, @Expose @Id @GeneratedValue(strategy = GenerationType.IDENTITY) var exerciseTreeParentsId: Long = 0,
@Expose @get: NotNull var exerciseTreeParentId: Long?, @Expose @get: NotNull var exerciseTreeParentId: Long?,
@Expose @get: NotNull var exerciseTreeChildId: Long? @Expose @get: NotNull var exerciseTreeChildId: Long?,
@Expose @get: NotNull var sort: Int = 0
) )

View File

@ -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.26 application.version=1.0.27
jwt.secret=aitrainer jwt.secret=aitrainer

View File

@ -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.26 application.version=1.0.27
jwt.secret=aitrainer jwt.secret=aitrainer

View File

@ -35,9 +35,10 @@ class ExerciseTreeParentsTest {
assertTrue(responseEntity.body!!.isNotEmpty()) assertTrue(responseEntity.body!!.isNotEmpty())
val exerciseTreeParentList = responseEntity.body!! val exerciseTreeParentList = responseEntity.body!!
assertEquals(exerciseTreeParentList.size, 17) assertEquals(exerciseTreeParentList.size, 18)
assertEquals(exerciseTreeParentList[4].exerciseTreeParentId, 3) assertEquals(exerciseTreeParentList[4].exerciseTreeParentId, 3)
assertEquals(exerciseTreeParentList[4].exerciseTreeChildId, 7) assertEquals(exerciseTreeParentList[4].exerciseTreeChildId, 7)
assertEquals(exerciseTreeParentList[0].sort, 3)
} }
} }