Slide 26
Slide 26 text
case class MyUser(id: UserId, name: Name, birthdate: Birthdate, sex: Sex)
@Singleton
class UserInternalApiClientAntiCorruption @Inject()(clinet: UserInternalApiClient) {
def getUser(): Future[MyUser] = for {
user <- clinet.getUser()
detail <- client.getUserDetail(Random.shuffle(idList).head)
} yield MyUser(
UserId(user.id),
Name(user.name),
Birthdate(detail.birthdate),
Sex(detail.sex)
)
}
@Singleton
class ReturningUserDetailUserCase @Inject()(antiCorruption: UserInternalApiClientAntiCorruption) {
def run(): Future[MyUser] = {
antiCorruption.getUser()
}
}
%#װ"1*ؙٓ؎،ٝزך鵤⽱⦼ך㘗ךתת⢪ְ㔐ׁזְ
ྑ͍ͱߟ͍͑ͯΔॻ͖ํ