package easydo.technology.controller;

import easydo.technology.model.vo.ProductPrePlanVO;
import easydo.technology.service.ProductPrePlanService;
import org.springframework.http.HttpStatus;
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.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/productPrePlan")
public class ProductPrePlanController {

    @Resource
    private ProductPrePlanService productPrePlanService;

    @RequestMapping(value = "/getPage")
    public Object getPage(@RequestBody Map<String, Object> map) throws Exception {
        Map<String, Object> result = productPrePlanService.getPage(map);
        return new ResponseEntity<>(result, HttpStatus.OK);
    }

    @RequestMapping(value = "/save")
    public Object save(@RequestBody ProductPrePlanVO vo) throws Exception {
        return new ResponseEntity<>(productPrePlanService.save(vo), HttpStatus.OK);
    }
}
