whyczh
2021-03-26 03931e63dbbd79be8d8e29d496f3b2d5ce1c1bc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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);
    }
 
}