Sending actor data to MQTT
This commit is contained in:
+15
-1
@@ -1,5 +1,7 @@
|
||||
package models
|
||||
|
||||
import play.api.libs.json.{JsValue, Json, Writes}
|
||||
|
||||
import java.time.Instant
|
||||
|
||||
case class User(id: Option[Int], username: String, gid: String, passwordDigest: Option[String])
|
||||
@@ -9,4 +11,16 @@ case class AuthToken(id: Option[Int], userId: Int, token: String, createdAt: Ins
|
||||
case class Auction(id: Option[Int], name: String, gid: String, authorId: Int,
|
||||
startingPrice: BigDecimal, currentBid: Option[BigDecimal],
|
||||
currentBidderId: Option[Int], currentBidAt: Option[Instant],
|
||||
createdAt: Instant)
|
||||
createdAt: Instant)
|
||||
|
||||
object Auction {
|
||||
implicit val writes: Writes[Auction] = (a: Auction) => Json.obj(
|
||||
"id" -> a.id,
|
||||
"name" -> a.name,
|
||||
"gid" -> a.gid,
|
||||
"starting_price" -> a.startingPrice,
|
||||
"current_bid" -> a.currentBid,
|
||||
"current_bidder_id" -> a.currentBidderId,
|
||||
"current_bid_at" -> a.currentBidAt
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user