import {axios} from "@/requests/axios.config";
const prefix = "/group";

function createGroupRule(data){
    return axios.post(`${prefix}/rule`,data);
}

function createGroup(data){
    return axios.post(`${prefix}`,data);
}

function addGroupMember(data){
    return axios.post(`${prefix}/member/add`,data);
}

function findGroup(courseId){
    return axios.get(`${prefix}`,{
        params :{
            courseId,
        }
    });
}

function findAllGroupsByCourse(courseId){
    return axios.get(`${prefix}/all`,{
        params :{
            courseId,
        }
    });
}

function findGroupRule(courseId){
    return axios.get(`${prefix}/rule`,{
        params :{
            courseId,
        }
    });
}

const groupAPIs={
    createGroupRule,
    createGroup,
    addGroupMember,
    findGroup,
    findAllGroupsByCourse,
    findGroupRule,
};

export default groupAPIs;