mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:17:09 +00:00
Fixed getCustomersForUser v3.0.0 in akka mode
This commit is contained in:
parent
2941e7133e
commit
1171abaa00
@ -1628,8 +1628,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
|
||||
)
|
||||
|
||||
|
||||
override def getCustomersByUserIdFuture(userId: String)(session: Option[CallContext]): Future[Box[List[Customer]]] = Future {
|
||||
Customer.customerProvider.vend.getCustomersByUserIdBox(userId)
|
||||
}
|
||||
override def getCustomersByUserIdFuture(userId: String)(session: Option[CallContext]): Future[Box[List[Customer]]] =
|
||||
Customer.customerProvider.vend.getCustomersByUserIdFuture(userId)
|
||||
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ trait CustomerProvider {
|
||||
|
||||
def getCustomersByUserId(userId: String): List[Customer]
|
||||
|
||||
def getCustomersByUserIdBox(userId: String): Box[List[Customer]]
|
||||
def getCustomersByUserIdFuture(userId: String): Future[Box[List[Customer]]]
|
||||
|
||||
def getCustomerByCustomerId(customerId: String): Box[Customer]
|
||||
|
||||
|
||||
@ -52,12 +52,14 @@ object MappedCustomerProvider extends CustomerProvider {
|
||||
MappedCustomer.findAll(ByList(MappedCustomer.mCustomerId, customerIds))
|
||||
}
|
||||
|
||||
def getCustomersByUserIdF(userId: String): Box[List[Customer]] = {
|
||||
def getCustomersByUserIdBoxed(userId: String): Box[List[Customer]] = {
|
||||
Full(getCustomersByUserId(userId))
|
||||
}
|
||||
|
||||
override def getCustomersByUserIdBox(userId: String): Box[List[Customer]]= {
|
||||
Full(getCustomersByUserId(userId))
|
||||
override def getCustomersByUserIdFuture(userId: String): Future[Box[List[Customer]]]= {
|
||||
Future {
|
||||
Full(getCustomersByUserId(userId))
|
||||
}
|
||||
}
|
||||
|
||||
override def getBankIdByCustomerId(customerId: String): Box[String] = {
|
||||
|
||||
@ -20,8 +20,8 @@ object RemotedataCustomers extends ObpActorInit with CustomerProvider {
|
||||
def getCustomersByUserId(userId: String): List[Customer] =
|
||||
extractFuture(actor ? cc.getCustomersByUserId(userId))
|
||||
|
||||
def getCustomersByUserIdBox(userId: String): Box[List[Customer]] =
|
||||
extractFutureToBox(actor ? cc.getCustomersByUserIdFuture(userId))
|
||||
def getCustomersByUserIdFuture(userId: String): Future[Box[List[Customer]]] =
|
||||
(actor ? cc.getCustomersByUserIdFuture(userId)).mapTo[Box[List[Customer]]]
|
||||
|
||||
def getCustomerByCustomerId(customerId: String) : Box[Customer] =
|
||||
extractFutureToBox(actor ? cc.getCustomerByCustomerId(customerId))
|
||||
|
||||
@ -25,7 +25,7 @@ class RemotedataCustomersActor extends Actor with ObpActorHelper with MdcLoggabl
|
||||
|
||||
case cc.getCustomersByUserIdFuture(userId: String) =>
|
||||
logger.debug("getCustomersByUserIdFuture(" + userId + ")")
|
||||
sender ! (mapper.getCustomersByUserIdF(userId))
|
||||
sender ! (mapper.getCustomersByUserIdBoxed(userId))
|
||||
|
||||
case cc.getCustomerByCustomerId(customerId: String) =>
|
||||
logger.debug("getCustomerByCustomerId(" + customerId + ")")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user