package com.fjhx.mes.controller.material;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.mes.entity.material.dto.MaterialPreparationSelectDto;
import com.fjhx.mes.entity.material.vo.MaterialPreparationVo;
import com.fjhx.mes.service.material.MaterialPreparationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * <p>
 * 生产备料 前端控制器
 * </p>
 *
 * @author
 * @since 2024-01-11
 */
@RestController
@RequestMapping("/materialPreparation")
public class MaterialPreparationController {

    @Autowired
    private MaterialPreparationService materialPreparationService;

    /**
     * 生产备料分页
     */
    @PostMapping("/page")
    public Page<MaterialPreparationVo> page(@RequestBody MaterialPreparationSelectDto dto) {
        return materialPreparationService.getPage(dto);
    }

    /**
     * 生产备料分页
     */
    @PostMapping("/list")
    public List<MaterialPreparationVo> list(@RequestBody MaterialPreparationSelectDto dto) {
        return materialPreparationService.getList(dto);
    }

}
