com.didiglobal.logi.security.controller.v1.PermissionController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logi-security-spring-boot-starter Show documentation
Show all versions of logi-security-spring-boot-starter Show documentation
logi-security 提供项目大多都需要的一些基础功能(用户、角色、权限、登录、注册、操作记录)
package com.didiglobal.logi.security.controller.v1;
import com.didiglobal.logi.security.common.constant.Constants;
import com.didiglobal.logi.security.common.Result;
import com.didiglobal.logi.security.common.dto.permission.PermissionDTO;
import com.didiglobal.logi.security.common.vo.permission.PermissionTreeVO;
import com.didiglobal.logi.security.service.PermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author cjm
*/
@RestController
@Api(value = "logi-security-permission相关API接口", tags = "logi-security-权限相关API接口")
@RequestMapping(Constants.API_PREFIX_V1 + "/permission")
public class PermissionController {
@Autowired
private PermissionService permissionService;
@GetMapping("/tree")
@ApiOperation(value = "获取所有权限", notes = "以树的形式返回所有权限")
public Result tree() {
PermissionTreeVO permissionTreeVO = permissionService.buildPermissionTree();
return Result.success(permissionTreeVO);
}
@PostMapping("/import")
@ApiOperation(value = "权限信息导入", notes = "权限信息导入")
public Result imports(
@RequestBody @ApiParam(name = "permissionDTOList", value = "权限信息List") List list) {
permissionService.savePermission(list);
return Result.success();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy