Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2016 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3a84215bc3492bfcb59de08674e06058 to your computer and use it in GitHub Desktop.
Save anonymous/3a84215bc3492bfcb59de08674e06058 to your computer and use it in GitHub Desktop.
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