注意,班级的父部门必须是年级,也就是说type为1的部门的父部门type值必须是2。如果创建的标准年级为小学二年级,当前为2019年,则系统默认的入学年份为2018年,依次类推。管理员类型须与部门类型保持一致,即校区负责人只能配置到校区部门,班主任和任课老师只能设置到班级。
{
"name": "一年级",
"parentid": 5,
"id": 2,
"type": 1,
"register_year": 2018,
"standard_grade": 1,
"order": 1,
"department_admins": [
{
"userid": "zhangsan",
"type": 4,
"subject": "语文"
},
{
"userid": "lisi",
"type": 3,
"subject": "数学"
}
]
}curl --location -g --request POST 'http://127.0.0.1/cgi-bin/school/department/create?access_token={{accesstoken}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "一年级",
"parentid": 5,
"id": 2,
"type": 1,
"register_year": 2018,
"standard_grade": 1,
"order": 1,
"department_admins": [
{
"userid": "zhangsan",
"type": 4,
"subject": "语文"
},
{
"userid": "lisi",
"type": 3,
"subject": "数学"
}
]
}'{
"errcode": 0,
"errmsg": "string",
"id": 0
}