Implement begining of migration
Move Function/Query definition
This commit is contained in:
34
src/main/kotlin/fr/postgresjson/definition/Parameter.kt
Normal file
34
src/main/kotlin/fr/postgresjson/definition/Parameter.kt
Normal file
@@ -0,0 +1,34 @@
|
||||
package fr.postgresjson.definition
|
||||
|
||||
interface ParameterI {
|
||||
val name: String
|
||||
val type: String
|
||||
val direction: Parameter.Direction
|
||||
val default: String
|
||||
}
|
||||
|
||||
class Parameter(val name: String, val type: String, direction: Direction? = Direction.IN, val default: Any? = null)
|
||||
{
|
||||
val direction: Direction
|
||||
|
||||
init {
|
||||
if (direction === null) {
|
||||
this.direction = Direction.IN
|
||||
} else {
|
||||
this.direction = direction
|
||||
}
|
||||
}
|
||||
|
||||
constructor(name: String, type: String, direction: String? = "IN", default: Any? = null) : this(
|
||||
name = name,
|
||||
type = type,
|
||||
direction = direction?.let { Direction.valueOf(direction.toUpperCase())},
|
||||
default = default
|
||||
)
|
||||
|
||||
enum class Direction { IN, OUT, INOUT }
|
||||
}
|
||||
|
||||
interface ParametersInterface {
|
||||
val parameters: List<Parameter>
|
||||
}
|
||||
Reference in New Issue
Block a user