All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.didiglobal.logi.security.controller.v1.PermissionController Maven / Gradle / Ivy

Go to download

logi-security 提供项目大多都需要的一些基础功能(用户、角色、权限、登录、注册、操作记录)

There is a newer version: 2.10.19
Show newest version
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 = "permission相关API接口", tags = "权限相关API接口")
@RequestMapping(Constants.V1 + "/logi-security/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