package com.vctgo.file.controller;

import com.vctgo.file.domain.FileAuthGroup;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.vctgo.common.security.annotation.RequiresPermissions;
import com.vctgo.file.service.IFileAuthGroupService;
import com.vctgo.common.core.web.controller.BaseController;
import com.vctgo.common.core.web.domain.AjaxResult;

import java.util.List;

/**
 * 文件权限分组Controller
 *
 * @author caesar
 * @date 2024-01-31
 */
@RestController
@RequestMapping("/group")
public class FileAuthGroupController extends BaseController {
    @Autowired
    private IFileAuthGroupService fileAuthGroupService;

    @ApiOperation(value = "获取文件权限分组列表根据分组类型")
    @GetMapping(value = "/{groupType}")
    public AjaxResult getGroupList(@PathVariable("groupType") String groupType) {
        List<FileAuthGroup>  fileAuthGroupList =  fileAuthGroupService.getGroupList(groupType);
        return success(fileAuthGroupList);
    }
}
