package com.sqx.modules.material.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.material.entity.Material;
import com.sqx.modules.material.entity.MaterialArtificer;
import com.sqx.modules.material.entity.MaterialMassage;
import com.sqx.modules.material.entity.MaterialRecord;
import com.sqx.modules.material.service.MaterialArtificerService;
import com.sqx.modules.material.service.MaterialMassageService;
import com.sqx.modules.material.service.MaterialRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@Api(value = "物料包历史记录", tags = {"物料包"})
@RequestMapping(value = "/materialRecord")
public class MaterialRecordController {

    @Autowired
    private MaterialRecordService materialRecordService;
    /**
     * 查询物料包历史记录
     *
     * @return 返回集合，没有返回空List
     */
    @GetMapping("list")
    @ApiOperation("查询物料包历史记录")
    public Result listAll(Integer page, Integer limit, MaterialRecord materialRecord) {
        return materialRecordService.selectPage(page,limit, materialRecord);
    }
    /**
     * 历史记录新增
     *
     * @return 成功返回1失败打返回error
     */
    @GetMapping("addMaterialRecord")
    @ApiOperation("历史记录新增")
    public Result addMaterialRecord(MaterialRecord materialRecord) {
        return materialRecordService.addMaterialRecord(materialRecord);
    }
}