package com.mvc.controller.copy;


import com.mvc.model.CorrectMap;
import com.mvc.model.ErrorMap;
import com.mvc.model.TChkrptDetailModel;
import com.mvc.service.copy.TChkrptDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Api(tags = "拷机报告明细接口")
@RequestMapping("/TChkrptAction")
@Controller
public class TChkrptDetailAction {

    @Autowired
    private TChkrptDetailService tChkrptDetailService;

    @ApiOperation("更新拷机报告明细")
    @RequestMapping(value = "/updateTChkrptDetail",method = RequestMethod.POST)
    @ResponseBody
    public Map<String,Object> updateTChkrptDetail(@RequestBody TChkrptDetailModel model){
        try {
            TChkrptDetailModel resModel= tChkrptDetailService.updateTChkrpt(model);
            Map<String,Object> resMap=new CorrectMap();
            resMap.put("res",resModel);
            return resMap;
        } catch (Exception e) {
            e.printStackTrace();
            Map<String,Object> resMap=new ErrorMap();
            resMap.put("error",e.getMessage());
            return resMap;
        }
    }
}
