how to inject dependencies to a service with MacWire (play framework)
问题 I have a service class, and the service have one method getSomethingFromApi , now , I want to have play Configuration instance so I can pull stuff from the application.conf, and a play WSClient so I can perform http calls. this is how I want my service to look: class MyApiService { def getSomethingFromApi(whichApi: String): Future[ApiRes] = { wsClient.url(configuration.getString(whichApi)).withHttpHeaders(("Content-Type", "application/json")).get.map { res => response.status match { case