API 1.0.39 FAQ sort
This commit is contained in:
parent
7d78aa38fb
commit
af4264d018
@ -11,7 +11,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.aitrainer"
|
group = "com.aitrainer"
|
||||||
version = "1.0.37"
|
version = "1.0.38"
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
8
data/db/update_1_0_38.sql
Normal file
8
data/db/update_1_0_38.sql
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE `faq`
|
||||||
|
ADD COLUMN `sort` INT NULL AFTER `description`;
|
||||||
|
|
||||||
|
UPDATE configuration set config_value = "1.0.38", date_change=CURRENT_DATE WHERE config_key = "db_version";
|
||||||
|
|
||||||
|
COMMIT;
|
@ -10,7 +10,8 @@ import javax.persistence.*
|
|||||||
data class Faq (
|
data class Faq (
|
||||||
@Expose @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @get: NonNull var faqId: Long = 0,
|
@Expose @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @get: NonNull var faqId: Long = 0,
|
||||||
@Expose @get: NonNull var name: String,
|
@Expose @get: NonNull var name: String,
|
||||||
@Expose @get: NonNull var description: String,
|
@Expose var description: String? = null,
|
||||||
|
@Expose var sort: Int? = null,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "faq")
|
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "faq")
|
||||||
|
@ -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.37
|
application.version=1.0.38
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
@ -17,7 +17,7 @@ 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.37
|
application.version=1.0.38
|
||||||
|
|
||||||
jwt.secret=aitrainer
|
jwt.secret=aitrainer
|
||||||
jasypt.encryptor.password=Tibor
|
jasypt.encryptor.password=Tibor
|
||||||
|
@ -160,8 +160,9 @@ class AppPackageTest {
|
|||||||
val faqJson: String = record[1]
|
val faqJson: String = record[1]
|
||||||
val type = object : TypeToken<List<Faq?>?>() {}.type
|
val type = object : TypeToken<List<Faq?>?>() {}.type
|
||||||
val faqs: List<Faq> = gson.fromJson(faqJson, type)
|
val faqs: List<Faq> = gson.fromJson(faqJson, type)
|
||||||
assertEquals(faqs.size,1)
|
assertEquals(faqs.size,2)
|
||||||
assertEquals(faqs[0].name, "What is 1RM?")
|
assertEquals(faqs[0].name, "What is 1RM?")
|
||||||
|
assertEquals(faqs[0].sort, 1)
|
||||||
assertEquals(faqs[0].translations[0].languageCode, "hu")
|
assertEquals(faqs[0].translations[0].languageCode, "hu")
|
||||||
} else if (record[0] == TrainingPlan::class.simpleName) {
|
} else if (record[0] == TrainingPlan::class.simpleName) {
|
||||||
val trainingPlanJson: String = record[1]
|
val trainingPlanJson: String = record[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user