✨ Create JWT Usertoken when use register, and starting bet action
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
2f4d5143f2
commit
3bce3356e7
@ -1,11 +1,19 @@
|
||||
package allin.model
|
||||
|
||||
import allin.dto.UserDTOWithToken
|
||||
import allin.serializer.DateSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.util.*
|
||||
|
||||
@Serializable
|
||||
data class Bet(val id: Int, val theme: String, val sentenceBet: String, @Serializable(DateSerializer::class) val endRegistration: Date, @Serializable(DateSerializer::class) var endBet : Date, var isPrivate : Boolean, var response : MutableList<String>)
|
||||
data class Bet(val id: Int, val theme: String, val sentenceBet: String, @Serializable(DateSerializer::class) val endRegistration: Date, @Serializable(DateSerializer::class) var endBet : Date, var isPrivate : Boolean, var response : MutableList<String>, val createdBy : String)
|
||||
|
||||
@Serializable
|
||||
data class UpdatedBetData(val id: Int,@Serializable(DateSerializer::class) val endBet: Date, val isPrivate: Boolean, val response: MutableList<String>)
|
||||
|
||||
@Serializable
|
||||
data class BetWithoutId(val theme: String, val sentenceBet: String, @Serializable(DateSerializer::class) val endRegistration: Date, @Serializable(DateSerializer::class) var endBet : Date, var isPrivate : Boolean, var response : MutableList<String>, val createdBy : String)
|
||||
|
||||
fun convertBetWithoutIdToBet(betWithoutId: BetWithoutId,id : Int, username : String): Bet {
|
||||
return Bet(id,betWithoutId.theme,betWithoutId.sentenceBet,betWithoutId.endRegistration, betWithoutId.endBet, betWithoutId.isPrivate, betWithoutId.response, username)
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
package allin.model
|
||||
|
||||
import allin.dto.UserDTOWithToken
|
||||
data class BetAction(val id:Int, val coins: Int, val user: String, val bet: Int)
|
||||
data class BetActionCompleted(val id:Int, val coins: Int, val user: UserDTOWithToken, val bet: Bet)
|
@ -0,0 +1,13 @@
|
||||
package allin.routing
|
||||
|
||||
import allin.model.BetAction
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.request.*
|
||||
import io.ktor.server.routing.*
|
||||
|
||||
fun Application.BetActionRouter(){
|
||||
routing {
|
||||
route("/BetAction/add"){
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package allin.utils
|
||||
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import io.ktor.server.config.HoconApplicationConfig
|
||||
|
||||
object AppConfig {
|
||||
val config: HoconApplicationConfig = HoconApplicationConfig(ConfigFactory.load())
|
||||
val tokenManager = TokenManager.getInstance(config)
|
||||
val regexChecker= RegexChecker()
|
||||
val cryptManager = CryptManager()
|
||||
}
|
Loading…
Reference in new issue