cn.herodotus.stirrup.rest.servlet.upms.controller.security.SysPermissionController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-module-servlet-upms Show documentation
Show all versions of rest-module-servlet-upms Show documentation
Herodotus 软件生态组件库 UPMS 功能 Servlet 环境 REST 接口模块
The newest version!
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2020-2030 郑庚伟 ZHENGGENGWEI (码匠君), Licensed under the AGPL License
*
* This file is part of Herodotus Stirrup.
*
* Herodotus Stirrup is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Herodotus Stirrup is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package cn.herodotus.stirrup.rest.servlet.upms.controller.security;
import cn.herodotus.stirrup.core.definition.domain.Result;
import cn.herodotus.stirrup.data.crud.service.JpaWriteableService;
import cn.herodotus.stirrup.logic.upms.entity.security.SysPermission;
import cn.herodotus.stirrup.logic.upms.service.security.SysPermissionService;
import cn.herodotus.stirrup.web.api.servlet.AbstractJpaWriteableController;
import cn.herodotus.stirrup.web.core.annotation.AccessLimited;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Description: SysPermissionController
*
* @author : gengwei.zheng
* @date : 2020/4/10 13:21
*/
@RestController
@RequestMapping("/security/permission")
@Tags({
@Tag(name = "用户安全管理接口"),
@Tag(name = "系统权限管理接口")
})
public class SysPermissionController extends AbstractJpaWriteableController {
private final SysPermissionService sysPermissionService;
public SysPermissionController(SysPermissionService sysPermissionService) {
this.sysPermissionService = sysPermissionService;
}
@Override
public JpaWriteableService getWriteableService() {
return this.sysPermissionService;
}
@AccessLimited
@Operation(summary = "获取全部权限", description = "获取全部权限数据列表",
responses = {
@ApiResponse(description = "全部数据列表", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Result.class))),
@ApiResponse(responseCode = "204", description = "查询成功,未查到数据"),
@ApiResponse(responseCode = "500", description = "查询失败")
})
@GetMapping("/list")
public Result> findAll() {
List sysAuthorities = sysPermissionService.findAll();
return result(sysAuthorities);
}
}