com.fivefaces.structureclient.controller.UtilsController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-structure-client Show documentation
Show all versions of common-structure-client Show documentation
structure Client for Five Faces
package com.fivefaces.structureclient.controller;
import com.fivefaces.common.exception.ItemNotFoundException;
import com.fivefaces.structure.schema.StructureSchema;
import com.fivefaces.structure.service.StructureSchemaLoader;
import com.fivefaces.structureclient.domain.StructureSchemaWorkflowScaffold;
import com.fivefaces.structureclient.service.statemachine.ScaffoldStateMachineResult;
import com.fivefaces.structureclient.service.statemachine.ScaffoldStateMachineService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RequiredArgsConstructor
@RestController
@RequestMapping("/utils")
@Slf4j
public class UtilsController extends AbstractStructureController {
private final ScaffoldStateMachineService scaffoldStateMachineService;
private final StructureSchemaLoader structureSchemaLoader;
private final StructureSchemaWorkflowScaffold structureSchemaWorkflowScaffold;
@PostMapping("/stateMachine/englishToAws")
@ResponseBody
public ResponseEntity englishToAws(@RequestBody Map input) throws Exception {
return ResponseEntity.ok(scaffoldStateMachineService.scaffold(input.get("query")));
}
@PostMapping("/structures/scaffold")
@ResponseBody
public ResponseEntity