mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-18 14:47:15 +00:00
fixes in types generation
This commit is contained in:
parent
83fe621c56
commit
c6785f1a4f
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## 0.19.5
|
## 0.19.5
|
||||||
|
|
||||||
|
* `Repos`:
|
||||||
|
* `Generator`:
|
||||||
|
* Fixes in new type generation
|
||||||
|
|
||||||
## 0.19.4
|
## 0.19.4
|
||||||
|
|
||||||
* `Versions`:
|
* `Versions`:
|
||||||
|
@ -100,7 +100,11 @@ class Processor(
|
|||||||
primaryConstructor(
|
primaryConstructor(
|
||||||
FunSpec.constructorBuilder().apply {
|
FunSpec.constructorBuilder().apply {
|
||||||
ksClassProperties.forEach {
|
ksClassProperties.forEach {
|
||||||
addParameter(it.simpleName.getShortName(), it.typeName)
|
addParameter(
|
||||||
|
ParameterSpec.builder(it.simpleName.getShortName(), it.typeName).apply {
|
||||||
|
annotations += it.annotations.map { it.toAnnotationSpec() }
|
||||||
|
}.build()
|
||||||
|
)
|
||||||
typeBuilder.addProperty(
|
typeBuilder.addProperty(
|
||||||
PropertySpec.builder(it.simpleName.getShortName(), it.typeName, KModifier.OVERRIDE).apply {
|
PropertySpec.builder(it.simpleName.getShortName(), it.typeName, KModifier.OVERRIDE).apply {
|
||||||
initializer(it.simpleName.getShortName())
|
initializer(it.simpleName.getShortName())
|
||||||
|
@ -11,18 +11,20 @@ import kotlinx.serialization.Serializable
|
|||||||
@Serializable
|
@Serializable
|
||||||
@SerialName(value = "NewTest")
|
@SerialName(value = "NewTest")
|
||||||
public data class NewTest(
|
public data class NewTest(
|
||||||
public override val property1: String,
|
override val property1: String,
|
||||||
public override val property2: Int,
|
override val property2: Int,
|
||||||
public override val parent: ParentTypeId?,
|
@Serializable
|
||||||
|
override val parent: ParentTypeId?,
|
||||||
) : Test
|
) : Test
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@SerialName(value = "RegisteredTest")
|
@SerialName(value = "RegisteredTest")
|
||||||
public data class RegisteredTest(
|
public data class RegisteredTest(
|
||||||
public override val id: TestId,
|
override val id: TestId,
|
||||||
public override val property1: String,
|
override val property1: String,
|
||||||
public override val property2: Int,
|
override val property2: Int,
|
||||||
public override val parent: ParentTypeId?,
|
@Serializable
|
||||||
|
override val parent: ParentTypeId?,
|
||||||
) : Test, IRegisteredTest
|
) : Test, IRegisteredTest
|
||||||
|
|
||||||
public fun Test.asNew(): NewTest = NewTest(property1, property2, parent)
|
public fun Test.asNew(): NewTest = NewTest(property1, property2, parent)
|
||||||
|
@ -17,6 +17,7 @@ typealias ParentTypeId = TestId
|
|||||||
sealed interface Test {
|
sealed interface Test {
|
||||||
val property1: String
|
val property1: String
|
||||||
val property2: Int
|
val property2: Int
|
||||||
|
@Serializable
|
||||||
val parent: ParentTypeId?
|
val parent: ParentTypeId?
|
||||||
|
|
||||||
@GenerateCRUDModelExcludeOverride
|
@GenerateCRUDModelExcludeOverride
|
||||||
|
Loading…
Reference in New Issue
Block a user