# swagger-js-client
SwaggerJsClient - JavaScript client for swagger-js-client
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version:
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
## Installation
### For [Node.js](https://nodejs.org/)
#### npm
To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
Then install it via:
```shell
npm install swagger-js-client --save
```
##### Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
```shell
npm install
```
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
```shell
npm link
```
Finally, switch to the directory you want to use your swagger-js-client from, and run:
```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```
You should now be able to `require('swagger-js-client')` in javascript files from the directory you ran the last
command above from.
#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:
```shell
npm install GIT_USER_ID/GIT_REPO_ID --save
```
### For browser
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually
use this library):
```shell
browserify main.js > bundle.js
```
Then include *bundle.js* in the HTML pages.
### Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:
```javascript
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
```
## Getting Started
Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript
var SwaggerJsClient = require('swagger-js-client');
var api = new SwaggerJsClient.GreetApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.ping(callback);
```
## Documentation for API Endpoints
All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SwaggerJsClient.GreetApi* | [**ping**](docs/GreetApi.md#ping) | **GET** /user/ping |
*SwaggerJsClient.UserApiApi* | [**getUserInfo**](docs/UserApiApi.md#getUserInfo) | **GET** /api/user/{id} | 获取用户信息
*SwaggerJsClient.UserApiApi* | [**login**](docs/UserApiApi.md#login) | **POST** /api/user/login | 登录
*SwaggerJsClient.UserApiApi* | [**register**](docs/UserApiApi.md#register) | **POST** /api/user/register | 注册
*SwaggerJsClient.UserApiApi* | [**searchUser**](docs/UserApiApi.md#searchUser) | **GET** /api/user/search | 用户搜索
## Documentation for Models
- [SwaggerJsClient.LoginReq](docs/LoginReq.md)
- [SwaggerJsClient.RegisterReq](docs/RegisterReq.md)
- [SwaggerJsClient.UserInfoReply](docs/UserInfoReply.md)
- [SwaggerJsClient.UserInfoReq](docs/UserInfoReq.md)
- [SwaggerJsClient.UserSearchReply](docs/UserSearchReply.md)
- [SwaggerJsClient.UserSearchReq](docs/UserSearchReq.md)
## Documentation for Authorization
### apiKey
- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header
没有合适的资源?快使用搜索试试~ 我知道了~
goctl.exegoctl-swagger.exe
共119个文件
md:28个
php:21个
go:19个
需积分: 1 1 下载量 48 浏览量
2024-03-13
11:09:00
上传
评论
收藏 39.17MB 7Z 举报
温馨提示
编译好的 goctl.exe goctl-swagger.exe
资源推荐
资源详情
资源评论
收起资源包目录
goctl.exegoctl-swagger.exe (119个子文件)
user.api 1KB
test.api 305B
user.api 155B
phpunit.xml.dist 678B
goctl.exe 46.73MB
goctl-swagger.exe 12.87MB
.gitignore 266B
.gitignore 157B
parser.go 21KB
api_user_api.go 12KB
client.go 12KB
entities.go 10KB
api_greet.go 3KB
swagger.go 3KB
configuration.go 2KB
response.go 1KB
main.go 1KB
main.go 968B
generate.go 629B
action.go 515B
model_user_info_reply.go 510B
model_register_req.go 402B
model_login_req.go 356B
model_user_search_reply.go 325B
model_user_search_req.go 314B
model_user_info_req.go 302B
generate.go 121B
goctl 53MB
goctl-swagger 13.22MB
ApiClient.js 20KB
UserApiApi.js 8KB
UserApiApi.spec.js 6KB
index.js 4KB
UserInfoReply.js 3KB
assert-equals.js 3KB
UserInfoReply.spec.js 3KB
GreetApi.js 2KB
RegisterReq.js 2KB
LoginReq.js 2KB
UserSearchReply.js 2KB
RegisterReq.spec.js 2KB
UserSearchReq.js 2KB
UserInfoReq.js 2KB
LoginReq.spec.js 2KB
GreetApi.spec.js 2KB
UserSearchReply.spec.js 2KB
UserSearchReq.spec.js 2KB
UserInfoReq.spec.js 1KB
user.json 5KB
swagger.json 5KB
swagger.json 5KB
rest.swagger.json 5KB
composer.json 856B
package.json 409B
LICENSE 1KB
UserApiApi.md 6KB
README.md 4KB
UserApiApi.md 4KB
UserApiApi.md 3KB
README.md 3KB
README.md 2KB
GreetApi.md 1KB
GreetApi.md 830B
GreetApi.md 679B
UserInfoReply.md 581B
UserInfoReply.md 494B
RegisterReq.md 467B
RegisterReq.md 416B
LoginReq.md 406B
UserSearchReply.md 387B
UserSearchReply.md 381B
LoginReq.md 372B
README.md 352B
UserSearchReq.md 350B
UserInfoReply.md 350B
UserInfoReq.md 343B
UserSearchReq.md 334B
UserInfoReq.md 326B
RegisterReq.md 269B
LoginReq.md 225B
UserSearchReply.md 217B
UserSearchReq.md 186B
UserInfoReq.md 179B
go.mod 260B
mocha.opts 16B
UserApiApi.php 37KB
ObjectSerializer.php 12KB
GreetApi.php 10KB
Configuration.php 9KB
UserInfoReply.php 8KB
RegisterReq.php 7KB
LoginReq.php 7KB
UserSearchReply.php 6KB
UserSearchReq.php 6KB
UserInfoReq.php 6KB
ApiException.php 3KB
HeaderSelector.php 3KB
ModelInterface.php 2KB
UserInfoReplyTest.php 2KB
UserApiApiTest.php 2KB
共 119 条
- 1
- 2
资源评论
hongkid
- 粉丝: 191
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功