Class ModelController

java.lang.Object
com.easy_model.webservice.model.ModelController

@RestController @Transactional public class ModelController extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • cypress

      @GetMapping("/api/cypress/{modelId}") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<List<String>> cypress(@PathVariable("modelId") Model model)
      Printing code for an entire model to use in FullModelTest
    • createModelFromEnin

      @PostMapping("/api/modelenin") public org.springframework.http.ResponseEntity<Long> createModelFromEnin(@RequestBody @Valid @Valid CompanyNameRecord companyNameRecord, @RequestParam Integer startYear, @RequestParam(defaultValue="Valuation model") String modelName, @RequestParam(defaultValue="false") boolean doImportGroupFigures, @RequestParam(defaultValue="1000") Integer unitDivider, Principal principal)
    • addModel

      @PostMapping("/api/model") @PreAuthorize("authentication.principal.hasAccessToTemplate(#templateId)") public org.springframework.http.ResponseEntity<Long> addModel(@RequestBody @Valid @Valid ModelData modelData, @RequestParam(required=false,defaultValue="-1") Long templateId, @RequestParam(required=false,defaultValue="true") boolean copyVariableValues, Principal principal)
    • lockModel

      @PatchMapping("/api/model/{modelId}/lock") @PreAuthorize("authentication.principal.hasModelRole(#model,\'ADMIN\')") public org.springframework.http.ResponseEntity<String> lockModel(@PathVariable("modelId") Model model, Principal principal)
    • unlockModel

      @PatchMapping("/api/model/{modelId}/unlock") @PreAuthorize("authentication.principal.canUnlock(#model,\'ADMIN\')") public org.springframework.http.ResponseEntity<String> unlockModel(@PathVariable("modelId") Model model, Principal principal)
    • updateModel

      @PutMapping("/api/model/{modelId}") @PreAuthorize("authentication.principal.hasModelRole(#model,\'ADMIN\')") public org.springframework.http.ResponseEntity<String> updateModel(@PathVariable("modelId") Model model, @RequestBody @Valid @Valid ModelData modelData, Principal principal)
    • initiateFormulas

      public void initiateFormulas(Model model)
    • deleteModel

      @DeleteMapping("/api/model/{modelId}") @PreAuthorize("authentication.principal.hasModelRole(#model,\'ADMIN\')") public org.springframework.http.ResponseEntity<Void> deleteModel(@PathVariable("modelId") Model model, Principal principal)
    • updateKeyParam

      @PutMapping("/api/model/{modelId}/keyparam") @PreAuthorize("authentication.principal.hasModelRole(#model,\'EDITOR\')") public org.springframework.http.ResponseEntity<String> updateKeyParam(@PathVariable("modelId") Model model, @RequestBody @Valid @Valid KeyParam keyParam, Principal principal)
    • getMetadata

      @GetMapping("/api/model/{modelId}/metadata") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<CalculationData> getMetadata(@PathVariable("modelId") Model model, @RequestParam(defaultValue="0") Integer scenarioNumber)
      Returns:
      an object that contains all the metadata of the model
    • getCalculation

      @GetMapping("/api/model/{modelId}/calculation") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<CalculationData> getCalculation(@PathVariable("modelId") Model model, @RequestParam(defaultValue="0") Integer scenarioNumber)
      Returns:
      an object that contains all the processed data in the spreadsheet
    • debug

      @GetMapping("/api/ping") public String debug()
    • getComparison

      @GetMapping("/api/model/{modelId}/comparison") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<ScenarioComparison> getComparison(@PathVariable("modelId") Model model)
      Returns:
      an object that contains all the data in the spreadsheet