Skip to content
Snippets Groups Projects
Commit 411d27ee authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Fixed PaddAddListener

parent b586af4e
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,13 @@ import de.tobias.playpad.server.server.project.sync.listener.Listener
class PadAddListener extends Listener {
override def onChange(json: JsonObject, connection: Connection, session: Session): Unit = {
val padId = UUID.fromString(json.get("id").getAsString)
val pageId = UUID.fromString(json.get("page").getAsString)
val padName = json.get("name").getAsString
val padPosition= json.get("position").getAsInt
SqlHelper.insertOrUpdate(connection, SqlDef.PAD, padId, SqlDef.PAD_NAME, "")
SqlHelper.insertOrUpdate(connection, SqlDef.PAD, padId, SqlDef.PAD_PAGE_REF, pageId)
SqlHelper.insertOrUpdate(connection, SqlDef.PAD, padId, SqlDef.PAD_NAME, padName)
SqlHelper.insertOrUpdate(connection, SqlDef.PAD, padId, SqlDef.PAD_POSITION, padPosition)
SqlHelper.insertOrUpdate(connection, SqlDef.PAD, padId, SqlDef.PAD_CONTENT_TYPE, null)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment