|
|
@@ -0,0 +1,187 @@
|
|
|
+# Problem - 题目
|
|
|
+
|
|
|
+> url 前缀:**problem**
|
|
|
+>
|
|
|
+> 示例:**https://xxxxxxxxx/api/problems/xxxx**
|
|
|
+
|
|
|
+## 获取全部题目分类
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+get /teacher
|
|
|
+```
|
|
|
+
|
|
|
+### Response
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": Array<String>
|
|
|
+}
|
|
|
+```
|
|
|
+- data: 数组形式返回所有题目分类
|
|
|
+
|
|
|
+## 按题目分类获得题目(分页)
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher/{assignmenttype}/problems
|
|
|
+```
|
|
|
+
|
|
|
+### Parameters
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "type": string,
|
|
|
+ "page": number,
|
|
|
+ "num": number,
|
|
|
+}
|
|
|
+```
|
|
|
+- type: 题目分类
|
|
|
+- pageIndex: 当前页数
|
|
|
+- pageNum: 一页的题目数量
|
|
|
+
|
|
|
+### Response
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": Array<ProblemSerializer>
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+see [ProblemSerializer](../serializer/ProblemSerializer.md)
|
|
|
+
|
|
|
+## 根据关键字进行模糊查找
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher
|
|
|
+```
|
|
|
+### Parameters
|
|
|
+
|
|
|
+```json
|
|
|
+//关键字模糊搜索是否分页?
|
|
|
+{
|
|
|
+ "keyword": string,
|
|
|
+ "type": string,
|
|
|
+}
|
|
|
+```
|
|
|
+- type: 题目分类
|
|
|
+- keyword: 关键字
|
|
|
+- pageNum: 一页的题目数量
|
|
|
+
|
|
|
+### Response
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": Array<ProblemSerializer>
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+see [ProblemSerializer](../serializer/ProblemSerializer.md)
|
|
|
+
|
|
|
+## 查看单个题目
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher
|
|
|
+```
|
|
|
+
|
|
|
+###Parameters
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "id": number,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+### Response
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": ProblemSerializer,
|
|
|
+}
|
|
|
+```
|
|
|
+see [ProblemSerializer](../serializer/ProblemSerializer.md)
|
|
|
+
|
|
|
+
|
|
|
+***
|
|
|
+# 以下为二期开发内容
|
|
|
+
|
|
|
+## 上传单个题目
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher
|
|
|
+```
|
|
|
+###Parameters
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": ProblemSerializer,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+###Response
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "id": number,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+see [ProblemSerializer](../serializer/ProblemSerializer.md)
|
|
|
+
|
|
|
+## 更新题目
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher/{problemId}/updateProblem
|
|
|
+```
|
|
|
+###Parameters
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": ProblemSerializer,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+###Response
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "msg": string,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+see [ProblemSerializer](../serializer/ProblemSerializer.md)
|
|
|
+
|
|
|
+## 删除题目
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher/{problemId}/delete
|
|
|
+```
|
|
|
+
|
|
|
+## 更新文件
|
|
|
+
|
|
|
+[TEACHER]
|
|
|
+
|
|
|
+```http
|
|
|
+post /teacher/{problemId}/updatefile
|
|
|
+```
|
|
|
+
|
|
|
+###Parameters
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "data": FileSerializer,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+see [FileSerializer](../serializer/FileSerializer.md)
|