-
-
Save anonymous/3a84215bc3492bfcb59de08674e06058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.prod.web; | |
import com.prod.domain.ProductionOrder; | |
import com.prod.service.ProductionOrderService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.List; | |
@RestController | |
@RequestMapping(value = "/api/po") | |
@CrossOrigin(maxAge = 3600) | |
public class ProductionOrderController { | |
@Autowired | |
private ProductionOrderService service; | |
@RequestMapping(value = "/add", method = RequestMethod.POST) | |
public ProductionOrder save(@RequestBody ProductionOrder productionOrder) { | |
return service.savePO(productionOrder); | |
} | |
@RequestMapping(value = "/all", method = RequestMethod.GET) | |
public List<ProductionOrder> list() { | |
return service.findAll(); | |
} | |
@RequestMapping(value = "/{id}") | |
public ProductionOrder findOne(@PathVariable Long id) { | |
return service.findOne(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment