1.1.4 • Published 6 years ago

oiinhand-sdk-axios v1.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

OI in Hand Node.js SDK

使用方法

十分简单,只需要以下步骤

$ npm install oiinhand-sdk-axios

var OIHAPI=require('oiinhand-sdk-axios');
var api=new OIHAPI('$apikey$','$apisecret$');

这是最简单的开始使用方法。在创建 OIHAPI 的实例时你还可以传入第三个参数,用于自行设置 OI in Hand 的 API 地址。例如: var api=new OIHAPI('$apikey$','$apisecret$','https://api.oiinhand.info/if/');

oiinhand-api

所有请求都是 OI in Hand API 文档中有的,关于 API 的具体使用请参阅OI in Hand API 文档

以下任何一个请求,除非特殊说明,回传的都是一个 Promise 对象。

题库

根据 id 获取一道题目的详细信息

api.problem.show(id);

这是一个示例:

var p=api.problem.show('59052f43f66151042555c97c');
p.then(function (res){
	console.log(res.data);
});

模糊搜索

api.search.simple(queryString,otherParams);

这是一个示例:

var p=api.search.simple('soha',{
	oj: 'luogu',
	page: 2,
	limit: 2
});
p.then(function (res){
	console.log(res.data);
});

模糊搜索 (带标签)

api.search.wtag(queryString,tags,otherParams);

这是一个示例:

var p=api.search.wtag('soha',[
	"模拟",
	"字符串"
],{
	oj: [
		'luogu',
		'vijos'
	],
	page: 1,
	limit: 2
});
p.then(function (res){
	console.log(res.data);
});
1.1.4

6 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago