Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Latest commit

 

History

History
1455 lines (868 loc) · 21.5 KB

api.md

File metadata and controls

1455 lines (868 loc) · 21.5 KB

Api Documentation

Übersicht

Api Documentation

Aktuelle Version

Version : 1.0

Lizenzinformationen

Lizenz : Apache 2.0
Lizenz-URL : http://www.apache.org/licenses/LICENSE-2.0
Nutzungsbedingungen : urn:tos

URI Schema

Host : localhost:8080
Basis-Pfad : /

Tags

  • 学生接口 : Student Controller
  • 教师接口 : Teacher Controller
  • 管理员接口 : Admin Controller

Pfade

控制面板主页

GET /config

Antworten

HTTP Code Beschreibung Typ
200 OK string
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置CAS登陆地址

POST /config/casLoginUrl

Parameter

Typ Name Beschreibung Typ
Query name
verpflichtend
CAS登陆地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置CAS登出地址

POST /config/casLogoutUrl

Parameter

Typ Name Beschreibung Typ
Query name
verpflichtend
CAS登出地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置CAS服务器地址

POST /config/casServerUrl

Parameter

Typ Name Beschreibung Typ
Query name
verpflichtend
CAS服务器地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置文件目录

POST /config/filePath

Parameter

Typ Name Beschreibung Typ
Query name
verpflichtend
文件目录地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

提交初始化方法

POST /config/init

Parameter

Typ Name Beschreibung Typ
Query password
verpflichtend
新密码 string
Query username
verpflichtend
新用户名 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

第一次进入控制面板

GET /config/init

Antworten

HTTP Code Beschreibung Typ
200 OK string
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置本地服务器地址

POST /config/localServerUrl

Parameter

Typ Name Beschreibung Typ
Query name
verpflichtend
本地服务器地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

提交登陆方法

POST /config/login

Parameter

Typ Name Beschreibung Typ
Query password
verpflichtend
密码 string
Query username
verpflichtend
用户名 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

登陆页面

GET /config/login

Antworten

HTTP Code Beschreibung Typ
200 OK string
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置CAS登陆成功跳转地址

POST /config/loginSuccessUrl

Parameter

Typ Name Beschreibung Typ
Query name
verpflichtend
CAS登陆成功跳转地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

注销登陆

GET /config/logout

Antworten

HTTP Code Beschreibung Typ
200 OK string
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置临时目录

POST /config/tempDir

Parameter

Typ Name Beschreibung Typ
Body name
verpflichtend
打包临时目录地址 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

设置用户名密码

POST /config/user

Parameter

Typ Name Beschreibung Typ
Query password
verpflichtend
新密码 string
Query username
verpflichtend
新用户名 string

Antworten

HTTP Code Beschreibung Typ
200 OK string
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 管理员接口

学生作业下载

GET /student/down/{studentNumber}/{workId}

Parameter

Typ Name Beschreibung Typ
Header range
verpflichtend
Range请求头(用于判断是否需要支持多线程下载和断点续传) string
Path studentNumber
verpflichtend
学号 string
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 学生接口

学生加入群组

POST /student/group

Parameter

Typ Name Beschreibung Typ
Query code
verpflichtend
邀请码 string

Antworten

HTTP Code Beschreibung Typ
200 OK Group
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 学生接口

查询学生是否有学生群组

GET /student/group/exist

Antworten

HTTP Code Beschreibung Typ
200 OK RestModel
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 学生接口

退出群组

DELETE /student/group/{groupId}

Parameter

Typ Name Beschreibung Typ
Path groupId
verpflichtend
群组ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
204 No Content Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 学生接口

获取学生所有群组

GET /student/groups

Antworten

HTTP Code Beschreibung Typ
200 OK < Group > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 学生接口

根据作业ID获取上传信息

GET /student/upload/{workId}

Parameter

Typ Name Beschreibung Typ
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Upload
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 学生接口

学生上传作业

POST /student/work/{workId}

Parameter

Typ Name Beschreibung Typ
Path workId
verpflichtend
作业ID string
FormData file
verpflichtend
上传的作业 file

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • multipart/form-data

Erzeugt

  • \*/*

Tags

  • 学生接口

学生删除已上传作业

DELETE /student/work/{workId}

Parameter

Typ Name Beschreibung Typ
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
204 No Content Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 学生接口

获取学生所有已上传作业

GET /student/works/done

Antworten

HTTP Code Beschreibung Typ
200 OK < WorkModel > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 学生接口

获取学生所有未上传作业

GET /student/works/un_done

Antworten

HTTP Code Beschreibung Typ
200 OK < WorkModel > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 学生接口

下载所有

GET /teacher/down/{workId}

Parameter

Typ Name Beschreibung Typ
Header range
verpflichtend
Range请求头(用于判断是否需要支持多线程下载和断点续传) string
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 教师接口

新建群组

POST /teacher/group

Parameter

Typ Name Beschreibung Typ
Query groupName
verpflichtend
教师添加的组名 string

Antworten

HTTP Code Beschreibung Typ
200 OK Group
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

查询教师是否有群组

GET /teacher/group/exist

Antworten

HTTP Code Beschreibung Typ
200 OK RestModel
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

删除群组

DELETE /teacher/group/{id}

Parameter

Typ Name Beschreibung Typ
Path id
verpflichtend
要删除的群组ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
204 No Content Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 教师接口

更新群组

PATCH /teacher/group/{id}/{name}

Parameter

Typ Name Beschreibung Typ
Path id
verpflichtend
群组id string
Path name
verpflichtend
修改的新群组名 string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
204 No Content Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 教师接口

教师获取创建的所有群组

GET /teacher/groups

Antworten

HTTP Code Beschreibung Typ
200 OK < Group > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

打包

GET /teacher/pack/{workId}

Beschreibung

下载所有作业之前必须先调用该API

Parameter

Typ Name Beschreibung Typ
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK RestModel
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 教师接口

添加作业

POST /teacher/work

Parameter

Typ Name Beschreibung Typ
Query groupId
verpflichtend
群ID string
Query workName
verpflichtend
作业名 string

Antworten

HTTP Code Beschreibung Typ
200 OK Work
201 Created Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

根据群ID获取作业

GET /teacher/work/{groupId}

Parameter

Typ Name Beschreibung Typ
Path groupId
verpflichtend
群ID string

Antworten

HTTP Code Beschreibung Typ
200 OK < WorkModel > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

删除作业

DELETE /teacher/work/{workId}

Parameter

Typ Name Beschreibung Typ
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
204 No Content Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt

Erzeugt

  • \*/*

Tags

  • 教师接口

更新作业启用状态

PATCH /teacher/work/{workId}/{enabled}

Parameter

Typ Name Beschreibung Typ
Path enabled
verpflichtend
开启状态 string
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK Kein Inhalt
204 No Content Kein Inhalt
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt

Verarbeitet

  • application/json

Erzeugt

  • \*/*

Tags

  • 教师接口

获取作业详情

GET /teacher/work_detail/{workId}

Parameter

Typ Name Beschreibung Typ
Path workId
verpflichtend
作业ID string

Antworten

HTTP Code Beschreibung Typ
200 OK < WorkDetailsModel > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

获取教师所有作业

GET /teacher/works

Antworten

HTTP Code Beschreibung Typ
200 OK < WorkModel > array
401 Unauthorized Kein Inhalt
403 Forbidden Kein Inhalt
404 Not Found Kein Inhalt

Erzeugt

  • \*/*
  • application/json;charset=UTF-8

Tags

  • 教师接口

Definitionen

Callable«ResponseEntity«RestModel»»

Typ : object

Group

群组

Name Beschreibung Typ
code
verpflichtend
邀请码 string
gmtCreate
verpflichtend
创建时间 string (date-time)
gmtModified
verpflichtend
更新时间 string (date-time)
groupName
verpflichtend
群组名 string
id
verpflichtend
群组ID string
teacherName
verpflichtend
教师名 string
teacherNumber
verpflichtend
教师序号 string

RestModel

Rest 返回消息

Name Beschreibung Typ
code
verpflichtend
状态码 integer (int32)
data
verpflichtend
数据 object
msg
verpflichtend
消息 string

Student

用于存储学生元数据的实体

Name Beschreibung Typ
clazzId
optional
班级 string
loginName
optional
登录名 string
name
optional
姓名 string
no
verpflichtend
学号 string

Upload

上传

Name Beschreibung Typ
extensionName
verpflichtend
扩展名 string
gmtCreate
verpflichtend
创建时间 string (date-time)
gmtModified
verpflichtend
更新时间 string (date-time)
mime
verpflichtend
文件类型 string
size
verpflichtend
文件大小(bytes) integer (int64)
studentId
verpflichtend
学生ID string
workId
verpflichtend
作业ID string

Work

作业

Name Beschreibung Typ
enabled
verpflichtend
作业启用状态 boolean
fileNameFormat
verpflichtend
文件名规范 string
gmtCreate
verpflichtend
创建时间 string (date-time)
gmtModified
verpflichtend
更新时间 string (date-time)
groupId
verpflichtend
群组ID,该作业所属群 string
id
verpflichtend
作业ID,标识唯一作业 string
workName
verpflichtend
作业名 string

WorkDetailsModel

作业详情

Name Beschreibung Typ
groupName
verpflichtend
群组名 string
student
verpflichtend
学生信息 Student
up
verpflichtend
是否上传 boolean
upload
verpflichtend
上传信息 Upload
workName
verpflichtend
作业名 string

WorkModel

作业模型

Name Beschreibung Typ
enabled
optional
boolean
fileNameFormat
verpflichtend
文件名规范 string
gmtCreate
verpflichtend
创建时间 string (date-time)
gmtModified
verpflichtend
更新时间 string (date-time)
groupId
verpflichtend
群组ID,该作业所属群 string
groupName
verpflichtend
群组名 string
id
verpflichtend
作业ID,标识唯一作业 string
teacherName
verpflichtend
教师名 string
workName
verpflichtend
作业名 string