mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-26 12:33:13 -05:00
Improve imports
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
632eb49fd3
commit
5e15ca6c35
@ -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) {
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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", "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user