package com.eksad.masterdata.controller; import com.eksad.masterdata.common.dto.WorkOrderOrafinDTO; import com.eksad.masterdata.service.WorkOrderOrafinHystrixService; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; @RestController @Slf4j @RequestMapping("orafin/workorder/") public class WorkOrderOrafinRESTController { @Autowired WorkOrderOrafinHystrixService workOrderOrafinHystrixService; @RequestMapping(value = "dgi-api/v1/inv2/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> postWorkOrderOrafin(@Valid @RequestBody WorkOrderOrafinDTO dto) throws JsonProcessingException { System.out.println(new ObjectMapper().writeValueAsString(dto)); return workOrderOrafinHystrixService.postWorkOrderOrafin(dto); } }