出错返回非正常的httpcode,错误信息为:
{
errorCode:[int],
message:[string]
}
@Get user/login?username=xxxx&password=xxxx
@Return {
userId: [string] 用户Id,
username:用户名,
nickname:昵称,
signature:用户签名,
avatarUrl:头像地址
}
@Post user/register
@Body {
username:用户名,
nickname: 昵称,
password:密码 ,
signature: 签名,
classname: 专业班级,
avatar: [file] 上传图片
}
@Return {
userId:[string] 用户Id
}
@Put account/logout
@Return {}
@Get users
@Return [{
rank: [int] 排第几名,
userId:用户Id,
username,
nickname,
signature,
classname,
static:{
ac:[int] AC题数
submit:[int] 提交数
}
}]
@Get users/:userId
@Return {
username,
nickname,
signature,
avatarUrl,
classname,
solved:[{problemId}] //ac的题目列表
}
@Get problems
@Return [{
problemId,
title,
tags:['Math','Dp'...]//题目标签
difficulty,//难易度
static:{
ac:[int] AC题数
submit:[int] 提交数
}
date // 更新时间
}]
@Get problems/:problemId
@Return {
problemId,
title,
timelimit:{java,others},
memorylimit:{java, others}
description,
input,
output,
source,
static:{
ac:[int] AC题数
submit:[int] 提交数
}
}
###添加题目
@Post problems
@Body {
title,
timelimit:{java,others},
memorylimit:{java, others}
description,
input,
output,
source,
files, //测试数据文件
specialTest //special judge程序
show:true|false //是否在练习列表里面显示
contestId:null, //将该题添加到contestId的竞赛中
}
@Return {
problemId
}
@Put problems/:problemId
@Body{
//同添加题目
}
@Return {}
@Post problems/:problemId/submit
@Body {
compiler:''//语言
code
}
@Return {
submissionId //提交Id
}
@Put problems/:problemId/rejudge
@Return {}
@Get problems/search?name=xxxx
@Return //同题目列表
@Delete problems/:problemId
@Return {}
@Get submissions
@Query {pageSize,pageIndex}
@Return [{
userId,
username,
problemId,
verdict,//评测结果
time,
memory,
compiler,//使用的编译语言
codeLength,
submitTime,
compileError:'xxxx' //编译错误详情
}]
@Put submissions/:submissionId/rejudge
@Get contests
@Query {pageSize,pageIndex}
@Return {
contestId,
title,
startTime,
status,
host:[string]举办人
}
@Get contests/:contestId
@Return {
title,
startTime,
endTime,
host:[string]举办人
}
@Get contests/:contetId/problems
@Return [{
problemOrder,
title,
static:static:{ac,submit}
}]
@Get contests/:contestId/standing
@Return [
{
rank:[int] 排名,
userId,
solved,
time,
nickname,
status:{
problemOrder1:{
time,
penalty
},
problemOrder2:{
time,
penalty
}
...
}
}
]
@Get contests/:contestId/problems/:problemOrder
@Return {
problemId, //返回一个problemId方法以便调用problems/:problemId/submit方法提交代码
title,
timelimit:{ java, others},
memorylimit:{java,others}
description,
input,
output,
source,
static:{ac,submit}
}
@Get contests/:contestId/status
@Query {pageSize,pageIndex}
@Return [{
userId,
username,
problemOrder,
verdict,//评测结果
time,
memory,
compiler,//使用的编译语言
codeLength,
submitTime,
compileError:'xxxx' //编译错误详情
}]
@Post contests
@Body{
hostId,//创建人
title,
startTime,
endTime,
password,//密码
attendId:[{
userId
}]//允许参加的人
}
@Put contests/:contestId
@Body {
//同添加竞赛
}
@Delete contests/:contestId
@Return {}
@Get discuss
@Query {pageSize,pageIndex}
@Return [{
title,
author:{
userId,
nickname,
avatarUrl,
classname
}
reply:[int]回复数
}]
@Post discuss
@Body {
title,
content,
userId
}
@Return {dicussId}
@Delete discuss/:discussId
@Return {}
@Get discuss/:discussId
@Query{pageSize,pageIndex}
@Return [{
index:[int]帖子索引,
title,
content,
reply:0[int]要回复帖子的索引
author:{
userId,
nickname,
avatarUrl,
classname
}
}]
@Post discuss/:discussId
@Body{
userId,
title,
content,
reply:0
}
@Return {
index:[int]帖子索引,
title,
content,
reply:[int]要回复帖子的索引
author:{
userId,
nickname,
avatarUrl,
classname
}
}
###删除回复
@Delete discuss/:discussId/:index
@Return {}
##Todos
- 多语言支持
- 用户批量导入