whycxzp
2021-11-11 7dde590f5d9048a14939bec400bd38859e33bdf8
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.BaoJiGroup;
import com.whyc.service.BaoJiGroupUserService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.swing.*;
import java.util.List;
 
/**
 * 包机组-用户
 */
@RestController
@RequestMapping("baoJiGroupUser")
@Api(tags = "包机组-用户")
public class BaoJiGroupUserController {
 
    @Autowired
    private BaoJiGroupUserService service;
 
    @GetMapping("groupAndUser")
    @ApiOperation(value = "查询所有的包机组和对应用户")
    public Response<List<BaoJiGroup>> getGroupAndUserList(){
        return new Response<List<BaoJiGroup>>().set(1,service.getGroupAndUserList());
    }
 
    @GetMapping("groupAndUserListOfCurrentUser")
    @ApiOperation(value = "查询当前用户的所有包机组和对应用户")
    public Response<List<BaoJiGroup>> getGroupAndUserListOfCurrentUser(){
        Long userId = ActionUtil.getUser().getUId();
        return new Response<List<BaoJiGroup>>().set(1,service.getGroupAndUserListOfCurrentUser(userId));
    }
 
 
}