mirror of
https://github.com/google/nomulus.git
synced 2025-06-28 07:13:34 +02:00
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:
parent
89802329b3
commit
927e8bbd73
7 changed files with 30 additions and 20 deletions
|
@ -15,6 +15,7 @@
|
|||
package google.registry.reporting.spec11;
|
||||
|
||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
import static google.registry.reporting.ReportingModule.PARAM_DATE;
|
||||
import static google.registry.request.Action.Method.POST;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED;
|
||||
|
@ -83,7 +84,7 @@ public class PublishSpec11ReportAction implements Runnable {
|
|||
Spec11RegistrarThreatMatchesParser spec11RegistrarThreatMatchesParser,
|
||||
Dataflow dataflow,
|
||||
Response response,
|
||||
LocalDate date) {
|
||||
@Parameter(PARAM_DATE) LocalDate date) {
|
||||
this.projectId = projectId;
|
||||
this.registryName = registryName;
|
||||
this.jobId = jobId;
|
||||
|
@ -148,7 +149,7 @@ public class PublishSpec11ReportAction implements Runnable {
|
|||
spec11RegistrarThreatMatchesParser.getRegistrarThreatMatches(date);
|
||||
String subject = String.format("%s Monthly Threat Detector [%s]", registryName, date);
|
||||
emailUtils.emailSpec11Reports(
|
||||
Spec11EmailSoyInfo.MONTHLY_SPEC_11_EMAIL, subject, monthlyMatchesSet);
|
||||
date, Spec11EmailSoyInfo.MONTHLY_SPEC_11_EMAIL, subject, monthlyMatchesSet);
|
||||
}
|
||||
|
||||
private void processDailyDiff(LocalDate previousDate) throws IOException, JSONException {
|
||||
|
@ -158,6 +159,7 @@ public class PublishSpec11ReportAction implements Runnable {
|
|||
spec11RegistrarThreatMatchesParser.getRegistrarThreatMatches(date);
|
||||
String dailySubject = String.format("%s Daily Threat Detector [%s]", registryName, date);
|
||||
emailUtils.emailSpec11Reports(
|
||||
date,
|
||||
Spec11EmailSoyInfo.DAILY_SPEC_11_EMAIL,
|
||||
dailySubject,
|
||||
getNewMatches(previousMatches, currentMatches));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue