package com.whyc.controller; import com.github.pagehelper.PageInfo; import com.whyc.dto.ExperimentConditionDTO; import com.whyc.dto.Response; import com.whyc.pojo.Experiment; import com.whyc.pojo.ExperimentBaseData; import com.whyc.pojo.ExperimentBaseDataKZ; import com.whyc.pojo.ExperimentPoint; import com.whyc.service.ExperimentService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("experiment") @Api(tags = "试验") public class ExperimentController { @Autowired private ExperimentService service; @GetMapping("experimentId") @ApiOperation(value = "查询当前试验编号",notes = "传入的type选择其一:" + "绕组:rz,\n" + "空载:kz,\n" + "负载:fz,\n" + "升温:sw,\n" + "超速:cs,\n" + "空载反电动势:kzfdds,\n" + "振动:zd,\n" + "耐压:ny,\n" + "转动惯量:zdgl,\n") public Response getExperimentId(@RequestParam String type){ return service.getExperimentId(type); } @PostMapping("kz") @ApiOperation(value = "新增试验-空载") public Response addKZ(@RequestBody Experiment experiment){ return service.addKZ(experiment); } @GetMapping("checkPrecondition") @ApiOperation(value = "检查前置条件",notes = "传入的type选择其一:" + "绕组:rz,\n" + "空载:kz,\n" + "负载:fz,\n" + "升温:sw,\n" + "超速:cs,\n" + "空载反电动势:kzfdds,\n" + "振动:zd,\n" + "耐压:ny,\n" + "转动惯量:zdgl,\n") public Response checkPrecondition(String type){ return service.checkPrecondition(type); } /*======History======*/ @PostMapping("page") @ApiOperation(value = "查询历史分页-根据条件筛选") public Response> getPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestBody ExperimentConditionDTO condition){ return service.getPage(pageNum,pageSize,condition); } }