package com.sw.mes.fb.aio.controller;

import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.fb.aio.dto.ProcessingMachineDto;
import com.sw.mes.fb.aio.service.EapGrindingMachineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author wanghao
 * @Date: 2022/6/15
 * @Modified By:
 */
@RestController
@RequestMapping("/prescribingGrinding")
@Slf4j
@Api(description = "开方磨削接口")
public class PrescribingGrindingController {
    @Autowired
    private EapGrindingMachineService eapGrindingMachineService;


    @ApiOperation(value = "获取加工机台编号")
    @PostMapping("/getMachineCode")
    public Result<ProcessingMachineDto> getMachineCode(@ApiParam(value = "晶段编号", type = "query") @RequestParam(value = "sn") String sn) {
        //磨削加工记录
        ProcessingMachineDto processingMachineCode = eapGrindingMachineService.getProcessingMachineCode(sn);
        return ResultGenerator.success(processingMachineCode);
    }


}
