7. 更新教师

接口列表

根据ID获取教师

GET /teacher/<id>

其中 ID 为必填项,其值为教师的 ID

示例数据响应:

  {
    "id": 1,
    "name": "张三",
    "username": "zhangsan",
    "email": "zhangsan@yunzhiclub.com",
    "sex": true
  }

根据ID更新教师

请求头

PUT /teacher/<id>

其中 ID 为必填项,其值为预更教师的 ID

请求主体

  {
    "name": "新的姓名",
    "username": "zhangsan",
    "email": "zhangsan@yunzhiclub.com",
    "sex": true
  }

响应主体

  {
    "id": 1
    "name": "新的姓名",
    "username": "zhangsan",
    "email": "zhangsan@yunzhiclub.com",
    "sex": true
  }