Package fr.enedis.chutney.campaign.api
Class CampaignController
java.lang.Object
fr.enedis.chutney.campaign.api.CampaignController
@RestController
@RequestMapping("/api/ui/campaign/v1")
public class CampaignController
extends Object
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCampaignController(TestCaseRepositoryAggregator repositoryAggregator, CampaignRepository campaignRepository, DatasetService datasetService, CampaignExecutionRepository campaignExecutionRepository, ExecutionHistoryRepository executionHistoryRepository, CampaignService campaignService) -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteCampaign(Long campaignId) getCampaignById(Long campaignId) getCampaignExecutionReportById(Long campaignExecutionId) getCampaignsByScenarioId(String scenarioId) getCampaignScenarios(Long campaignId) getLastExecutions(Long limit) saveCampaign(CampaignDto campaign) updateCampaign(CampaignDto campaign)
-
Field Details
-
BASE_URL
- See Also:
-
-
Constructor Details
-
CampaignController
public CampaignController(TestCaseRepositoryAggregator repositoryAggregator, CampaignRepository campaignRepository, DatasetService datasetService, CampaignExecutionRepository campaignExecutionRepository, ExecutionHistoryRepository executionHistoryRepository, CampaignService campaignService)
-
-
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) -
getCampaignExecutionReportById
@PreAuthorize("hasAuthority(\'CAMPAIGN_READ\')") @GetMapping(path="/execution/{campaignExecutionId}", produces="application/json") public CampaignExecutionFullReportDto getCampaignExecutionReportById(@PathVariable("campaignExecutionId") Long campaignExecutionId) -
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)
-