Skip to content

Commit 9743db7

Browse files
Merge pull request #364 from tcet-opensource/294-Write-APIDOCs-for-student
Write APIDOCs for student
2 parents b71873d + 5fddd20 commit 9743db7

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

_apidoc.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,3 +1262,91 @@
12621262
* @apiSuccess {ObjectId} group The group of the activity (ObjectId).
12631263
* @apiSucess {ObjectId} students the students who gonna attend the activity(ObjectId).
12641264
*/
1265+
1266+
// ------------------------------------------------------------------------------------------
1267+
// Student.
1268+
// ------------------------------------------------------------------------------------------
1269+
1270+
/**
1271+
* @api {post} /student/add Add student
1272+
* @apiName AddStudent
1273+
* @apiGroup Student
1274+
* @apiDescription Add a new Student.
1275+
*
1276+
* @apiBody {String} ERP ID of the student.
1277+
* @apiBody {String} name of the student.
1278+
* @apiBody {Number} joining year of the student.
1279+
* @apiBody {ObjectId} branch of the student (ObjectId).
1280+
* @apiBody {String} division of the student.
1281+
* @apiBody {Number} roll no of the student.
1282+
* @apiBody {ObjectId} coursesOpted by the student(ObjectId).
1283+
*
1284+
* @apiSuccess {String} res Response message.
1285+
* @apiError (Error 500) DatabaseError Err message if there is an error inserting into the database.
1286+
*
1287+
* @apiSuccessExample Success-Response:
1288+
* HTTP/1.1 200 OK
1289+
* {
1290+
* "res": "Added student"
1291+
* }
1292+
*
1293+
* @apiErrorExample Error-Response:
1294+
* HTTP/1.1 500 Internal Server Error
1295+
* {
1296+
* "err": "Error while inserting in DB"
1297+
* }
1298+
*/
1299+
1300+
/**
1301+
* @api {delete} /student/delete/:studentId Delete Student
1302+
* @apiName DeleteStudent
1303+
* @apiGroup Student
1304+
*
1305+
* @apiParam {String} studentId The ID of the Student document to delete.
1306+
*
1307+
* @apiSuccess {String} res Success message indicating the deletion.
1308+
*
1309+
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
1310+
*/
1311+
1312+
/**
1313+
* @api {post} /student/update Update Student
1314+
* @apiName UpdateStudent
1315+
* @apiGroup Student
1316+
* @apiDescription Update existing student data.
1317+
*
1318+
* @apiBody {String} ERP ID of the student.
1319+
* @apiBody {String} name of the student.
1320+
* @apiBody {Number} joining year of the student.
1321+
* @apiBody {ObjectId} branch of the student (ObjectId).
1322+
* @apiBody {String} division of the student.
1323+
* @apiBody {Number} roll no of the student.
1324+
* @apiBody {ObjectId} coursesOpted by the student(ObjectId).
1325+
*
1326+
* @apiSuccess {String} res Student updated.
1327+
* @apiError (Error 500) DatabaseError Error in updating the database.
1328+
*/
1329+
1330+
/**
1331+
* @api {get} /student/list Get Student List
1332+
* @apiName GetStudentList
1333+
* @apiGroup Student
1334+
*
1335+
* @apiQuery {String} ERP ID of the student.
1336+
* @apiQuery {String} name of the student.
1337+
* @apiQuery {Number} joining year of the student.
1338+
* @apiQuery {ObjectId} branch of the student (ObjectId).
1339+
* @apiQuery {String} division of the student.
1340+
* @apiQuery {Number} roll no of the student.
1341+
* @apiQuery {ObjectId} coursesOpted by the student(ObjectId).
1342+
*
1343+
* @apiSuccess {Student[]} res Array of filtered student documents.
1344+
* @apiSuccess {String} student._id ID of the student document given by the database.
1345+
* @apiSuccess {String} student.ERP ID of the student.
1346+
* @apiSuccess {String} student.name of the student.
1347+
* @apiSuccess {Number} student.joining year of the student.
1348+
* @apiSuccess {ObjectId} student.branch of the student (ObjectId).
1349+
* @apiSuccess {String} student.division of the student.
1350+
* @apiSuccess {Number} student.roll no of the student.
1351+
* @apiSuccess {ObjectId} student.coursesOpted by the student(ObjectId).
1352+
*/

0 commit comments

Comments
 (0)