ProbRoutes API Specification - Admins
router . get ( '/api/prob/admin' , access , isAdmin , wrap ( C . getProb ) ) ;
router . get ( '/api/prob/admin/id/:pid' , access , isAdmin , wrap ( C . getProb ) ) ;
router . get ( '/api/prob/admin/type/:type' , access , isAdmin , wrap ( C . getProb ) ) ;
router . post ( '/api/prob' , access , isAdmin , upload . array ( 'attachments' ) , C . addProb ) ;
router . patch ( '/api/prob/:pid' , access , isAdmin , upload . array ( 'attachments' ) , C . modifyProb ) ;
router . patch ( '/api/prob/file/:fid' , access , isAdmin , upload . single ( 'alter' ) , C . modifyFile ) ;
router . delete ( '/api/prob/id/:pid' , access , isAdmin , C . deleteProb ) ;
router . delete ( '/api/prob/comment/:pid/:cid' , access , isAdmin , deleteComment ) ;
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
[
{
"pid" : 19 ,
"name" : " xptmxmanswp"
},
{
"pid" : 20 ,
"name" : " 문제 파일 있음"
},
{
"pid" : 21 ,
"name" : " xptmxmanswp"
},
{
"pid" : 22 ,
"name" : " xptmxmanswp"
},
{
"pid" : 23 ,
"name" : " rlahEl"
},
{
"pid" : 24 ,
"name" : " rlahEl"
},
{
"pid" : 25 ,
"name" : " rlahEl"
},
{
"pid" : 26 ,
"name" : " rlahEl"
},
{
"pid" : 27 ,
"name" : " 문제용"
},
{
"pid" : 28 ,
"name" : " FOR_test_1"
},
{
"pid" : 35 ,
"name" : " rlahEl"
},
{
"pid" : 38 ,
"name" : " 테스트 테스트 테스트"
},
{
"pid" : 40 ,
"name" : " 포렌식문제추가"
},
{
"pid" : 41 ,
"name" : " 테스트 문제"
},
{
"pid" : 29 ,
"name" : " test"
},
{
"pid" : 30 ,
"name" : " 뽀렌씩 문제"
},
{
"pid" : 31 ,
"name" : " ttest"
},
{
"pid" : 33 ,
"name" : " ttest"
},
{
"pid" : 34 ,
"name" : " hello"
},
{
"pid" : 36 ,
"name" : " asdf"
},
{
"pid" : 37 ,
"name" : " aaaasssasas"
},
{
"pid" : 39 ,
"name" : " 포포포포"
},
{
"pid" : 42 ,
"name" : " hhhh<script>document.write('hacked-by-ziyong');</script>hhhh"
}
]
{
"success" : false ,
"message" : " No data found"
}
{
"success" : false ,
"message" : " Login required"
}
GET /api/prob/admin/id/:pid
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
[
{
"pid" : 19 ,
"name" : " xptmxmanswp" ,
"type" : " web" ,
"score" : 1000 ,
"info" : " 아몰랑" ,
"issuer" : " ㅈ지용" ,
"flag" : " YISF{testtest}" ,
"active" : false ,
"views" : 0 ,
"count" : null ,
"filedata" : [
{
"fid" : 1 ,
"filename" : " a52e376568f83e764fc092ead6492d78" ,
"filepath" : " models/files/"
}
]
}
]
{
"success" : false ,
"message" : " No data found"
}
{
"success" : false ,
"message" : " Login required"
}
GET /api/prob/admin/type/:type
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
[
{
"pid" : 19 ,
"name" : " xptmxmanswp" ,
"type" : " web" ,
"score" : 1000 ,
"info" : " 아몰랑" ,
"issuer" : " ㅈ지용" ,
"flag" : " YISF{testtest}" ,
"active" : false ,
"views" : 0 ,
"count" : null ,
"filedata" : [
{
"fid" : 1 ,
"filename" : " a52e376568f83e764fc092ead6492d78" ,
"filepath" : " models/files/"
}
]
},
{
"pid" : 35 ,
"name" : " rlahEl" ,
"type" : " web" ,
"score" : 1000 ,
"info" : " 아몰랑" ,
"issuer" : " ㅈ지용" ,
"flag" : " YISF{testtest}" ,
"active" : true ,
"views" : 1 ,
"count" : null ,
"filedata" : [
{
"fid" : 13 ,
"filename" : " d7f9426652b5e7dca893d18d070b490b" ,
"filepath" : " models/files/"
}
]
}
]
{
"success" : false ,
"message" : " No data found"
}
{
"success" : false ,
"message" : " Login required"
}
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
attachments: File; array (Optional)
name: String (Required)
type: String (Required)
info: String (Required)
issuer: String (Required)
flag: String (Required)
{
"success" : false ,
"err" : err
}
{
"success" : false ,
"message" : " Login required"
}
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
Body; One of these is required
attachments: File; array (Optional)
name: String (Optional)
type: String (Optional)
info: String (Optional)
issuer: String (Optional)
flag: String (Optional)
{
"success" : false ,
"err" : err
}
{
"success" : false ,
"message" : " Login required"
}
PATCH /api/prob/file/:fid
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
alter: File; single (Required)
{
"success" : false ,
"err" : err
}
{
"success" : false ,
"message" : " Login required"
}
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
{
"success" : false ,
"err" : err
}
{
"success" : false ,
"message" : " Login required"
}
Delete Comment
DELETE /api/prob/comment/:pid/:cid
Header
accessToken: String (Required); Bearer Token
RefreshToken: String (Required); JWT Token
pid: Number (Required)
cid: Number (Required)
{
"success" : false ,
"err" : err
}
{
"success" : false ,
"message" : " Login required"
}