AcademyPermissionMappingController.java 2.46 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.company.GetServiceCompaniesDTO;
import com.subsidy.dto.permission.GetPermissionAcademiesDTO;
import com.subsidy.dto.permission.PermissionAcademiesDTO;
import com.subsidy.dto.service.CancelAuthDTO;
import com.subsidy.service.AcademyPermissionMappingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

/**
 * <p>
 * 院校权限映射表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2025-01-20
 */
@RestController
@Api(tags = "院校权限映射表")
@RequestMapping("/academyPermissionMapping")
public class AcademyPermissionMappingController {

    @Autowired
    private AcademyPermissionMappingService academyPermissionMappingService;

    @PostMapping("getPermissionAcademies")
    @ApiOperation("获取某个业务下的院校(筛选可查全部的)   permissionId  权限id pageSize  authStatus  pageNum  academyName")
    public ResponseVO getPermissionAcademies(@RequestBody GetPermissionAcademiesDTO getPermissionAcademiesDTO){
        return ResponseData.generateCreatedResponse(0,academyPermissionMappingService.getPermissionAcademies(getPermissionAcademiesDTO));
    }

    @PostMapping("cancelAuth")
    @ApiOperation("取消授权  permissionId academyIds[]")
    public ResponseVO cancelAuth(@RequestBody CancelAuthDTO cancelAuthDTO){
        return ResponseData.generateCreatedResponse(0,academyPermissionMappingService.cancelAuth(cancelAuthDTO));
    }

    @PostMapping("addAuth")
    @ApiOperation("添加授权  permissionId academyIds[]")
    public ResponseVO addAuth(@RequestBody CancelAuthDTO cancelAuthDTO){
        return ResponseData.generateCreatedResponse(0,academyPermissionMappingService.addAuth(cancelAuthDTO));
    }

    @PostMapping("permissionAcademies")
    @ApiOperation("获取某个业务管理下的所有院校   academyName  permissionId")
    public ResponseVO permissionAcademies(@RequestBody PermissionAcademiesDTO permissionAcademiesDTO){
        return ResponseData.generateCreatedResponse(0,academyPermissionMappingService.permissionAcademies(permissionAcademiesDTO));
    }


}