-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md
138 lines (99 loc) · 5.9 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Go API client for openapi
gin-http服务文档
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
- API version: 1.0
- Package version: 1.0.0
- Generator version: 7.9.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation
Install the following dependencies:
```sh
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
```
Put the package under your project folder and add the following in import:
```go
import openapi "github.com/yituoshiniao/openapi-client-go"
```
To use a proxy, set the environment variable `HTTP_PROXY`:
```go
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
## Configuration of Server URL
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
### Select Server Configuration
For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`.
```go
ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
```
### Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`.
```go
ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```
Note, enum values are always validated and all unused variables are silently ignored.
### URLs Configuration per Operation
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps.
```go
ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```
## Documentation for API Endpoints
All URIs are relative to *http://127.0.0.1:3013/goodsCenterLogic*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**V1CommonGenerateIdGet**](docs/DefaultApi.md#v1commongenerateidget) | **Get** /v1/common/generateId | 雪花ID生成
*AsynqAPI* | [**AsynqV1AddAggTaskGet**](docs/AsynqAPI.md#asynqv1addaggtaskget) | **Get** /asynq/v1/addAggTask | asynq-添加聚合任务
*AsynqAPI* | [**AsynqV1AddTaskGet**](docs/AsynqAPI.md#asynqv1addtaskget) | **Get** /asynq/v1/addTask | asynq-add异步任务
*AuthAPI* | [**AuthV1TokenGenerateGet**](docs/AuthAPI.md#authv1tokengenerateget) | **Get** /auth/v1/token/generate | jwt-token生成及校验
*ExampleAPI* | [**V1ExampleGetGet**](docs/ExampleAPI.md#v1examplegetget) | **Get** /v1/exampleGet | get接口示例
*ExampleAPI* | [**V1ExampleGetOneGet**](docs/ExampleAPI.md#v1examplegetoneget) | **Get** /v1/exampleGetOne | getOne接口示例
*ExampleAPI* | [**V1ExamplePostPost**](docs/ExampleAPI.md#v1examplepostpost) | **Post** /v1/examplePost | post 接口 示例
*UserScoreAPI* | [**V1UserScoreAddPost**](docs/UserScoreAPI.md#v1userscoreaddpost) | **Post** /v1/userScore/add | 添加数据
*UserScoreAPI* | [**V1UserScoreDelPost**](docs/UserScoreAPI.md#v1userscoredelpost) | **Post** /v1/userScore/del | 删除数据
*UserScoreAPI* | [**V1UserScoreFindGet**](docs/UserScoreAPI.md#v1userscorefindget) | **Get** /v1/userScore/find | 查询一条数据
*UserScoreAPI* | [**V1UserScoreListGet**](docs/UserScoreAPI.md#v1userscorelistget) | **Get** /v1/userScore/list | 查询列表
*UserScoreAPI* | [**V1UserScoreUpdatePost**](docs/UserScoreAPI.md#v1userscoreupdatepost) | **Post** /v1/userScore/update | 更新数据
## Documentation For Models
- [InternalApiDtoAppJwtTokenResponse](docs/InternalApiDtoAppJwtTokenResponse.md)
- [InternalApiDtoAppJwtTokenSwgResponse](docs/InternalApiDtoAppJwtTokenSwgResponse.md)
- [InternalApiDtoAsynqEmailDeliveryTaskAddResponse](docs/InternalApiDtoAsynqEmailDeliveryTaskAddResponse.md)
- [InternalApiDtoExampleGetOneResponse](docs/InternalApiDtoExampleGetOneResponse.md)
- [InternalApiDtoExampleGetResponse](docs/InternalApiDtoExampleGetResponse.md)
- [InternalApiDtoExamplePostRequest](docs/InternalApiDtoExamplePostRequest.md)
- [InternalApiDtoExamplePostResponse](docs/InternalApiDtoExamplePostResponse.md)
- [InternalApiDtoGroupDeliveryTaskAddResponse](docs/InternalApiDtoGroupDeliveryTaskAddResponse.md)
- [InternalApiDtoUserPortraitData](docs/InternalApiDtoUserPortraitData.md)
- [InternalApiDtoUserScoreFindResponse](docs/InternalApiDtoUserScoreFindResponse.md)
- [InternalApiDtoUserScoreListResponse](docs/InternalApiDtoUserScoreListResponse.md)
- [InternalHandlerResponseData](docs/InternalHandlerResponseData.md)
- [InternalHandlerServicev1HttpGenerateIDResponse](docs/InternalHandlerServicev1HttpGenerateIDResponse.md)
- [InternalModuleAuthApplicationServiceAuthPayload](docs/InternalModuleAuthApplicationServiceAuthPayload.md)
- [InternalModuleMockv2ApplicationEntityUserScore](docs/InternalModuleMockv2ApplicationEntityUserScore.md)
## Documentation For Authorization
Endpoints do not require authorization.
## Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:
* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`
## Author