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")));
|
}
|
}
|