Created
November 27, 2018 06:51
-
-
Save IlyaHalsky/449e1cfef00b41a5ca35c9369e4bedb5 to your computer and use it in GitHub Desktop.
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
@assemble class ByPKAssemble extends Assemble { | |
def byPKRequestWithSrcToItemSrcId( | |
key: SrcId, | |
rq: Each[DepInnerRequest] | |
): Values[(ByPkItemSrcId, InnerByPKRequest)] = | |
if(!rq.request.isInstanceOf[ByPKRequest]) Nil else { | |
val brq = rq.request.asInstanceOf[ByPKRequest] | |
List(brq.itemSrcId → InnerByPKRequest(rq, brq.className)) | |
} | |
} | |
@assemble class ByPKGenericAssemble[A <: Product](handledClass: Class[A], util: DepResponseFactory) extends Assemble { | |
def BPKRequestToResponse( | |
key: SrcId, | |
@by[ByPkItemSrcId] rq: Each[InnerByPKRequest], | |
items: Values[A] | |
): Values[(SrcId, DepResponse)] = | |
if(rq.className != handledClass.getName) Nil | |
else List(WithPK(util.wrap(rq.request, Option(items.toList)))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment