mirror of
https://github.com/arcan1s/ffxivbis.git
synced 2025-04-25 01:37:17 +00:00
rename property
This commit is contained in:
parent
6e8b64feef
commit
557038c262
@ -132,7 +132,7 @@ class BiSEndpoint(override val storage: ActorRef, ariyala: ActorRef)(implicit ti
|
|||||||
authenticateBasicBCrypt(s"party $partyId", authPost(partyId)) { _ =>
|
authenticateBasicBCrypt(s"party $partyId", authPost(partyId)) { _ =>
|
||||||
post {
|
post {
|
||||||
entity(as[PieceActionResponse]) { action =>
|
entity(as[PieceActionResponse]) { action =>
|
||||||
val playerId = action.playerIdResponse.withPartyId(partyId)
|
val playerId = action.playerId.withPartyId(partyId)
|
||||||
onComplete(doModifyBiS(action.action, playerId, action.piece.toPiece)) {
|
onComplete(doModifyBiS(action.action, playerId, action.piece.toPiece)) {
|
||||||
case Success(_) => complete(StatusCodes.Accepted, HttpEntity.Empty)
|
case Success(_) => complete(StatusCodes.Accepted, HttpEntity.Empty)
|
||||||
case Failure(exception) => throw exception
|
case Failure(exception) => throw exception
|
||||||
|
@ -95,7 +95,7 @@ class LootEndpoint(override val storage: ActorRef)(implicit timeout: Timeout)
|
|||||||
authenticateBasicBCrypt(s"party $partyId", authPost(partyId)) { _ =>
|
authenticateBasicBCrypt(s"party $partyId", authPost(partyId)) { _ =>
|
||||||
post {
|
post {
|
||||||
entity(as[PieceActionResponse]) { action =>
|
entity(as[PieceActionResponse]) { action =>
|
||||||
val playerId = action.playerIdResponse.withPartyId(partyId)
|
val playerId = action.playerId.withPartyId(partyId)
|
||||||
onComplete(doModifyLoot(action.action, playerId, action.piece.toPiece)) {
|
onComplete(doModifyLoot(action.action, playerId, action.piece.toPiece)) {
|
||||||
case Success(_) => complete(StatusCodes.Accepted, HttpEntity.Empty)
|
case Success(_) => complete(StatusCodes.Accepted, HttpEntity.Empty)
|
||||||
case Failure(exception) => throw exception
|
case Failure(exception) => throw exception
|
||||||
|
@ -94,7 +94,7 @@ class PlayerEndpoint(override val storage: ActorRef, ariyala: ActorRef)(implicit
|
|||||||
extractExecutionContext { implicit executionContext =>
|
extractExecutionContext { implicit executionContext =>
|
||||||
authenticateBasicBCrypt(s"party $partyId", authPost(partyId)) { _ =>
|
authenticateBasicBCrypt(s"party $partyId", authPost(partyId)) { _ =>
|
||||||
entity(as[PlayerActionResponse]) { action =>
|
entity(as[PlayerActionResponse]) { action =>
|
||||||
val player = action.playerIdResponse.toPlayer.copy(partyId = partyId)
|
val player = action.playerId.toPlayer.copy(partyId = partyId)
|
||||||
onComplete(doModifyPlayer(action.action, player)) {
|
onComplete(doModifyPlayer(action.action, player)) {
|
||||||
case Success(_) => complete(StatusCodes.Accepted, HttpEntity.Empty)
|
case Success(_) => complete(StatusCodes.Accepted, HttpEntity.Empty)
|
||||||
case Failure(exception) => throw exception
|
case Failure(exception) => throw exception
|
||||||
|
@ -13,4 +13,4 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
case class PieceActionResponse(
|
case class PieceActionResponse(
|
||||||
@Schema(description = "action to perform", required = true, `type` = "string", allowableValues = Array("add", "remove")) action: ApiAction.Value,
|
@Schema(description = "action to perform", required = true, `type` = "string", allowableValues = Array("add", "remove")) action: ApiAction.Value,
|
||||||
@Schema(description = "piece description", required = true) piece: PieceResponse,
|
@Schema(description = "piece description", required = true) piece: PieceResponse,
|
||||||
@Schema(description = "player description", required = true) playerIdResponse: PlayerIdResponse)
|
@Schema(description = "player description", required = true) playerId: PlayerIdResponse)
|
||||||
|
@ -12,4 +12,4 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
|
|
||||||
case class PlayerActionResponse(
|
case class PlayerActionResponse(
|
||||||
@Schema(description = "action to perform", required = true, `type` = "string", allowableValues = Array("add", "remove"), example = "add") action: ApiAction.Value,
|
@Schema(description = "action to perform", required = true, `type` = "string", allowableValues = Array("add", "remove"), example = "add") action: ApiAction.Value,
|
||||||
@Schema(description = "player description", required = true) playerIdResponse: PlayerResponse)
|
@Schema(description = "player description", required = true) playerId: PlayerResponse)
|
||||||
|
@ -16,9 +16,9 @@ object Settings {
|
|||||||
replace(default, values.toList)
|
replace(default, values.toList)
|
||||||
}
|
}
|
||||||
|
|
||||||
def clearDatabase(config: Config): Unit = {
|
def clearDatabase(config: Config): Unit =
|
||||||
val databasePath =
|
config.getString("me.arcanis.ffxivbis.database.sqlite.db.url").split(":")
|
||||||
config.getString("me.arcanis.ffxivbis.database.sqlite.db.url").split(":").last
|
.lastOption.foreach { databasePath =>
|
||||||
val databaseFile = new File(databasePath)
|
val databaseFile = new File(databasePath)
|
||||||
if (databaseFile.exists)
|
if (databaseFile.exists)
|
||||||
databaseFile.delete()
|
databaseFile.delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user