Junjie
8 小时以前 8bfe1168a42d4e3750a15b0c0fb0a7629d6cf91c
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
package com.zy.system.controller;
 
import com.core.annotations.ManagerAuth;
import com.core.common.R;
import com.zy.common.web.BaseController;
import com.zy.system.domain.param.HighPrivilegeGrantParam;
import com.zy.system.model.HighPrivilegeGrantStatus;
import com.zy.system.service.HighPrivilegeGrantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
public class HighPrivilegeGrantController extends BaseController {
 
    @Autowired
    private HighPrivilegeGrantService highPrivilegeGrantService;
 
    @PostMapping("/highPrivilege/grant/auth")
    @ManagerAuth(memo = "最高权限授权")
    public R grant(@RequestBody HighPrivilegeGrantParam param) {
        HighPrivilegeGrantStatus status = highPrivilegeGrantService.grant(request.getHeader("token"), param);
        return R.ok().add(status);
    }
 
    @GetMapping("/highPrivilege/status/auth")
    @ManagerAuth
    public R status() {
        return R.ok().add(highPrivilegeGrantService.getStatus(request.getHeader("token")));
    }
}