package com.whyc.controller;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.github.pagehelper.PageInfo;
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.TestPlan;
|
import com.whyc.service.TestPlanService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
@RestController
|
@RequestMapping("testPlan")
|
@Api(tags = "试验计划")
|
@Slf4j
|
public class TestPlanController {
|
@Autowired
|
private TestPlanService service;
|
|
@GetMapping("all")
|
@ApiOperation(value = "查询所有-分页")
|
public Response<IPage<TestPlan>> getAll(@RequestParam int pageNum, @RequestParam int pageSize){
|
return service.getAll(pageNum,pageSize);
|
}
|
@PostMapping("search")
|
@ApiOperation(value = "查询分页-根据筛选条件")
|
public Response<IPage<TestPlan>> getPageByCondition(@RequestParam int pageNum, @RequestParam int pageSize, @RequestBody TestPlan testPlan){
|
return service.getPageByCondition(pageNum,pageSize,testPlan);
|
}
|
|
@GetMapping
|
@ApiOperation(value = "查看详情")
|
public Response getOne(@RequestParam Integer num){
|
return service.getOne(num);
|
}
|
|
|
@PostMapping
|
@ApiOperation(value = "新增")
|
public Response add(@RequestBody TestPlan testPlan){
|
return service.add(testPlan);
|
}
|
@PutMapping
|
@ApiOperation(value = "编辑")
|
public Response update(@RequestBody TestPlan testPlan){
|
return service.update(testPlan);
|
}
|
@PutMapping("startPlan")
|
@ApiOperation(value = "启动计划")
|
public Response startPlan(@RequestParam int num){
|
return service.startPlan(num);
|
}
|
|
}
|