Improve imports

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
Rahul Rudragoudar 2021-12-26 22:01:18 +05:30
parent 632eb49fd3
commit 5e15ca6c35
3 changed files with 7 additions and 10 deletions

View File

@ -1,13 +1,10 @@
package lc.core
import java.sql.ResultSet
import java.util.UUID
import java.io.ByteArrayInputStream
import lc.captchas.interfaces.{Challenge, ChallengeProvider}
import lc.database.Statements
import lc.core.CaptchaProviders
import lc.captchas.interfaces.ChallengeProvider
import lc.captchas.interfaces.Challenge
import java.sql.Blob
import java.io.ByteArrayInputStream
import java.sql.{Blob, ResultSet}
import java.util.UUID
class Captcha(config: Config, captchaProviders: CaptchaProviders) {

View File

@ -1,6 +1,6 @@
package lc.core
import lc.captchas._
import lc.captchas.*
import lc.captchas.interfaces.ChallengeProvider
import lc.captchas.interfaces.Challenge
import scala.collection.mutable.Map
@ -50,7 +50,7 @@ class CaptchaProviders(config: Config) {
def getProvider(param: Parameters): Option[ChallengeProvider] = {
val providerConfig = filterProviderByParam(param).toList
if (providerConfig.length > 0) {
if (providerConfig.nonEmpty) {
val randomIndex = HelperFunctions.randomNumber(providerConfig.length)
val providerIndex = providerConfig(randomIndex)._1
val selectedProvider = providers(providerIndex)

View File

@ -1,6 +1,6 @@
package lc.database
import java.sql._
import java.sql.{Connection, DriverManager, Statement}
class DBConn() {
val con: Connection = DriverManager.getConnection("jdbc:h2:./data/H2/captcha2", "sa", "")