Skip to content

Commit

Permalink
feat: #81 #102 Move NonStandardDictionaryType to kg-common and co…
Browse files Browse the repository at this point in the history
…nvert it to Kotlin.
  • Loading branch information
dmitry-weirdo committed Nov 25, 2024
1 parent 607cd33 commit 8239c58
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enum class DictionaryMode(
/**
* Имя в API клавогонок. Все буквы в нижнем регистре.
*/
@JvmField val klavogonkiName: String,
@JvmField val klavogonkiName: String
) {
normal("normal"),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package ru.klavogonki.common

/**
* Тип нестандартного словаря.
*/
enum class NonStandardDictionaryType(
/**
* Имя в API клавогонок. Все буквы в нижнем регистре.
*/
@JvmField val klavogonkiName: String
) {
/**
* Слова.
*/
words("words"),

/**
* Фразы.
*/
phrases("phrases"),

/**
* Тексты.
*/
texts("texts"),

/**
* URL.
*/
url("url"),

/**
* Книга.
*/
book("book"),

/**
* Генератор.
*/
generator("generator"),
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lombok.Data;
import ru.klavogonki.common.DictionaryMode;
import ru.klavogonki.kgparser.NonStandardDictionaryType;
import ru.klavogonki.common.NonStandardDictionaryType;

import javax.persistence.Entity;
import javax.persistence.EnumType;
Expand Down Expand Up @@ -49,7 +49,7 @@ public class PlayerVocabularyStatsEntity implements Serializable {

private String vocabularyName;

@Enumerated(EnumType.STRING)
@Enumerated(EnumType.STRING) // todo: save using the klavogonikiName field, NOT the enum itself (to save compatibility with the old databases)
private NonStandardDictionaryType vocabularyType;

private Integer vocabularySymbols; // for non-standard dictionaries only
Expand All @@ -67,7 +67,7 @@ public class PlayerVocabularyStatsEntity implements Serializable {
*
* @see DictionaryMode#getDictionaryMode
*/
@Enumerated(EnumType.STRING) // todo: save using the klavogonikiName field, NOT the enum itself
@Enumerated(EnumType.STRING) // todo: save using the klavogonikiName field, NOT the enum itself (to save compatibility with the old databases)
private DictionaryMode vocabularyMode;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mapstruct.ValueMapping;
import org.mapstruct.ValueMappings;
import ru.klavogonki.common.DictionaryMode;
import ru.klavogonki.kgparser.NonStandardDictionaryType;
import ru.klavogonki.common.NonStandardDictionaryType;
import ru.klavogonki.openapi.model.GetStatsOverviewGameType;
import ru.klavogonki.openapi.model.GetStatsOverviewResponse;
import ru.klavogonki.openapi.model.NonStandardVocabularyType;
Expand Down

0 comments on commit 8239c58

Please sign in to comment.