education_manage_api
Version:
EducationManageApi - JavaScript client for education_manage_api 教务管理,包括学生信息,成绩管理 This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
317 lines (272 loc) • 10.7 kB
JavaScript
/**
* Education Manage API
* 教务管理,包括学生信息,成绩管理
*
* OpenAPI spec version: 1.0.0
* Contact: sessionliang@outlook.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Student', 'model/InlineResponse200', 'model/InlineResponse401'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Student'), require('../model/InlineResponse200'), require('../model/InlineResponse401'));
} else {
// Browser globals (root is window)
if (!root.EducationManageApi) {
root.EducationManageApi = {};
}
root.EducationManageApi.StudentsApi = factory(root.EducationManageApi.ApiClient, root.EducationManageApi.Student, root.EducationManageApi.InlineResponse200, root.EducationManageApi.InlineResponse401);
}
}(this, function(ApiClient, Student, InlineResponse200, InlineResponse401) {
'use strict';
/**
* Students service.
* @module api/StudentsApi
* @version 1.0.0
*/
/**
* Constructs a new StudentsApi.
* @alias module:api/StudentsApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
* Callback function to receive the result of the studentsIdDelete operation.
* @callback module:api/StudentsApi~studentsIdDeleteCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* delete student info
*
* @param {String} id
* @param {String} apiKey
* @param {module:api/StudentsApi~studentsIdDeleteCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.studentsIdDelete = function(id, apiKey, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id == undefined || id == null) {
throw new Error("Missing the required parameter 'id' when calling studentsIdDelete");
}
// verify the required parameter 'apiKey' is set
if (apiKey == undefined || apiKey == null) {
throw new Error("Missing the required parameter 'apiKey' when calling studentsIdDelete");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var headerParams = {
'api_key': apiKey
};
var formParams = {
};
var authNames = ['education_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/students/{id}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the studentsIdGet operation.
* @callback module:api/StudentsApi~studentsIdGetCallback
* @param {String} error Error message, if any.
* @param {module:model/Student} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* get student info
*
* @param {String} id
* @param {module:api/StudentsApi~studentsIdGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Student}
*/
this.studentsIdGet = function(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id == undefined || id == null) {
throw new Error("Missing the required parameter 'id' when calling studentsIdGet");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['education_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = [];
var returnType = Student;
return this.apiClient.callApi(
'/students/{id}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the studentsIdPut operation.
* @callback module:api/StudentsApi~studentsIdPutCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* update student info
*
* @param {String} id
* @param {module:model/Student} body student' propertyies
* @param {module:api/StudentsApi~studentsIdPutCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.studentsIdPut = function(id, body, callback) {
var postBody = body;
// verify the required parameter 'id' is set
if (id == undefined || id == null) {
throw new Error("Missing the required parameter 'id' when calling studentsIdPut");
}
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw new Error("Missing the required parameter 'body' when calling studentsIdPut");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['education_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/students/{id}', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the studentsLoginPost operation.
* @callback module:api/StudentsApi~studentsLoginPostCallback
* @param {String} error Error message, if any.
* @param {module:model/InlineResponse200} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* student login
*
* @param {String} userName student' userName
* @param {String} password student' password
* @param {module:api/StudentsApi~studentsLoginPostCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/InlineResponse200}
*/
this.studentsLoginPost = function(userName, password, callback) {
var postBody = null;
// verify the required parameter 'userName' is set
if (userName == undefined || userName == null) {
throw new Error("Missing the required parameter 'userName' when calling studentsLoginPost");
}
// verify the required parameter 'password' is set
if (password == undefined || password == null) {
throw new Error("Missing the required parameter 'password' when calling studentsLoginPost");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'userName': userName,
'password': password
};
var authNames = [];
var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = [];
var returnType = InlineResponse200;
return this.apiClient.callApi(
'/students/login', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the studentsRegistePost operation.
* @callback module:api/StudentsApi~studentsRegistePostCallback
* @param {String} error Error message, if any.
* @param {module:model/InlineResponse200} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* student registe
*
* @param {String} userName student' userName
* @param {String} password student' password
* @param {module:api/StudentsApi~studentsRegistePostCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/InlineResponse200}
*/
this.studentsRegistePost = function(userName, password, callback) {
var postBody = null;
// verify the required parameter 'userName' is set
if (userName == undefined || userName == null) {
throw new Error("Missing the required parameter 'userName' when calling studentsRegistePost");
}
// verify the required parameter 'password' is set
if (password == undefined || password == null) {
throw new Error("Missing the required parameter 'password' when calling studentsRegistePost");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'userName': userName,
'password': password
};
var authNames = [];
var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = [];
var returnType = InlineResponse200;
return this.apiClient.callApi(
'/students/registe', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));