mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 13:26:51 +00:00
Depreciate Consumer call limits in favour of Rate Limits
This commit is contained in:
parent
2957488a68
commit
858813a69a
@ -56,6 +56,7 @@ trait ConsumersProvider {
|
||||
LogoURL: Option[String] = None,
|
||||
certificate: Option[String] = None,
|
||||
): Box[Consumer]
|
||||
@deprecated("Use RateLimitingDI.rateLimiting.vend methods instead", "v5.0.0")
|
||||
def updateConsumerCallLimits(id: Long, perSecond: Option[String], perMinute: Option[String], perHour: Option[String], perDay: Option[String], perWeek: Option[String], perMonth: Option[String]): Future[Box[Consumer]]
|
||||
def getOrCreateConsumer(consumerId: Option[String],
|
||||
key: Option[String],
|
||||
|
||||
@ -323,6 +323,7 @@ object MappedConsumersProvider extends ConsumersProvider with MdcLoggable {
|
||||
}
|
||||
}
|
||||
|
||||
@deprecated("Use RateLimitingDI.rateLimiting.vend methods instead", "v5.0.0")
|
||||
override def updateConsumerCallLimits(id: Long,
|
||||
perSecond: Option[String],
|
||||
perMinute: Option[String],
|
||||
|
||||
@ -167,8 +167,7 @@ object MappedRateLimitingProvider extends RateLimitingProviderTrait with Logger
|
||||
c.saveMe()
|
||||
}
|
||||
}
|
||||
val result = createRateLimit(RateLimiting.create)
|
||||
result
|
||||
createRateLimit(RateLimiting.create)
|
||||
}
|
||||
def createOrUpdateConsumerCallLimits(consumerId: String,
|
||||
fromDate: Date,
|
||||
@ -225,7 +224,7 @@ object MappedRateLimitingProvider extends RateLimitingProviderTrait with Logger
|
||||
perDay: Option[String],
|
||||
perWeek: Option[String],
|
||||
perMonth: Option[String]): Future[Box[RateLimiting]] = Future {
|
||||
RateLimiting.find(
|
||||
val result = RateLimiting.find(
|
||||
By(RateLimiting.RateLimitingId, rateLimitingId)
|
||||
) map { c =>
|
||||
c.FromDate(fromDate)
|
||||
@ -246,21 +245,17 @@ object MappedRateLimitingProvider extends RateLimitingProviderTrait with Logger
|
||||
|
||||
c.saveMe()
|
||||
}
|
||||
}
|
||||
|
||||
def deleteByRateLimitingId(rateLimitingId: String): Future[Box[Boolean]] = Future {
|
||||
tryo {
|
||||
RateLimiting.find(By(RateLimiting.RateLimitingId, rateLimitingId)) match {
|
||||
case Full(rateLimiting) => rateLimiting.delete_!
|
||||
case _ => false
|
||||
}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
def getByRateLimitingId(rateLimitingId: String): Future[Box[RateLimiting]] = Future {
|
||||
RateLimiting.find(By(RateLimiting.RateLimitingId, rateLimitingId))
|
||||
}
|
||||
|
||||
def deleteByRateLimitingId(rateLimitingId: String): Future[Box[Boolean]] = Future {
|
||||
RateLimiting.find(By(RateLimiting.RateLimitingId, rateLimitingId)).map(_.delete_!)
|
||||
}
|
||||
|
||||
private def getActiveCallLimitsByConsumerIdAtDateCached(consumerId: String, dateWithHour: String): List[RateLimiting] = {
|
||||
// Cache key uses standardized prefix: rl_active_{consumerId}_{dateWithHour}
|
||||
// Create Date objects for start and end of the hour from the date_with_hour string
|
||||
|
||||
Loading…
Reference in New Issue
Block a user