package com.rf.psychological.group.service;

import com.rf.psychological.group.dao.dto.GroupAuthConTaskDto;
import com.rf.psychological.group.dao.dto.GroupAuthSubjectNameDto;
import com.rf.psychological.dao.dto.InstitutionAuthConTaskDto;
import com.rf.psychological.dao.dto.InstitutionAuthSubjectNameDto;
import com.rf.psychological.group.dao.model.GroupAuthEntity;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @author lpf
 * @description:
 * @date 26/10/2021下午4:35
 */
public interface GroupAuthService {

    /**
     * 删除组的所有权限
     *
     * @param groupIds
     */
    void deleteAllByGroupId(List<String> groupIds);

    void deleteAuthBath(List<String> ids);

    /**
     * 当机构删除某一权限时，同样删除组权限内的含有这一权限
     *
     * @param institutionNo
     * @param ids
     */
    void deleteGroupAuthBecauseInstitutionDelete(String institutionNo, List<String> ids);

    GroupAuthEntity addGroupAuth(GroupAuthEntity groupAuthEntity);

    Page<GroupAuthSubjectNameDto> findGroupAuth(String groupId, int beginNum, int pageNum, String name);

    Page<GroupAuthConTaskDto> findGroupTaskAuth(String groupId, int beginNum, int pageNum, String name);

    Page<InstitutionAuthSubjectNameDto> findGroupNoAuthList(String institutionNo, String groupId, String searchKey, int beginNum, int pageNum);

    Page<InstitutionAuthConTaskDto> findGroupNoAuthCoTaskList(String institutionNo, String groupId, String searchKey, int beginNum, int pageNum);

    GroupAuthEntity findGroupAuthByGroupIdAndSubjectId(String groupId, String bId);

    void deleteGroupByFlag(String flag);

    void save(List<GroupAuthEntity> authEntityList);
}
