package com.sw.mes.wms.controller;

import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.wms.dto.FbRatingResultDto;
import com.sw.mes.wms.service.RatingResultService;
import com.sw.mes.wms.utils.ResultWmsDto;
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;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author wanghao
 * @Date: 2022/6/10
 * @Modified By:
 */
@RestController
@Api(description = "Mes调用Wms接口")
@RequestMapping("/mesToWmsController")
public class MesToWmsController {
    @Autowired
    private RatingResultService ratingResultService;

    @ApiOperation(value = "评级结果下发接口")
    @PostMapping("/ratingResult")
    public Result ratingResult(@RequestBody FbRatingResultDto fbRatingResultDto, HttpServletRequest request) {
        ResultWmsDto resultWmsDto = ratingResultService.ratingResult(fbRatingResultDto);

        return ResultGenerator.success();
    }
}
