Move LocalDate injection to the Actions themselves

We want to make it clear what query (or POST) inputs the user needs to / can give for each Action. That means moving all the @Injects of these parameters to the Actions themselves instead of injecting them in "hidden" indirect dependencies.

This has the extra benefit of allowing these indirect dependencies to work for JSON Actions as well, since the "regular" way we @Inject parameters can corrupt the POST JSON data.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232540758
This commit is contained in:
guyben 2019-02-05 12:55:34 -08:00 committed by jianglai
parent 89802329b3
commit 927e8bbd73
7 changed files with 30 additions and 20 deletions

View file

@ -14,6 +14,7 @@
package google.registry.reporting.spec11;
import static google.registry.reporting.ReportingModule.PARAM_DATE;
import static google.registry.reporting.ReportingUtils.enqueueBeamReportingTask;
import static google.registry.request.Action.Method.POST;
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
@ -30,6 +31,7 @@ import google.registry.config.RegistryConfig.Config;
import google.registry.keyring.api.KeyModule.Key;
import google.registry.reporting.ReportingModule;
import google.registry.request.Action;
import google.registry.request.Parameter;
import google.registry.request.Response;
import google.registry.request.auth.Auth;
import java.io.IOException;
@ -70,7 +72,7 @@ public class GenerateSpec11ReportAction implements Runnable {
@Config("spec11TemplateUrl") String spec11TemplateUrl,
@Config("defaultJobZone") String jobZone,
@Key("safeBrowsingAPIKey") String apiKey,
LocalDate date,
@Parameter(PARAM_DATE) LocalDate date,
Response response,
Dataflow dataflow) {
this.projectId = projectId;