|
@@ -69,21 +69,21 @@ public class DeployController {
|
|
@PostMapping("/insert")
|
|
@PostMapping("/insert")
|
|
public DeployVO insert(@RequestAttribute AdminSession adminSession,
|
|
public DeployVO insert(@RequestAttribute AdminSession adminSession,
|
|
@Validated(DeployForm.InsertGroup.class) @RequestBody DeployForm form) {
|
|
@Validated(DeployForm.InsertGroup.class) @RequestBody DeployForm form) {
|
|
- adminSession.permissionCheck(Permission.DEPLOY_INSERT);
|
|
|
|
|
|
+ adminSession.hasPermission(Permission.DEPLOY_INSERT);
|
|
return new DeployVO(deployService.insert(form.build()), appService);
|
|
return new DeployVO(deployService.insert(form.build()), appService);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/update")
|
|
@PostMapping("/update")
|
|
public DeployVO update(@RequestAttribute AdminSession adminSession,
|
|
public DeployVO update(@RequestAttribute AdminSession adminSession,
|
|
@Validated(DeployForm.UpdateGroup.class) @RequestBody DeployForm form) {
|
|
@Validated(DeployForm.UpdateGroup.class) @RequestBody DeployForm form) {
|
|
- adminSession.permissionCheck(Permission.DEPLOY_EDIT, form.getId());
|
|
|
|
|
|
+ adminSession.hasPermission(Permission.DEPLOY_EDIT, form.getId());
|
|
return new DeployVO(deployService.update(form.build()), appService);
|
|
return new DeployVO(deployService.update(form.build()), appService);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/device/save")
|
|
@PostMapping("/device/save")
|
|
public Object saveDevice(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
public Object saveDevice(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
@RequestParam MultipartFile deviceInfo, @RequestParam(required = false) String remark) throws Exception {
|
|
@RequestParam MultipartFile deviceInfo, @RequestParam(required = false) String remark) throws Exception {
|
|
- adminSession.permissionCheck(Permission.DEPLOY_DEVICE_EDIT, id);
|
|
|
|
|
|
+ adminSession.hasPermission(Permission.DEPLOY_DEVICE_EDIT, id);
|
|
Deploy deploy = deployService.findById(id);
|
|
Deploy deploy = deployService.findById(id);
|
|
if (deploy != null) {
|
|
if (deploy != null) {
|
|
DeviceInfo info = licenseService.parseDeviceInfo(deviceInfo);
|
|
DeviceInfo info = licenseService.parseDeviceInfo(deviceInfo);
|
|
@@ -102,7 +102,7 @@ public class DeployController {
|
|
@PostMapping("/device/delete")
|
|
@PostMapping("/device/delete")
|
|
public Object deleteDevice(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
public Object deleteDevice(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
@RequestParam String deviceId) throws Exception {
|
|
@RequestParam String deviceId) throws Exception {
|
|
- adminSession.permissionCheck(Permission.DEPLOY_DEVICE_EDIT, id);
|
|
|
|
|
|
+ adminSession.hasPermission(Permission.DEPLOY_DEVICE_EDIT, id);
|
|
Deploy deploy = deployService.findById(id);
|
|
Deploy deploy = deployService.findById(id);
|
|
if (deploy != null) {
|
|
if (deploy != null) {
|
|
deployService.deleteDevice(deploy, deviceId);
|
|
deployService.deleteDevice(deploy, deviceId);
|
|
@@ -126,7 +126,7 @@ public class DeployController {
|
|
public void licenseDownload(@RequestAttribute AdminSession adminSession, HttpServletResponse response,
|
|
public void licenseDownload(@RequestAttribute AdminSession adminSession, HttpServletResponse response,
|
|
@RequestParam Long id, @RequestParam(required = false) String deviceId,
|
|
@RequestParam Long id, @RequestParam(required = false) String deviceId,
|
|
@RequestParam(required = false) String version) throws Exception {
|
|
@RequestParam(required = false) String version) throws Exception {
|
|
- adminSession.permissionCheck(Permission.DEPLOY_LICENSE_DOWNLOAD, id);
|
|
|
|
|
|
+ adminSession.hasPermission(Permission.DEPLOY_LICENSE_DOWNLOAD, id);
|
|
response.setContentType("application/octet-stream; charset=utf-8");
|
|
response.setContentType("application/octet-stream; charset=utf-8");
|
|
response.setHeader("Content-Disposition", "attachment; filename=app.lic");
|
|
response.setHeader("Content-Disposition", "attachment; filename=app.lic");
|
|
licenseService.buildLicense(deployService.findById(id), deviceId, version, response.getOutputStream());
|
|
licenseService.buildLicense(deployService.findById(id), deviceId, version, response.getOutputStream());
|
|
@@ -145,7 +145,7 @@ public class DeployController {
|
|
@PostMapping("/org/update")
|
|
@PostMapping("/org/update")
|
|
public Object updateOrg(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
public Object updateOrg(@RequestAttribute AdminSession adminSession, @RequestParam Long id,
|
|
@RequestParam Long[] orgId) {
|
|
@RequestParam Long[] orgId) {
|
|
- adminSession.permissionCheck(Permission.DEPLOY_ORG_EDIT, id);
|
|
|
|
|
|
+ adminSession.hasPermission(Permission.DEPLOY_ORG_EDIT, id);
|
|
Deploy deploy = deployService.findById(id);
|
|
Deploy deploy = deployService.findById(id);
|
|
if (deploy != null) {
|
|
if (deploy != null) {
|
|
deployService.updateOrg(deploy, orgId);
|
|
deployService.updateOrg(deploy, orgId);
|