mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 11:06:49 +00:00
consumers/current add call counters
This commit is contained in:
parent
5e06130450
commit
e1173efe4c
@ -567,7 +567,8 @@ trait APIMethods600 {
|
||||
|""",
|
||||
EmptyBody,
|
||||
CurrentConsumerJsonV600(
|
||||
consumer_id = "123"
|
||||
consumer_id = "123",
|
||||
call_counters = redisCallCountersJsonV600
|
||||
),
|
||||
List(
|
||||
UserNotLoggedIn,
|
||||
@ -593,8 +594,10 @@ trait APIMethods600 {
|
||||
} map {
|
||||
unboxFullOrFail(_, cc.callContext, InvalidConsumerCredentials, 401)
|
||||
}
|
||||
currentConsumerCallCounters <- Future(RateLimitingUtil.consumerRateLimitState(consumer.consumerId.get).toList)
|
||||
callCountersJson = createRedisCallCountersJson(currentConsumerCallCounters)
|
||||
} yield {
|
||||
(CurrentConsumerJsonV600(consumer.consumerId.get), HttpCode.`200`(callContext))
|
||||
(CurrentConsumerJsonV600(consumer.consumerId.get, callCountersJson), HttpCode.`200`(callContext))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,8 @@ case class TokenJSON(
|
||||
)
|
||||
|
||||
case class CurrentConsumerJsonV600(
|
||||
consumer_id: String
|
||||
consumer_id: String,
|
||||
call_counters: RedisCallCountersJsonV600
|
||||
)
|
||||
|
||||
case class CallLimitPostJsonV600(
|
||||
|
||||
@ -94,6 +94,13 @@ class ConsumerTest extends V600ServerSetup {
|
||||
consumerJson.consumer_id should not be empty
|
||||
consumerJson.consumer_id should not be null
|
||||
consumerJson.consumer_id shouldBe a[String]
|
||||
consumerJson.call_counters should not be null
|
||||
consumerJson.call_counters.per_second should not be null
|
||||
consumerJson.call_counters.per_minute should not be null
|
||||
consumerJson.call_counters.per_hour should not be null
|
||||
consumerJson.call_counters.per_day should not be null
|
||||
consumerJson.call_counters.per_week should not be null
|
||||
consumerJson.call_counters.per_month should not be null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user