modules/user compiles
parent
f4fbcf19b6
commit
4b3d3dc1f3
|
@ -157,7 +157,7 @@ lazy val mod = module("mod", Seq(common, db, user, hub, security, tournament, si
|
|||
)
|
||||
|
||||
lazy val user = module("user", Seq(common, memo, db, hub, rating, socket)).settings(
|
||||
libraryDependencies ++= provided(play.api, hasher) ++ reactivemongo.bundle
|
||||
libraryDependencies ++= provided(play.api, play.joda, hasher) ++ reactivemongo.bundle
|
||||
)
|
||||
|
||||
lazy val game = module("game", Seq(common, memo, db, hub, user, chat)).settings(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.activity
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.common.Iso
|
||||
import lila.db.BSON.{ MapDocument, MapValue }
|
||||
|
|
|
@ -48,7 +48,7 @@ case class Analysis(
|
|||
object Analysis {
|
||||
|
||||
import lila.db.BSON
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
case class Analyzed(game: lila.game.Game, analysis: Analysis)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import chess.format.FEN
|
|||
import org.joda.time.DateTime
|
||||
import play.api.libs.json._
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import lila.analyse.{ JsonView => analysisJson, AnalysisRepo, Analysis }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.bookmark
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.game.{ Game, GameRepo }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.challenge
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import chess.Mode
|
||||
import chess.variant.Variant
|
||||
|
|
|
@ -112,7 +112,7 @@ object Chat {
|
|||
}
|
||||
|
||||
import BSONFields._
|
||||
import reactivemongo.bson.BSONDocument
|
||||
import reactivemongo.api.bson.BSONDocument
|
||||
import Line.{ lineBSONHandler, userLineBSONHandler }
|
||||
|
||||
implicit val chatIdIso = lila.common.Iso.string[Id](Id.apply, _.value)
|
||||
|
|
|
@ -4,7 +4,7 @@ import lila.db.dsl._
|
|||
import lila.user.User
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
final class ChatTimeout(
|
||||
|
|
|
@ -42,7 +42,7 @@ object Line {
|
|||
val textMaxSize = 140
|
||||
val titleSep = '~'
|
||||
|
||||
import reactivemongo.bson.{ BSONHandler, BSONString }
|
||||
import reactivemongo.api.bson.{ BSONHandler, BSONString }
|
||||
|
||||
private val invalidLine = UserLine("", None, "[invalid character]", troll = false, deleted = true)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.coach
|
||||
|
||||
import lila.db.dsl._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private[coach] object BsonHandlers {
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package lila.common
|
||||
|
||||
import play.api.ConfigLoader
|
||||
|
||||
object config {
|
||||
|
||||
implicit val maxPerPageLoader: ConfigLoader[MaxPerPage] =
|
||||
ConfigLoader(_.getInt).map(MaxPerPage.apply)
|
||||
|
||||
implicit val collNameLoader: ConfigLoader[CollName] =
|
||||
ConfigLoader(_.getString).map(CollName.apply)
|
||||
|
||||
implicit val SecretLoader: ConfigLoader[Secret] =
|
||||
ConfigLoader(_.getString).map(Secret.apply)
|
||||
}
|
|
@ -28,6 +28,12 @@ case class MaxPerSecond(value: Int) extends AnyVal with IntValue
|
|||
|
||||
case class IpAddress(value: String) extends AnyVal with StringValue
|
||||
|
||||
case class CollName(value: String) extends AnyVal with StringValue
|
||||
|
||||
case class Secret(value: String) extends AnyVal {
|
||||
override def toString = "Secret(****)"
|
||||
}
|
||||
|
||||
object IpAddress {
|
||||
// http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address
|
||||
private val ipv4Regex = """^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$""".r
|
||||
|
|
|
@ -3,7 +3,9 @@ package lila.db
|
|||
import org.joda.time.DateTime
|
||||
import ornicar.scalalib.Zero
|
||||
import reactivemongo.api.bson._
|
||||
import reactivemongo.api.bson.exceptions.TypeDoesNotMatchException
|
||||
import reactivemongo.api.bson.compat._
|
||||
import scala.util.{ Try, Success, Failure }
|
||||
|
||||
import dsl._
|
||||
import lila.common.Iso
|
||||
|
@ -18,7 +20,9 @@ abstract class BSON[T]
|
|||
|
||||
def writes(writer: Writer, obj: T): Bdoc
|
||||
|
||||
def write(obj: T): Bdoc = writes(writer, obj)
|
||||
def writeTry(obj: T) = Success(writes(writer, obj))
|
||||
|
||||
def write(obj: T) = writes(writer, obj)
|
||||
}
|
||||
|
||||
abstract class BSONReadOnly[T] extends BSONDocumentReader[T] {
|
||||
|
@ -29,14 +33,11 @@ abstract class BSONReadOnly[T] extends BSONDocumentReader[T] {
|
|||
|
||||
def reads(reader: Reader): T
|
||||
|
||||
def read(doc: Bdoc): T = if (logMalformed) try {
|
||||
def readDocument(doc: Bdoc) = Try {
|
||||
reads(new Reader(doc))
|
||||
} catch {
|
||||
case e: Exception =>
|
||||
logger.warn(s"Can't read malformed doc ${debug(doc)}", e)
|
||||
throw e
|
||||
}
|
||||
else reads(new Reader(doc))
|
||||
|
||||
def read(doc: Bdoc) = readDocument(doc).get
|
||||
}
|
||||
|
||||
object BSON extends Handlers {
|
||||
|
@ -104,6 +105,14 @@ object BSON extends Handlers {
|
|||
// }
|
||||
// }
|
||||
|
||||
def quickHandler[T](read: PartialFunction[BSONValue, T], write: T => BSONValue): BSONHandler[T] = new BSONHandler[T] {
|
||||
def readTry(bson: BSONValue) = read.andThen(Success(_)).applyOrElse(
|
||||
bson,
|
||||
(b: BSONValue) => Failure(TypeDoesNotMatchException("BSONBinary", b.getClass.getSimpleName))
|
||||
)
|
||||
def writeTry(t: T) = Success(write(t))
|
||||
}
|
||||
|
||||
final class Reader(val doc: Bdoc) {
|
||||
|
||||
val map = {
|
||||
|
@ -117,7 +126,7 @@ object BSON extends Handlers {
|
|||
reader.readTry(map(k)).get
|
||||
// reader.asInstanceOf[BSONReader[A]].readTry(map(k)).get
|
||||
def getO[A](k: String)(implicit reader: BSONReader[A]): Option[A] =
|
||||
map get k flatMap reader.asInstanceOf[BSONReader[A]].readOpt
|
||||
map get k flatMap reader.readOpt
|
||||
def getD[A](k: String)(implicit zero: Zero[A], reader: BSONReader[A]): A =
|
||||
getO[A](k) getOrElse zero.zero
|
||||
def getD[A](k: String, default: => A)(implicit reader: BSONReader[A]): A =
|
||||
|
@ -143,9 +152,9 @@ object BSON extends Handlers {
|
|||
def bytes(k: String) = get[ByteArray](k)
|
||||
def bytesO(k: String) = getO[ByteArray](k)
|
||||
def bytesD(k: String) = bytesO(k) getOrElse ByteArray.empty
|
||||
def nInt(k: String) = get[BSONNumberLike](k).toInt
|
||||
def nIntO(k: String) = getO[BSONNumberLike](k) map (_.toInt)
|
||||
def nIntD(k: String) = nIntO(k) getOrElse 0
|
||||
def nInt(k: String) = get[BSONNumberLike](k).toInt.get
|
||||
def nIntO(k: String): Option[Int] = getO[BSONNumberLike](k) flatMap (_.toInt.toOption)
|
||||
def nIntD(k: String): Int = nIntO(k) getOrElse 0
|
||||
def intsD(k: String) = getO[List[Int]](k) getOrElse Nil
|
||||
def strsD(k: String) = getO[List[String]](k) getOrElse Nil
|
||||
|
||||
|
@ -163,7 +172,7 @@ object BSON extends Handlers {
|
|||
def strO(s: String): Option[BSONString] = if (s.nonEmpty) Some(BSONString(s)) else None
|
||||
def int(i: Int): BSONInteger = BSONInteger(i)
|
||||
def intO(i: Int): Option[BSONInteger] = if (i != 0) Some(BSONInteger(i)) else None
|
||||
def date(d: DateTime): BSONDateTime = BSONJodaDateTimeHandler.writeTry(d).get
|
||||
def date(d: DateTime): BSONValue = BSONJodaDateTimeHandler.writeTry(d).get
|
||||
def byteArrayO(b: ByteArray): Option[BSONValue] =
|
||||
if (b.isEmpty) None else ByteArray.ByteArrayBSONHandler.writeOpt(b)
|
||||
def bytesO(b: Array[Byte]): Option[BSONValue] = byteArrayO(ByteArray(b))
|
||||
|
|
|
@ -2,8 +2,8 @@ package lila.db
|
|||
|
||||
import scala.util.{ Try, Success, Failure }
|
||||
|
||||
import reactivemongo.api.bson.exceptions.TypeDoesNotMatchException
|
||||
import reactivemongo.api.bson._
|
||||
import reactivemongo.api.bson.exceptions.TypeDoesNotMatchException
|
||||
|
||||
case class ByteArray(value: Array[Byte]) {
|
||||
|
||||
|
@ -25,13 +25,10 @@ object ByteArray {
|
|||
def fromHexStr(hexStr: String): Try[ByteArray] =
|
||||
Try(ByteArray(hex str2Hex hexStr))
|
||||
|
||||
implicit val ByteArrayBSONHandler = new BSONHandler[ByteArray] {
|
||||
def readTry(bson: BSONValue) = bson match {
|
||||
case v: BSONBinary => Success(ByteArray(v.byteArray))
|
||||
case _ => Failure(TypeDoesNotMatchException("BSONBinary", bson.getClass.getSimpleName))
|
||||
}
|
||||
def writeTry(ba: ByteArray) = Success(BSONBinary(ba.value, subtype))
|
||||
}
|
||||
implicit val ByteArrayBSONHandler = lila.db.BSON.quickHandler[ByteArray](
|
||||
{ case v: BSONBinary => ByteArray(v.byteArray) },
|
||||
v => BSONBinary(v.value, subtype)
|
||||
)
|
||||
|
||||
implicit def fromBytes(value: Array[Byte]) = new ByteArray(value)
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package lila.db
|
||||
|
||||
import scala.collection.Factory
|
||||
import scala.util.{ Success, Failure }
|
||||
|
||||
import reactivemongo.api._
|
||||
|
@ -15,6 +16,8 @@ trait CollExt { self: dsl with QueryBuilderExt =>
|
|||
def secondaryPreferred = coll withReadPreference ReadPreference.secondaryPreferred
|
||||
def secondary = coll withReadPreference ReadPreference.secondary
|
||||
|
||||
def ext = this
|
||||
|
||||
def find(selector: Bdoc) = coll.find(selector, none)
|
||||
|
||||
def find(selector: Bdoc, proj: Bdoc) = coll.find(selector, proj.some)
|
||||
|
@ -158,16 +161,13 @@ trait CollExt { self: dsl with QueryBuilderExt =>
|
|||
private val mongoWireVersion = MongoWireVersion.V34
|
||||
|
||||
def aggregateList(
|
||||
firstOperator: coll.PipelineOperator,
|
||||
otherOperators: List[coll.PipelineOperator] = Nil,
|
||||
maxDocs: Int,
|
||||
readPreference: ReadPreference = ReadPreference.primary,
|
||||
allowDiskUse: Boolean = false
|
||||
): Fu[List[Bdoc]] = coll.aggregatorContext[Bdoc](
|
||||
firstOperator,
|
||||
otherOperators,
|
||||
)(f: coll.AggregationFramework => (coll.PipelineOperator, List[coll.PipelineOperator]))(implicit cp: CursorProducer[Bdoc]): Fu[List[Bdoc]] = coll.aggregateWith[Bdoc](
|
||||
allowDiskUse = allowDiskUse,
|
||||
readPreference = readPreference
|
||||
).prepared(CursorProducer.defaultCursorProducer[Bdoc]).cursor.collect[List](maxDocs = maxDocs, Cursor.FailOnError[List[Bdoc]]())
|
||||
)(f).collect[List](maxDocs = maxDocs, Cursor.FailOnError[List[Bdoc]]())
|
||||
|
||||
def aggregateOne(
|
||||
firstOperator: coll.PipelineOperator,
|
||||
|
@ -177,6 +177,15 @@ trait CollExt { self: dsl with QueryBuilderExt =>
|
|||
coll.aggregatorContext[Bdoc](firstOperator, otherOperators, readPreference = readPreference)
|
||||
.prepared(CursorProducer.defaultCursorProducer[Bdoc]).cursor.headOption
|
||||
|
||||
def distinctEasy[T, M[_] <: Iterable[_]](
|
||||
key: String,
|
||||
selector: coll.pack.Document
|
||||
)(implicit
|
||||
reader: coll.pack.NarrowValueReader[T],
|
||||
cbf: Factory[T, M[T]]
|
||||
): Fu[M[T]] =
|
||||
coll.distinct(key, selector.some, ReadConcern.Local, None)
|
||||
|
||||
// def distinctWithReadPreference[T, M[_] <: Iterable[_]](
|
||||
// key: String,
|
||||
// selector: Option[Bdoc],
|
||||
|
|
|
@ -10,7 +10,13 @@ import scala.concurrent.{ Await, ExecutionContext, Future }
|
|||
import scala.util.{ Failure, Success }
|
||||
|
||||
import dsl.Coll
|
||||
import lila.common.Chronometer
|
||||
import lila.common.{ CollName, Chronometer }
|
||||
import lila.common.config._
|
||||
|
||||
case class DbConfig(
|
||||
uri: String,
|
||||
@ConfigName("image.collection") imageCollName: Option[CollName]
|
||||
)
|
||||
|
||||
final class Env(name: String, config: DbConfig) {
|
||||
|
||||
|
@ -25,7 +31,7 @@ final class Env(name: String, config: DbConfig) {
|
|||
logger.info(s"$name MongoDB connected to $dbName in ${lap.showDuration}")
|
||||
}
|
||||
|
||||
def apply(name: String): Coll = db(name)
|
||||
def apply(name: CollName): Coll = db(name.value)
|
||||
|
||||
// val runCommand: RunCommand = (command, readPreference) => {
|
||||
// val runner = Command.run(BSONSerializationPack, FailoverStrategy.strict)
|
||||
|
|
|
@ -11,13 +11,10 @@ import lila.common.{ Iso, IpAddress, EmailAddress, NormalizedEmailAddress }
|
|||
|
||||
trait Handlers {
|
||||
|
||||
implicit val BSONJodaDateTimeHandler = new BSONHandler[DateTime] {
|
||||
def readTry(bson: BSONValue) = bson match {
|
||||
case v: BSONDateTime => Success(new DateTime(v.value))
|
||||
case _ => Failure(TypeDoesNotMatchException("BSONBinary", bson.getClass.getSimpleName))
|
||||
}
|
||||
def writeTry(v: DateTime) = Success(BSONDateTime(v.getMillis))
|
||||
}
|
||||
implicit val BSONJodaDateTimeHandler = lila.db.BSON.quickHandler[DateTime](
|
||||
{ case v: BSONDateTime => new DateTime(v.value) },
|
||||
v => BSONDateTime(v.getMillis)
|
||||
)
|
||||
|
||||
def isoHandler[A, B](iso: Iso[B, A])(implicit handler: BSONHandler[B]): BSONHandler[A] = new BSONHandler[A] {
|
||||
def readTry(x: BSONValue) = handler.readTry(x) map iso.from
|
||||
|
@ -41,13 +38,10 @@ trait Handlers {
|
|||
def dateIsoHandler[A](implicit iso: Iso[DateTime, A]): BSONHandler[A] = isoHandler[A, DateTime](iso)
|
||||
|
||||
implicit def bsonArrayToListHandler[T](implicit handler: BSONHandler[T]): BSONHandler[List[T]] =
|
||||
new BSONHandler[List[T]] {
|
||||
def readTry(bson: BSONValue) = bson match {
|
||||
case BSONArray(values) => Success(values.view.flatMap(handler.readOpt).to(List))
|
||||
case _ => Failure(TypeDoesNotMatchException("BSONArray", bson.getClass.getSimpleName))
|
||||
}
|
||||
def writeTry(repr: List[T]) = Success(BSONArray(repr.flatMap(handler.writeOpt)))
|
||||
}
|
||||
lila.db.BSON.quickHandler[List[T]](
|
||||
{ case BSONArray(values) => values.view.flatMap(handler.readOpt).to(List) },
|
||||
repr => BSONArray(repr.flatMap(handler.writeOpt))
|
||||
)
|
||||
|
||||
// implicit def bsonArrayToVectorHandler[T](implicit handler: BSONHandler[T]): BSONHandler[Vector[T]] = new BSONHandler[Vector[T]] {
|
||||
// def read(array: BSONArray) = array.values.view.flatMap(handler.readOpt).to(Vector)
|
||||
|
|
|
@ -37,6 +37,10 @@ trait dsl {
|
|||
|
||||
def $doc(elements: Iterable[(String, BSONValue)]): Bdoc = BSONDocument(elements)
|
||||
|
||||
def $arr(elements: Producer[BSONValue]*): Barr = {
|
||||
BSONArray(elements: _*)
|
||||
}
|
||||
|
||||
def $id[T: BSONWriter](id: T): Bdoc = $doc("_id" -> id)
|
||||
|
||||
def $inIds[T: BSONWriter](ids: Iterable[T]): Bdoc =
|
||||
|
@ -86,8 +90,8 @@ trait dsl {
|
|||
def $inc(item: ElementProducer, items: ElementProducer*): Bdoc = {
|
||||
$doc("$inc" -> $doc((Seq(item) ++ items): _*))
|
||||
}
|
||||
// def $inc(items: Traversable[BSONElement]): Bdoc =
|
||||
// $doc("$inc" -> $doc(items.map { e => (e.name, e.value) }): _*)
|
||||
def $inc(doc: Bdoc): Bdoc =
|
||||
$doc("$inc" -> doc)
|
||||
|
||||
def $mul(item: ElementProducer): Bdoc = {
|
||||
$doc("$mul" -> $doc(item))
|
||||
|
|
|
@ -2,7 +2,6 @@ package lila
|
|||
|
||||
import reactivemongo.api.commands.WriteResult
|
||||
import reactivemongo.api.ReadPreference
|
||||
import io.methvin.play.autoconfig._
|
||||
|
||||
package object db extends PackageObject {
|
||||
|
||||
|
@ -14,10 +13,5 @@ package object db extends PackageObject {
|
|||
|
||||
def isDuplicateKey(wr: WriteResult) = wr.code.contains(11000)
|
||||
|
||||
case class DbConfig(
|
||||
uri: String,
|
||||
@ConfigName("image.collection") imageCollName: Option[String]
|
||||
)
|
||||
|
||||
private[db] def logger = lila.log("db")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.evalCache
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scalaz.NonEmptyList
|
||||
|
||||
import chess.format.Uci
|
||||
|
|
|
@ -50,7 +50,7 @@ object GameAssessment {
|
|||
val byId: Map[Int, GameAssessment] = all.map { a => a.id -> a }.toMap
|
||||
def orDefault(id: Int) = byId.getOrElse(id, NotCheating)
|
||||
|
||||
import reactivemongo.bson.{ BSONHandler, BSONInteger }
|
||||
import reactivemongo.api.bson.{ BSONHandler, BSONInteger }
|
||||
|
||||
implicit val GameAssessmentBSONHandler = new BSONHandler[BSONInteger, GameAssessment] {
|
||||
def read(bsonInt: BSONInteger): GameAssessment = orDefault(bsonInt.value)
|
||||
|
|
|
@ -156,7 +156,7 @@ case class PlayerFlags(
|
|||
|
||||
object PlayerFlags {
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
|
||||
implicit val playerFlagsBSONHandler = new BSON[PlayerFlags] {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.event
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.common.Lang
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -3,7 +3,7 @@ package lila.fishnet
|
|||
import lila.db.BSON.{ BSONJodaDateTimeHandler, stringAnyValHandler }
|
||||
import lila.common.IpAddress
|
||||
import lila.game.BSONHandlers.FENBSONHandler
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import chess.format.FEN
|
||||
import chess.variant.Variant
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.fishnet
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.fishnet
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.util.{ Try, Success, Failure }
|
||||
|
||||
import Client.Skill
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.fishnet
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.fishnet
|
||||
|
||||
import scala.concurrent.duration._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.common.IpAddress
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.forum
|
|||
|
||||
import lila.db.BSON.LoggingHandler
|
||||
import lila.db.dsl._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private object BSONHandlers {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.game
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.collection.breakOut
|
||||
|
||||
import chess.variant.{ Variant, Crazyhouse }
|
||||
|
|
|
@ -41,7 +41,7 @@ object Blurs {
|
|||
|
||||
implicit val blursZero = Zero.instance[Blurs](Bits(0l))
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private[game] implicit val BlursBitsBSONHandler = new BSONHandler[BSONValue, Bits] {
|
||||
def read(bv: BSONValue): Bits = bv match {
|
||||
|
|
|
@ -81,7 +81,7 @@ object Crosstable {
|
|||
|
||||
private[game] def makeKey(u1: String, u2: String): String = if (u1 < u2) s"$u1/$u2" else s"$u2/$u1"
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
import lila.db.dsl._
|
||||
|
||||
|
|
|
@ -730,7 +730,7 @@ object CastleLastMove {
|
|||
|
||||
def init = CastleLastMove(Castles.all, None)
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.ByteArray.ByteArrayBSONHandler
|
||||
|
||||
private[game] implicit val castleLastMoveBSONHandler = new BSONHandler[BSONBinary, CastleLastMove] {
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.game
|
|||
|
||||
import chess.{ Color, White, Black, Clock, CheckCount, UnmovedRooks }
|
||||
import Game.BSONFields._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import Blurs.BlursBSONWriter
|
||||
import chess.Centis
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.joda.time.DateTime
|
|||
import reactivemongo.api.commands.GetLastError
|
||||
import reactivemongo.api.commands.WriteResult
|
||||
import reactivemongo.api.{ CursorProducer, Cursor, ReadPreference }
|
||||
import reactivemongo.bson.BSONDocument
|
||||
import reactivemongo.api.bson.BSONDocument
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -50,7 +50,7 @@ object PgnImport {
|
|||
h = hash(pgn).some
|
||||
)
|
||||
|
||||
import reactivemongo.bson.Macros
|
||||
import reactivemongo.api.bson.Macros
|
||||
import ByteArray.ByteArrayBSONHandler
|
||||
implicit val pgnImportBSONHandler = Macros.handler[PgnImport]
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import lila.db.dsl._
|
|||
import lila.user.{ User, UserRepo }
|
||||
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
final class PlayTimeApi(
|
||||
|
|
|
@ -124,7 +124,7 @@ object Player {
|
|||
|
||||
case class UserInfo(id: String, rating: Int, provisional: Boolean)
|
||||
|
||||
import reactivemongo.bson.Macros
|
||||
import reactivemongo.api.bson.Macros
|
||||
implicit val holdAlertBSONHandler = Macros.handler[HoldAlert]
|
||||
|
||||
object BSONFields {
|
||||
|
@ -143,7 +143,7 @@ object Player {
|
|||
val name = "na"
|
||||
}
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
|
||||
type ID = String
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.game
|
|||
|
||||
import chess.Status
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -44,7 +44,7 @@ case class History(
|
|||
|
||||
object History {
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private[history] implicit val RatingsMapReader = new BSONDocumentReader[RatingsMap] {
|
||||
def read(doc: BSONDocument): RatingsMap = doc.stream.flatMap {
|
||||
|
|
|
@ -3,7 +3,7 @@ package lila.history
|
|||
import com.github.blemale.scaffeine.{ Cache, Scaffeine }
|
||||
import org.joda.time.{ DateTime, Days }
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import chess.Speed
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.insight
|
||||
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.dsl._
|
||||
|
||||
object AggregationClusters {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.insight
|
||||
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scalaz.{ NonEmptyList, IList }
|
||||
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.insight
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import chess.opening.{ Ecopening, EcopeningDB }
|
||||
import chess.{ Role, Color }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.insight
|
||||
|
||||
import scalatags.Text.all._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import play.api.libs.json._
|
||||
|
||||
import chess.opening.EcopeningDB
|
||||
|
|
|
@ -4,7 +4,7 @@ import akka.actor.ActorRef
|
|||
import org.joda.time.DateTime
|
||||
import play.api.libs.iteratee._
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.insight
|
|||
|
||||
import scalatags.Text.all._
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
sealed abstract class Metric(
|
||||
val key: String,
|
||||
|
|
|
@ -13,7 +13,7 @@ case class Filter[A](
|
|||
|
||||
def isEmpty = selected.isEmpty || selected.size == Dimension.valuesOf(dimension).size
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
def matcher: BSONDocument = Dimension.filtersOf(dimension, selected)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.insight
|
||||
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scalaz.NonEmptyList
|
||||
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.insight
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.irwin
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.db.BSON
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.irwin
|
|||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.analyse.Analysis.Analyzed
|
||||
import lila.analyse.AnalysisRepo
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.learn
|
||||
|
||||
import reactivemongo.bson.{ MapReader => _, MapWriter => _, _ }
|
||||
import reactivemongo.api.bson.{ MapReader => _, MapWriter => _, _ }
|
||||
|
||||
import lila.db.BSON
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -102,7 +102,7 @@ object Seek {
|
|||
createdAt = DateTime.now
|
||||
)
|
||||
|
||||
import reactivemongo.bson.{ MapReader => _, MapWriter => _, _ }
|
||||
import reactivemongo.api.bson.{ MapReader => _, MapWriter => _, _ }
|
||||
import lila.db.BSON.MapValue.MapHandler
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
implicit val lobbyPerfBSONHandler = new BSONHandler[BSONInteger, LobbyPerf] {
|
||||
|
|
|
@ -4,10 +4,12 @@ import com.softwaremill.macwire._
|
|||
import io.methvin.play.autoconfig._
|
||||
import play.api.Configuration
|
||||
import lila.db.dsl.Coll
|
||||
import lila.common.CollName
|
||||
import lila.common.config._
|
||||
|
||||
case class MemoConfig(
|
||||
@ConfigName("collection.cache") cacheColl: String,
|
||||
@ConfigName("collection.config") configColl: String
|
||||
@ConfigName("collection.cache") cacheColl: CollName,
|
||||
@ConfigName("collection.config") configColl: CollName
|
||||
)
|
||||
|
||||
final class Env(appConfig: Configuration, db: lila.db.Env)(implicit system: akka.actor.ActorSystem) {
|
||||
|
|
|
@ -36,5 +36,5 @@ object Post {
|
|||
)
|
||||
|
||||
import lila.db.dsl.BSONJodaDateTimeHandler
|
||||
private[message] implicit val PostBSONHandler = reactivemongo.bson.Macros.handler[Post]
|
||||
private[message] implicit val PostBSONHandler = reactivemongo.api.bson.Macros.handler[Post]
|
||||
}
|
||||
|
|
|
@ -141,6 +141,6 @@ object Thread {
|
|||
import Post.PostBSONHandler
|
||||
private[message] implicit val ThreadBSONHandler =
|
||||
lila.db.BSON.LoggingHandler(lila.log("message")) {
|
||||
reactivemongo.bson.Macros.handler[Thread]
|
||||
reactivemongo.api.bson.Macros.handler[Thread]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ object ThreadRepo {
|
|||
}
|
||||
|
||||
def unreadCount(userId: String): Fu[Int] = {
|
||||
import reactivemongo.bson.BSONNull
|
||||
import reactivemongo.api.bson.BSONNull
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
coll.aggregateOne(
|
||||
Match($doc(
|
||||
|
|
|
@ -13,7 +13,7 @@ import lila.user.{ User, UserRepo }
|
|||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.util.Random
|
||||
|
||||
import chess.Color
|
||||
|
|
|
@ -5,7 +5,7 @@ import lila.db.dsl._
|
|||
import lila.game.Game
|
||||
import lila.user.User
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
final class BoostingApi(
|
||||
modApi: ModApi,
|
||||
|
|
|
@ -4,7 +4,7 @@ import lila.db.BSON.BSONJodaDateTimeHandler
|
|||
import org.joda.time.DateTime
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -7,7 +7,7 @@ import lila.security.Permission
|
|||
final class ModlogApi(coll: Coll) {
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
private implicit val ModlogBSONHandler = reactivemongo.bson.Macros.handler[Modlog]
|
||||
private implicit val ModlogBSONHandler = reactivemongo.api.bson.Macros.handler[Modlog]
|
||||
|
||||
def streamerList(mod: Mod, streamerId: String, v: Boolean) = add {
|
||||
Modlog(mod.user.id, streamerId.some, if (v) Modlog.streamerList else Modlog.streamerUnlist)
|
||||
|
|
|
@ -6,7 +6,7 @@ import lila.db.{ dsl, BSON }
|
|||
import lila.notify.InvitedToStudy.{ StudyName, InvitedBy, StudyId }
|
||||
import lila.notify.MentionedInThread._
|
||||
import lila.notify.Notification._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private object BSONHandlers {
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ object AccessToken {
|
|||
val scopes = "scopes"
|
||||
}
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
import lila.db.dsl._
|
||||
import BSON.BSONJodaDateTimeHandler
|
||||
|
|
|
@ -34,7 +34,7 @@ object OAuthApp {
|
|||
val description = "description"
|
||||
}
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
import lila.db.dsl._
|
||||
import BSON.BSONJodaDateTimeHandler
|
||||
|
|
|
@ -56,7 +56,7 @@ object OAuthScope {
|
|||
|
||||
def select(selectors: Iterable[OAuthScope.type => OAuthScope]) = selectors.map(_(OAuthScope)).toList
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.dsl._
|
||||
private[oauth] implicit val scopeHandler = new BSONHandler[BSONString, OAuthScope] {
|
||||
def read(b: BSONString): OAuthScope = OAuthScope.byKey.get(b.value) err s"No such scope: ${b.value}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.perfStat
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.rating.BSONHandlers.perfTypeIdHandler
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.plan
|
||||
|
||||
import lila.db.dsl._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private[plan] object BsonHandlers {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.plan
|
|||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
import reactivemongo.bson.BSONNull
|
||||
import reactivemongo.api.bson.BSONNull
|
||||
|
||||
import lila.db.dsl._
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.playban
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import chess.variant._
|
||||
|
@ -23,7 +23,7 @@ final class PlaybanApi(
|
|||
) {
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
import reactivemongo.bson.Macros
|
||||
import reactivemongo.api.bson.Macros
|
||||
private implicit val OutcomeBSONHandler = new BSONHandler[BSONInteger, Outcome] {
|
||||
def read(bsonInt: BSONInteger): Outcome = Outcome(bsonInt.value) err s"No such playban outcome: ${bsonInt.value}"
|
||||
def write(x: Outcome) = BSONInteger(x.id)
|
||||
|
|
|
@ -3,7 +3,7 @@ package lila.practice
|
|||
import lila.db.BSON
|
||||
import lila.db.dsl._
|
||||
import lila.study.Chapter
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
object BSONHandlers {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.pref
|
||||
|
||||
import play.api.mvc.RequestHeader
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
||||
import lila.db.BSON
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.push
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.user.User
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.push
|
|||
|
||||
import org.joda.time.DateTime
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.user.User
|
||||
|
|
|
@ -34,6 +34,6 @@ object AggregateVote {
|
|||
val minRatio = -50
|
||||
val minVotes = 30
|
||||
|
||||
import reactivemongo.bson.Macros
|
||||
import reactivemongo.api.bson.Macros
|
||||
implicit val aggregatevoteBSONHandler = Macros.handler[AggregateVote]
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ object Puzzle {
|
|||
mate = mate
|
||||
)
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
import BSON.BSONJodaDateTimeHandler
|
||||
private implicit val lineBSONHandler = new BSONHandler[BSONDocument, Lines] {
|
||||
|
|
|
@ -17,7 +17,7 @@ object PuzzleHead {
|
|||
val last = "last"
|
||||
}
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
private[puzzle] implicit val puzzleHeadBSONHandler = Macros.handler[PuzzleHead]
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ case object PuzzlePerf {
|
|||
implicit val puzzlePerfBSONHandler = new BSON[PuzzlePerf] {
|
||||
|
||||
import Glicko.glickoBSONHandler
|
||||
import reactivemongo.bson.BSONDocument
|
||||
import reactivemongo.api.bson.BSONDocument
|
||||
|
||||
def reads(r: BSON.Reader): PuzzlePerf = PuzzlePerf(
|
||||
glicko = r.getO[Glicko]("gl") | Glicko.default,
|
||||
|
|
|
@ -25,7 +25,7 @@ object Round {
|
|||
val magic = "m"
|
||||
}
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON
|
||||
import lila.db.dsl._
|
||||
import BSON.BSONJodaDateTimeHandler
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.puzzle
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.user.User
|
||||
|
|
|
@ -14,5 +14,5 @@ object Vote {
|
|||
|
||||
def makeId(puzzleId: PuzzleId, userId: String) = s"$puzzleId/$userId"
|
||||
|
||||
implicit val voteBSONHandler = reactivemongo.bson.Macros.handler[Vote]
|
||||
implicit val voteBSONHandler = reactivemongo.api.bson.Macros.handler[Vote]
|
||||
}
|
||||
|
|
|
@ -10,10 +10,3 @@ final class Env(settingStore: lila.memo.SettingStore.Builder) {
|
|||
text = "Rating gain factor per perf type".some
|
||||
)
|
||||
}
|
||||
|
||||
object Env {
|
||||
|
||||
lazy val current: Env = "rating" boot new Env(
|
||||
settingStore = lila.memo.Env.current.settingStore
|
||||
)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.rating
|
|||
|
||||
import org.goochjs.glicko2._
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson.BSONDocument
|
||||
import reactivemongo.api.bson.BSONDocument
|
||||
|
||||
import lila.db.BSON
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.rating
|
|||
|
||||
import org.goochjs.glicko2.Rating
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson.BSONDocument
|
||||
import reactivemongo.api.bson.BSONDocument
|
||||
|
||||
import lila.db.BSON
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ object PerfType {
|
|||
case _ => none
|
||||
}
|
||||
|
||||
lazy val totalTimeRoughEstimation: Map[PerfType, Centis] = nonPuzzle.map { pt =>
|
||||
lazy val totalTimeRoughEstimation: Map[PerfType, Centis] = nonPuzzle.view.map { pt =>
|
||||
pt -> Centis(pt match {
|
||||
case UltraBullet => 25 * 100
|
||||
case Bullet => 90 * 100
|
||||
|
@ -210,7 +210,7 @@ object PerfType {
|
|||
case Correspondence => 60 * 60 * 100
|
||||
case _ => 7 * 60 * 100
|
||||
})
|
||||
}(scala.collection.breakOut)
|
||||
}.to(Map)
|
||||
|
||||
def iconByVariant(variant: chess.variant.Variant): Char =
|
||||
byVariant(variant).fold('C')(_.iconChar)
|
||||
|
|
|
@ -12,7 +12,7 @@ import lila.user.User
|
|||
import BSONHandlers._
|
||||
import reactivemongo.api._
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
final class RelationApi(
|
||||
coll: Coll,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.relation
|
||||
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.relation
|
||||
|
||||
import lila.common.LightUser
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
case class Follower(u1: String) {
|
||||
def userId = u1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.relay
|
||||
|
||||
import lila.db.dsl._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
object BSONHandlers {
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import io.lemonlabs.uri.Url
|
|||
import org.joda.time.DateTime
|
||||
import ornicar.scalalib.Zero
|
||||
import play.api.libs.json._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.security.Granter
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.relay
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.report
|
|||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
import lila.db.dsl._
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
object BSONHandlers {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.report
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.user.{ User, UserRepo, Title }
|
||||
|
|
|
@ -25,7 +25,7 @@ private final class CorresAlarm(
|
|||
expiresAt: DateTime
|
||||
)
|
||||
|
||||
private implicit val AlarmHandler = reactivemongo.bson.Macros.handler[Alarm]
|
||||
private implicit val AlarmHandler = reactivemongo.api.bson.Macros.handler[Alarm]
|
||||
|
||||
private def scheduleNext: Unit = system.scheduler.scheduleOnce(10 seconds)(run)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package lila.round
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
import lila.db.dsl._
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.round
|
|||
|
||||
import lila.db.dsl._
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
final class NoteApi(coll: Coll) {
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ final class Env(
|
|||
checkMailBlocked = () => checkMail.fetchAllBlocked
|
||||
)
|
||||
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
lazy val spamKeywordsSetting =
|
||||
settingStore[Strings](
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package lila.security
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
|
||||
import lila.db.dsl._
|
||||
import lila.user.User
|
||||
|
|
|
@ -7,7 +7,7 @@ import play.api.data.Forms._
|
|||
import play.api.data.validation.{ Constraint, Valid => FormValid, Invalid, ValidationError }
|
||||
import play.api.mvc.RequestHeader
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson._
|
||||
import reactivemongo.api.bson._
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import lila.common.{ ApiVersion, IpAddress, EmailAddress, HTTPRequest }
|
||||
|
|
|
@ -3,7 +3,7 @@ package lila.security
|
|||
import org.joda.time.DateTime
|
||||
import play.api.mvc.RequestHeader
|
||||
import reactivemongo.api.ReadPreference
|
||||
import reactivemongo.bson.Macros
|
||||
import reactivemongo.api.bson.Macros
|
||||
|
||||
import lila.common.{ HTTPRequest, ApiVersion, IpAddress }
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue