whyclxw
2022-01-05 700d30d541fa85357fdd80cecb8ff8c5baff2ae8
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.whyc.dto.Response;
import com.whyc.pojo.BaoJiGroup;
import com.whyc.service.BaoJiGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
 
@RestController
@RequestMapping("baoJiGroup")
@Api(tags = "用户管理-包机组")
public class BaoJiGroupController {
 
    @Autowired
    private BaoJiGroupService service;
 
    @PostMapping
    @ApiOperation(value = "新增")
    public Response add(@RequestParam String groupName){
        service.add(groupName);
        return new Response().setII(1,"新增成功");
    }
 
    @PutMapping
    @ApiOperation(value = "修改")
    public Response update(@RequestBody BaoJiGroup baoJiGroup){
        service.update(baoJiGroup);
        return new Response().setII(1,"修改成功");
    }
 
    @DeleteMapping
    @ApiOperation(value = "删除")
    public Response delete(@RequestParam long baoJiGroupId){
        service.delete(baoJiGroupId);
        return new Response().setII(1,"删除成功");
    }
 
    @GetMapping("list")
    @ApiOperation(value = "包机组列表")
    public Response<List<BaoJiGroup>> getBaoJiGroupList(){
        List<BaoJiGroup> baoJiGroupList = service.getBaoJiGroup();
        return new Response<List<BaoJiGroup>>().set(1,baoJiGroupList);
    }
 
}