PartRESTController.java 1.02 KB
Newer Older
akbar fauzi's avatar
akbar fauzi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
package com.eksad.masterdata.controller;

import com.eksad.masterdata.common.dto.responseDto.ResponsePartGetDTO;
import com.eksad.masterdata.service.PartHystrixService;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class PartRESTController {

    @Autowired
    PartHystrixService partHystrixService;

    @RequestMapping(value = "/get.part.by.id/{partID}",
            method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<ResponsePartGetDTO> getPartByPartID(@PathVariable("partID") String partID) {
        return partHystrixService.getPartByPartID(partID);
    }
}