Skip to content

Commit

Permalink
♻ : replace field injection with constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Sep 17, 2021
1 parent 446cdd9 commit 56de233
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/main/java/io/gaia_app/runner/RunnerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.gaia_app.stacks.repository.StackRepository;
import io.gaia_app.stacks.repository.StepRepository;
import io.gaia_app.stacks.workflow.JobWorkflow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException;
Expand All @@ -27,26 +26,35 @@ public class RunnerController {

private static final Logger LOG = Logger.getLogger("RunnerController");

@Autowired
private StackRepository stackRepository;
private final StackRepository stackRepository;

@Autowired
private JobRepository jobRepository;
private final JobRepository jobRepository;

@Autowired
private StepRepository stepRepository;
private final StepRepository stepRepository;

@Autowired
private CredentialsService credentialsService;
private final CredentialsService credentialsService;

@Autowired
private RunnerCommandBuilder runnerCommandBuilder;
private final RunnerCommandBuilder runnerCommandBuilder;

@Autowired
private PlanRepository planRepository;
private final PlanRepository planRepository;

@Autowired
private Settings settings;
private final Settings settings;

public RunnerController(StackRepository stackRepository,
JobRepository jobRepository,
StepRepository stepRepository,
CredentialsService credentialsService,
RunnerCommandBuilder runnerCommandBuilder,
PlanRepository planRepository,
Settings settings) {
this.stackRepository = stackRepository;
this.jobRepository = jobRepository;
this.stepRepository = stepRepository;
this.credentialsService = credentialsService;
this.runnerCommandBuilder = runnerCommandBuilder;
this.planRepository = planRepository;
this.settings = settings;
}

@GetMapping(value = "/stacks/{id}.tfvars", produces = "text/plain")
public String tfvars(@PathVariable String id){
Expand Down

0 comments on commit 56de233

Please sign in to comment.