package com.sw.mes.fls.controller;

import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.fls.dto.ProductAssemblyConfigDto;
import com.sw.mes.fls.service.MesToFlsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

/**
 * @Author: GaoXinJian
 * @Date: 2022-02-16 12:26
 */
@RestController
@Api(description = "Mes调用Fls接口")
@RequestMapping("/mesToFlsController")
public class MesToFlsController {

    @Autowired
    MesToFlsService mesToFlsService;

    @ApiOperation(value = "打托配置下发接口")
    @PostMapping("/productAssemblyConfigOut")
    public Result ProductAssemblyConfigOut(@RequestBody ProductAssemblyConfigDto productAssemblyConfigDto){
        try {
           return mesToFlsService.productAssemblyConfigOut(productAssemblyConfigDto);
        }catch (Exception e){
            e.printStackTrace();
            return ResultGenerator.fail(e.getMessage());
        }
    }
}
