-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
Retrieve Users Locked Tasks
endpoint
- Loading branch information
1 parent
5949dc0
commit 87cca3a
Showing
5 changed files
with
131 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md). | ||
* Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
*/ | ||
package org.maproulette.framework.model | ||
|
||
import org.joda.time.DateTime | ||
import org.maproulette.cache.CacheObject | ||
import org.maproulette.framework.psql.CommonField | ||
import play.api.libs.json.{Json, Format} | ||
import play.api.libs.json.JodaWrites._ | ||
import play.api.libs.json.JodaReads._ | ||
|
||
// Define the LockedTask case class | ||
case class LockedTask( | ||
override val id: Long, | ||
challengeName: Option[String], | ||
startedAt: DateTime | ||
) extends CacheObject[Long] { | ||
// Implement the abstract member 'name' | ||
override def name: String = "LockedTask" | ||
} | ||
|
||
/** | ||
* Mapping between Task and Challenge and Lock | ||
*/ | ||
case class LockedTaskData( | ||
id: Long, | ||
challengeName: Option[String], | ||
startedAt: DateTime | ||
) | ||
|
||
object LockedTask extends CommonField { | ||
// Use Json.format to automatically derive both Reads and Writes | ||
implicit val lockedTaskFormat: Format[LockedTask] = Json.format[LockedTask] | ||
} | ||
|
||
// Define implicit Formats for LockedTaskData | ||
object LockedTaskData { | ||
implicit val lockedTaskDataFormat: Format[LockedTaskData] = Json.format[LockedTaskData] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters