# Problem - 题目 > url 前缀:**question** > > 示例:**https://xxxxxxxxx/api/question/xxxx** ## 获取全部题目分类 [TEACHER] ```http get /teacher/questionType ``` ### Response ```json { "data": Array } ``` see [QuestionTypeSerializer](../serializer/QuestionTypeSerializer.md) ## 按题目分类获得题目(分页) [TEACHER] ```http get /teacher/questions/type?type="xxx"& get /teacher/questions/assignmenttype?type="xxx ``` ### Parameters | Name | Type | Description | | -------- | ------ | ---------------- | | type | String | 题目类型 | | page | number | 当前页数 | | limit | number | 每页的题目数量 | ### Response ```json { "data": Array, "pageNum": number, } ``` - pageNum: 总页数 see [QuestionSerializer](../serializer/QuestionSerializer.md) ### Error ```json { "code": 400, "message": "当前页码超过总页数", } ``` ## 根据作业类型获得题目(分页) [TEACHER] ```http get /teacher/questions ``` ### Parameters | Name | Type | Description | | -------- | ------ | ---------------- | | type | String | 作业类型| | page | number | 当前页数 | | limit | number | 每页的题目数量 | ### Response ```json { "data": Array, "pageNum": number, } ``` - pageNum: 总页数 see [QuestionSerializer](../serializer/QuestionSerializer.md) ### Error ```json { "code": 400, "message": "当前页码超过总页数", } ``` ## 根据关键字进行模糊查找 [TEACHER] ```http get /teacher/keyword ``` ### Parameters | Name | Type | Description | | -------- | ------ | ---------------- | | keyword | String | 用户查找关键字 | ### Response ```json { "data": Array } ``` see [QuestionSerializer](../serializer/QuestionSerializer.md) ## 根据题目ID查看单个题目 ```http get /question/:questionId ``` ### Response ```json { "data": QuestionSerializer, } ``` see [QuestionSerializer](../serializer/QuestionSerializer.md) *** ## 以下为二期开发内容 ## 上传单个题目 [TEACHER] ```http post /teacher/question ``` ### Parameters ```json { "data": QuestionSerializer, } ``` ### Response ```json { "msg": string, "id": number, } ``` ### Error ```json { "code": 400, "message": "题目名称不能重复", } ``` see [QuestionSerializer](../serializer/QuestionSerializer.md) ## 更新题目 [TEACHER] ```http put /teacher/question ``` ###Parameters ```json { "data": QuestionSerializer, } ``` ###Response ```json { "msg": string, } ``` see [QuestionSerializer](../serializer/QuestionSerializer.md) ## 删除题目 [TEACHER] ```http delete /teacher/questionDelete ``` ### Parameters | Name | Type | Description | | -------- | ------ | ---------------- | | questionId | number | 题目ID | ###Response ```json { "msg": string, } ``` ## 更新文件(待定) [TEACHER] ```http put /teacher/fileUpdate ``` see [FileSerializer](../serializer/FileSerializer.md)