yg-tools
Version:
some convenient APIs and Methods for Youngon
241 lines (240 loc) • 7.64 kB
TypeScript
import YGREQ from './req';
import GlobalConfig from '../config/config';
export default class YGAPIs {
config: GlobalConfig;
YGR: YGREQ;
constructor(config: GlobalConfig);
static createYGAPIs(config: GlobalConfig): YGAPIs;
/**
* @function 绑定微信账号
* */
bindWXAccount: ({ stuid, password, wxid }: {
stuid: string;
password: string;
wxid: string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 绑定QQ账号
* */
bindQQAccount: ({ stuid, password, qqid }: {
stuid: string;
password: string;
qqid: string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 注册账号
* */
regAccount: ({ stuid, password, name, email, utype, wxid, qqid }: {
stuid: string | number;
password: string;
name: string;
email: string;
utype: string | number;
wxid?: string | undefined;
qqid?: string | undefined;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 获取注册码
* */
getRegisterCode: () => Promise<any>;
/**
* @function 设置站员注册码
* */
setRegisterCode: (Rcode: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 通过`wxid`获取用户信息
* */
getUserInfoByWX: () => any;
/**
* @function 通过`qqid`获取用户信息
* */
getUserInfoByQQ: () => any;
/**
* @function 获取最新公告
* */
getLastNotice: () => Promise<any>;
/**
* @function 获取当前在站成员信息
* */
getCurrentOnline: () => Promise<import("../types").HttpResponseOption>;
/**
* @function 获取携带钥匙站员信息
* */
getHaskey: () => Promise<import("../types").HttpResponseOption>;
/**
* @function 获取本周签到记录
* */
getThisWeekSR: () => Promise<any>;
/**
* @function 获取上周签到记录
* */
getLastWeekSR: () => Promise<any>;
/**
* @function 经纬度转地址
* */
getLocation: ({ latitude, longitude }: {
latitude: number;
longitude: number;
}) => Promise<any>;
/**
* @function 通过学号和管理员token获取用户信息
* */
getUserByToken: (stuid: string | number, token: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 通过管理员token获取所有管理员信息
* */
getAllAdminByToken: (token: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 通过管理员token获取所有用户信息
* */
getAllUsersByToken: (token: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 获取允许签到的wifi信息
* */
getAllowWifi: () => Promise<any>;
/**
* @function 设置允许签到的wifi信息
* */
setAllowWifi: (wifi: {
wifi: string[];
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 获取允许签到的经纬度信息
* */
getAllowLocation: () => Promise<any>;
/**
* @function 设置允许签到的经纬度信息
* */
setAlloLocation: (latlong: {
lat: string | number;
long: string | number;
range: string | number;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 获取某一时间的签到记录
* */
getSignRecordByTime: ({ time, page, count }: {
time: string;
page: number;
count: number;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 签到
* */
signInRequest: (stuid: number | string, reason: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 签退
* */
signOutRequest: (stuid: number | string, ifkey: number) => Promise<import("../types").HttpResponseOption>;
/**
* @function 添加值班记录
* */
addDuty: (stuid: number | string, dutydate: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 修改用户类型
* */
modifyUtype: (stuid: number | string, utype: number) => Promise<import("../types").HttpResponseOption>;
/**
* @function 修改用户信息
* */
modifyUserInfo: ({ stuid, info, value }: {
stuid: number | string;
info: string;
value: number | string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 自动查值班
* */
getDutyInfo: () => Promise<any>;
/**
* @function 获取待处理/已拒绝的申请
* */
getApplyByType: (type: 'unapproved' | 'refuse') => Promise<any>;
/**
* @function 获取某人申请
* */
getApplyByStuid: (stuid: number | string) => Promise<any>;
/**
* @function 分页获取已同意的申请
* */
getApprovalApply: (page: number) => Promise<any>;
/**
* @function 分页获取公告列表
* */
getNoticeByPage: (page: number) => Promise<any>;
/**
* @function 查询某人值班情况
* */
getDutyByStuid: (stuid: number) => Promise<any>;
/**
* @function 发布公告
* */
postNotice: (stuid: number | string, content: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 处理申请
* */
handleApply: ({ stuid, aid, state }: {
stuid: number | string;
aid: number;
state: 0 | 1 | 2;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 发送邮件
* */
sendEmail: ({ tomail, type, title, content }: {
tomail: number | string;
type: number;
title: string;
content: string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 向当前在站正式站员发送邮件
* */
sendEmailToCurYoungoner: ({ type, title, content }: {
type: number;
title: string;
content: string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 向当管理员发送邮件
* */
sendEmailToAdmins: ({ type, title, content }: {
type: number;
title: string;
content: string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 提出申请
* */
postApply: ({ stuid, reason, apptime, appclass, appfixtime, appfixclass }: {
stuid: string | number;
reason: string;
apptime: string;
appclass: number;
appfixtime: string;
appfixclass: number;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 上传图片
* */
uploadImage: (type: 'head' | 'img', value: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 修改用户证件照
* */
modifyUserPhoto: ({ stuid, photo }: {
stuid: number | string;
photo: string;
}) => Promise<import("../types").HttpResponseOption>;
/**
* @function 通过社团标志获取社团信息
* */
getOrgInfoByOrgId: (orgId: string) => Promise<import("../types").HttpResponseOption>;
/**
* @function 通过年级获取社团成员信息
* */
getGradeMembersByGrade: (grade: number) => Promise<import("../types").HttpResponseOption>;
/**
* @function 通过部门获取社团成员信息
* */
getDepartmentMembersByDepartment: (department: string) => Promise<import("../types").HttpResponseOption>;
}