package com.mvc.controller.upgrade;

import com.mvc.model.ResPageModel;
import com.mvc.model.ResultGeekerModel;
import com.mvc.model.upgrade.TUpgradeResultsModel;
import com.mvc.service.upgrade.TUpgradeResultsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.annotation.Resource;

@Api(tags = "升级结果接口")
@RequestMapping("/TUpgradeResultsAction")
@Controller
public class TUpgradeResultsAction {

    @Resource
    private TUpgradeResultsService tUpgradeResultsService;

    @ApiOperation("查询所有升级计划")
    @RequestMapping(value = "/findAllTUpgradeResults",method = RequestMethod.POST)
    @ResponseBody
    public ResultGeekerModel findAllTUpgradeResults(@RequestBody TUpgradeResultsModel model){
        ResultGeekerModel resultModel;
        try {
            ResPageModel res= tUpgradeResultsService.findAllTUpgradeResults(model);
            resultModel=new ResultGeekerModel(res);
        } catch (Exception e) {
            e.printStackTrace();
            resultModel=new ResultGeekerModel(e.getMessage());
        }
        return resultModel;
    }
}
