ynu-api
Version:
a API Client for YNU
72 lines • 2.92 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBksYxdm = exports.getBksFull = exports.getBksBasic = exports.getBksList = void 0;
const axios_1 = require("axios");
const index_1 = require("../index");
const util_1 = require("../util");
/**
* 查询在校本科生名单
*/
const getBksList = (params, options) => __awaiter(void 0, void 0, void 0, function* () {
const token = yield (0, index_1.getToken)(options);
const res = yield axios_1.default.get(`${options.host}/v1/bks/list_bks`, {
headers: {
Authorization: token,
},
params: (0, util_1.filterNullParams)(params)
});
return res.data.data;
});
exports.getBksList = getBksList;
/**
* 查询在校本科生的基本信息
*/
const getBksBasic = (params, options) => __awaiter(void 0, void 0, void 0, function* () {
const token = yield (0, index_1.getToken)(options);
const queryString = params.xh ? params.xh.map(item => `xh=${item}`).join('&') : '';
const res = yield axios_1.default.get(`${options.host}/v1/bks/basic_bks?${queryString}`, {
headers: {
Authorization: token,
},
});
return res.data.data;
});
exports.getBksBasic = getBksBasic;
/**
* 查询在校本科生的详细信息
*/
const getBksFull = (params, options) => __awaiter(void 0, void 0, void 0, function* () {
const token = yield (0, index_1.getToken)(options);
const queryString = params.xh ? params.xh.map(item => `xh=${item}`).join('&') : '';
const res = yield axios_1.default.get(`${options.host}/v1/bks/full_bks?${queryString}`, {
headers: {
Authorization: token,
},
});
return res.data.data;
});
exports.getBksFull = getBksFull;
/**
* 获得本科生的组织机构代码
*/
const getBksYxdm = (params, options) => __awaiter(void 0, void 0, void 0, function* () {
const token = yield (0, index_1.getToken)(options);
const res = yield axios_1.default.get(`${options.host}/v1/bks/dm_yxdm`, {
headers: {
Authorization: token,
},
params: (0, util_1.filterNullParams)(params),
});
return res.data.data;
});
exports.getBksYxdm = getBksYxdm;
//# sourceMappingURL=bks.js.map