Skip to content

Commit 6cd579a

Browse files
Write APIDOCs for student
1 parent e21f266 commit 6cd579a

File tree

1 file changed

+89
-1
lines changed

1 file changed

+89
-1
lines changed

_apidoc.js

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,4 +813,92 @@
813813
* @apiSuccess {ObjectId} task The task of the activity (ObjectId).One of possible Topic,Practical,Tutorial.
814814
* @apiSuccess {ObjectId} group The group of the activity (ObjectId).
815815
* @apiSucess {ObjectId} students the students who gonna attend the activity(ObjectId).
816-
*/
816+
*/
817+
818+
// ------------------------------------------------------------------------------------------
819+
// Student.
820+
// ------------------------------------------------------------------------------------------
821+
822+
/**
823+
* @api {post} /student/add Add student
824+
* @apiName AddStudent
825+
* @apiGroup Student
826+
* @apiDescription Add a new Student.
827+
*
828+
* @apiBody {String} ERP ID of the student.
829+
* @apiBody {String} name of the student.
830+
* @apiBody {Number} joining year of the student.
831+
* @apiBody {ObjectId} branch of the student (ObjectId).
832+
* @apiBody {String} division of the student.
833+
* @apiBody {Number} roll no of the student.
834+
* @apiBody {ObjectId} coursesOpted by the student(ObjectId).
835+
*
836+
* @apiSuccess {String} res Response message.
837+
* @apiError (Error 500) DatabaseError Err message if there is an error inserting into the database.
838+
*
839+
* @apiSuccessExample Success-Response:
840+
* HTTP/1.1 200 OK
841+
* {
842+
* "res": "Added student"
843+
* }
844+
*
845+
* @apiErrorExample Error-Response:
846+
* HTTP/1.1 500 Internal Server Error
847+
* {
848+
* "err": "Error while inserting in DB"
849+
* }
850+
*/
851+
852+
/**
853+
* @api {delete} /student/delete/:studentId Delete Student
854+
* @apiName DeleteStudent
855+
* @apiGroup Student
856+
*
857+
* @apiParam {String} studentId The ID of the Student document to delete.
858+
*
859+
* @apiSuccess {String} res Success message indicating the deletion.
860+
*
861+
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
862+
*/
863+
864+
/**
865+
* @api {post} /student/update Update Student
866+
* @apiName UpdateStudent
867+
* @apiGroup Student
868+
* @apiDescription Update existing student data.
869+
*
870+
* @apiBody {String} ERP ID of the student.
871+
* @apiBody {String} name of the student.
872+
* @apiBody {Number} joining year of the student.
873+
* @apiBody {ObjectId} branch of the student (ObjectId).
874+
* @apiBody {String} division of the student.
875+
* @apiBody {Number} roll no of the student.
876+
* @apiBody {ObjectId} coursesOpted by the student(ObjectId).
877+
*
878+
* @apiSuccess {String} res Student updated.
879+
* @apiError (Error 500) DatabaseError Error in updating the database.
880+
*/
881+
882+
/**
883+
* @api {get} /student/list Get Student List
884+
* @apiName GetStudentList
885+
* @apiGroup Student
886+
*
887+
* @apiQuery {String} ERP ID of the student.
888+
* @apiQuery {String} name of the student.
889+
* @apiQuery {Number} joining year of the student.
890+
* @apiQuery {ObjectId} branch of the student (ObjectId).
891+
* @apiQuery {String} division of the student.
892+
* @apiQuery {Number} roll no of the student.
893+
* @apiQuery {ObjectId} coursesOpted by the student(ObjectId).
894+
*
895+
* @apiSuccess {Student[]} res Array of filtered student documents.
896+
* @apiSuccess {String} student._id ID of the student document given by the database.
897+
* @apiSuccess {String} student.ERP ID of the student.
898+
* @apiSuccess {String} student.name of the student.
899+
* @apiSuccess {Number} student.joining year of the student.
900+
* @apiSuccess {ObjectId} student.branch of the student (ObjectId).
901+
* @apiSuccess {String} student.division of the student.
902+
* @apiSuccess {Number} student.roll no of the student.
903+
* @apiSuccess {ObjectId} student.coursesOpted by the student(ObjectId).
904+
*/

0 commit comments

Comments
 (0)