jiangqs
2023-07-15 b0b52cbabf7a4bc8e00fc328d14ac05336d0221e
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
package com.ruoyi.system.controller.conslole;
 
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.domain.pojo.staff.SysStaff;
import com.ruoyi.system.service.staff.SysStaffService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * @author cheny
 */
@Api(value = "平台端员工相关接口", tags = "平台端员工相关接口", description = "平台端员工相关接口")
@RestController
@RequestMapping("/staff")
public class StaffController {
    @Resource
    private SysStaffService sysStaffService;
 
    @RequestMapping(value = "/isLeader", method = RequestMethod.POST)
    @ApiOperation(value = "获取员工信息")
    public Boolean isLeader() {
        Long userId = SecurityUtils.getUserId();
        SysStaff sysStaff = sysStaffService.getByUserId(userId);
        if(null!=sysStaff){
            return sysStaffService.getByUserId(userId).getHeadFlag().equals("1") ? true : false;
        }
        return false;
    }
}