Package com.chutneytesting.campaign.api
Class CampaignController
java.lang.Object
com.chutneytesting.campaign.api.CampaignController
@RestController
@RequestMapping("/api/ui/campaign/v1")
@CrossOrigin(origins="*")
public class CampaignController
extends Object
-
Constructor Summary
ConstructorsConstructorDescriptionCampaignController(TestCaseRepositoryAggregator repositoryAggregator, CampaignRepository campaignRepository, CampaignExecutionEngine campaignExecutionEngine) -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteCampaign(Long campaignId) getCampaignById(Long campaignId) getCampaignsByScenarioId(String scenarioId) getCampaignScenarios(Long campaignId) getLastExecutions(Long limit) saveCampaign(CampaignDto campaign) updateCampaign(CampaignDto campaign)
-
Constructor Details
-
CampaignController
public CampaignController(TestCaseRepositoryAggregator repositoryAggregator, CampaignRepository campaignRepository, CampaignExecutionEngine campaignExecutionEngine)
-
-
Method Details
-
saveCampaign
@PreAuthorize("hasAuthority(\'CAMPAIGN_WRITE\')") @PostMapping(path="", consumes="application/json", produces="application/json") public CampaignDto saveCampaign(@RequestBody CampaignDto campaign) -
updateCampaign
@PreAuthorize("hasAuthority(\'CAMPAIGN_WRITE\')") @PutMapping(path="", consumes="application/json", produces="application/json") public CampaignDto updateCampaign(@RequestBody CampaignDto campaign) -
deleteCampaign
@PreAuthorize("hasAuthority(\'CAMPAIGN_WRITE\')") @DeleteMapping(path="/{campaignId}", produces="application/json") public boolean deleteCampaign(@PathVariable("campaignId") Long campaignId) -
getCampaignById
@PreAuthorize("hasAuthority(\'CAMPAIGN_READ\')") @GetMapping(path="/{campaignId}", produces="application/json") public CampaignDto getCampaignById(@PathVariable("campaignId") Long campaignId) -
getCampaignScenarios
@PreAuthorize("hasAuthority(\'CAMPAIGN_READ\')") @GetMapping(path="/{campaignId}/scenarios", produces="application/json") public List<TestCaseIndexDto> getCampaignScenarios(@PathVariable("campaignId") Long campaignId) -
getAllCampaigns
@PreAuthorize("hasAuthority(\'CAMPAIGN_READ\')") @GetMapping(path="", produces="application/json") public List<CampaignDto> getAllCampaigns() -
getLastExecutions
@PreAuthorize("hasAuthority(\'CAMPAIGN_READ\')") @GetMapping(path="/lastexecutions/{limit}", produces="application/json") public List<CampaignExecutionReportDto> getLastExecutions(@PathVariable("limit") Long limit) -
getCampaignsByScenarioId
@PreAuthorize("hasAuthority(\'SCENARIO_READ\')") @GetMapping(path="/scenario/{scenarioId}", produces="application/json") public List<CampaignDto> getCampaignsByScenarioId(@PathVariable("scenarioId") String scenarioId)
-