ExerciseTreeTranslation fix
This commit is contained in:
parent
af32c32a70
commit
cec8f5a4a4
@ -15,7 +15,7 @@ class ExerciseTreeController (private val exerciseTreeRepository: ExerciseTreeRe
|
||||
@GetMapping("/exercise_tree")
|
||||
fun getAllActiveMenu(): List<ExerciseTree> {
|
||||
val list: List<ExerciseTree> = exerciseTreeRepository.getActiveMenu()
|
||||
logger.info(" -- Get All active Exercise Tree menu..")
|
||||
logger.info(" -- Get All active Exercise Tree menu.. $list")
|
||||
return list
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.aitrainer.api.controller
|
||||
|
||||
import com.aitrainer.api.ApiApplication
|
||||
import com.aitrainer.api.repository.ConfigurationRepository
|
||||
import org.aspectj.lang.annotation.Aspect
|
||||
import org.aspectj.lang.annotation.Before
|
||||
import org.aspectj.lang.annotation.Pointcut
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Suppress("unused")
|
||||
@Aspect
|
||||
@Component
|
||||
class ExerciseTreeControllerAspect {
|
||||
private val logger = LoggerFactory.getLogger(ApiApplication::class.simpleName)
|
||||
|
||||
@Autowired
|
||||
private lateinit var configurationRepository: ConfigurationRepository
|
||||
@Autowired
|
||||
private lateinit var properties: ApplicationProperties
|
||||
|
||||
@Suppress("unused")
|
||||
@Pointcut("execution(* com.aitrainer.api.controller.ExerciseTreeController.*())")
|
||||
fun exerciseTreeControllerAspect() {
|
||||
}
|
||||
|
||||
@Before("exerciseTreeControllerAspect()")
|
||||
fun loggingAop() {
|
||||
Singleton.checkDBUpdate(configurationRepository, properties)
|
||||
}
|
||||
|
||||
}
|
@ -10,10 +10,12 @@ data class ExerciseTreeTranslation (
|
||||
val translationId: Long = 0,
|
||||
|
||||
@get: NotBlank var languageCode: String?,
|
||||
@get: NotBlank var name: String = "",
|
||||
@get: NotBlank var name: String = ""
|
||||
|
||||
|
||||
) {
|
||||
@ManyToOne(fetch = FetchType.EAGER, optional = false)
|
||||
@JoinColumn(name = "treeId", nullable = false)
|
||||
val exerciseTree: ExerciseTree? = null
|
||||
|
||||
)
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ class ExerciseTreeTest {
|
||||
fun testActiveExercises() {
|
||||
val exerciseTreeController = ExerciseTreeController(exerciseTreeRepository)
|
||||
val exerciseTree = exerciseTreeController.getAllActiveMenu()
|
||||
logger.info("Tree $exerciseTree")
|
||||
|
||||
val exerciseTreeItem = exerciseTree[0]
|
||||
assertEquals(exerciseTreeItem.name, "Cardio")
|
||||
|
Loading…
Reference in New Issue
Block a user