3.9 KiB
3.9 KiB
SwaggerJsClient.UserApiApi
All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
getUserInfo | GET /api/user/{id} | 获取用户信息 |
login | POST /api/user/login | 登录 |
register | POST /api/user/register | 注册 |
searchUser | GET /api/user/search | 用户搜索 |
getUserInfo
UserInfoReply getUserInfo(id, body)
获取用户信息
Example
var SwaggerJsClient = require('swagger-js-client');
var apiInstance = new SwaggerJsClient.UserApiApi();
var id = "id_example"; // String |
var body = new SwaggerJsClient.UserInfoReq(); // UserInfoReq |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getUserInfo(id, body, callback);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | String | ||
body | UserInfoReq |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
login
Object login(body)
登录
Example
var SwaggerJsClient = require('swagger-js-client');
var apiInstance = new SwaggerJsClient.UserApiApi();
var body = new SwaggerJsClient.LoginReq(); // LoginReq |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.login(body, callback);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | LoginReq |
Return type
Object
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
register
Object register(body)
注册
注册一个用户
Example
var SwaggerJsClient = require('swagger-js-client');
var apiInstance = new SwaggerJsClient.UserApiApi();
var body = new SwaggerJsClient.RegisterReq(); // RegisterReq |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.register(body, callback);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | RegisterReq |
Return type
Object
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
searchUser
UserSearchReply searchUser(body)
用户搜索
Example
var SwaggerJsClient = require('swagger-js-client');
var apiInstance = new SwaggerJsClient.UserApiApi();
var body = new SwaggerJsClient.UserSearchReq(); // UserSearchReq |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.searchUser(body, callback);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | UserSearchReq |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json