UNPKG

ynu-api

Version:

a API Client for YNU

72 lines 2.93 kB
"use strict"; 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.getYjsYxdm = exports.getYjsFull = exports.getYjsBasic = exports.getYjsList = void 0; const axios_1 = require("axios"); const index_1 = require("../index"); const util_1 = require("../util"); /** * 查询在校研究生名单 */ const getYjsList = (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/yjs/list_yjs`, { headers: { Authorization: token, }, params: (0, util_1.filterNullParams)(params) }); return res.data.data; }); exports.getYjsList = getYjsList; /** * 查询在校研究生的基本信息 */ const getYjsBasic = (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/yjs/basic_yjs?${queryString}`, { headers: { Authorization: token, }, }); return res.data.data; }); exports.getYjsBasic = getYjsBasic; /** * 查询在校研究生的详细信息 */ const getYjsFull = (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/yjs/full_yjs?${queryString}`, { headers: { Authorization: token, }, }); return res.data.data; }); exports.getYjsFull = getYjsFull; /** * 获得在校研究生的组织机构代码 */ const getYjsYxdm = (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/yjs/dm_yxdm`, { headers: { Authorization: token, }, params: (0, util_1.filterNullParams)(params), }); return res.data.data; }); exports.getYjsYxdm = getYjsYxdm; //# sourceMappingURL=yjs.js.map