import { fetch, post } from '@/api/http'
export default {
    schoolSettingSaveOrUpdate: function (data) {
        return post('/school/init/upsert', data)
    },
    findSchoolSystem: function (data) {
        return post('/school/init/find', data)
    },
    findClassInfo: function (data) {
        return post('/school/classroom/find', data)
    },
    findSchoolBase: function(schoolCode) {
        let format = {
            "school_code": schoolCode
        }
        return post('/school/init/get-school-base', format)
    },
    //更新或新增教室
    classUpsert: function (data) {
        return post('/school/classroom/upsert', data)
    },
    dataDefault: function (data) {
        return post('/api/Common/DataDefault', data)
    },
    /**
     * 删除教室
     * @param {any} data
     */
    delClassroom: function (data) {
        return post('/school/classroom/delete', data)
    },

    // 取得老師个人相關數據
    getTeacherInfo: function (data) {
        return post('/teacher/init/get-teacher-info', data)
    },

    // 取得數據中心當前所有學校名單
    getSchoolList: function (data) {
        data = (data == null) ? {} : data
        return post('/teacher/init/get-school-list', data)
    },

    // 取得數據中心當前所有學校名單
    joinSchool: function (data) {
        return post('/teacher/init/join-school', data)
    },

    //获取教室关联的学生
    getClassroomStudent: function (data) {
        return post('/school/classroom/find-students', data)
    },
	
	/* 根据班级ID查询所有的学生名单 */
	getStusByClassId: function (data) {
        return post('/school/classroom/find-new-students', data)
    },

    //保存分组信息
    upsertGroup: function (data) {
        return post('/school/classroom/upsert-group', data)
    },

    // Hiteach 與教室連接
    hiteachLink: function (data) {
        return post('/school/classroom/hiteach-link', data)
    },

    // 指定教室切斷 Hiteach 連接
    hiteachUnlinkByClassId: function (data) {
        return post('/school/classroom/hiteach-unlink-classId', data)
    },

    //根据私有班级id集合查询班级详细信息
    getClassByIds: function (data) {
        return post('/school/classroom/name', data)
    },
	
	// 申请建立学校
	applySchool:function (data) {
        return post('/core/apply-school', data)
    },
	
	setDefaultSch:function (data) {
        return post('/teacher/init/set-teacher-info', data)
    },
    //转让管理员身份
    TransferAdminRole:function (data) {
        return post('/teacher/init/set-teacher-info', data)
    },
    // 查询教研组
    FindTchGroup:function (data) {
        return post('/tchlist/get-research-list', data)
    },
    // 创建或修改教研组
    UpsertTchGroup:function (data) {
        return post('/tchlist/upsert-list', data)
    },
    // 删除教研组
    DelTchGroup:function (data) {
        return post('/tchlist/delete-list', data)
    },
}
