package com.whyc.controller;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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);
|
}
|
|
@GetMapping
|
@ApiOperation(value = "查看详情")
|
public Response getOneByPlanId(@RequestParam Integer planId){
|
return service.getOneByPlanId(planId);
|
}
|
|
|
@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 planId){
|
return service.startPlan(planId);
|
}
|
|
}
|