compatible gin.Group()

兼容gin.Group()
This commit is contained in:
谢小军
2020-05-28 20:51:17 +08:00
parent 3085109658
commit d8b1d56e92
6 changed files with 113 additions and 123 deletions

Binary file not shown.

View File

@@ -14,113 +14,7 @@
#### 请求URL:
- http://localhost/Hello.HelloS2
#### 请求方式:
- post
#### 请求参数:
- ` ReqTest1 ` :
|参数名|是否必须|类型|说明|
|:---- |:---|:----- |----- |
|`access_token` | 否|string|access_token |
|`user_name` | `是`|string|user name |
|`password` | 否|string|password |
#### 请求示例:
```
{
"access_token": "",
"password": "",
"user_name": ""
}
```
#### 返回参数说明:
#### 返回示例:
```
{}
```
#### 备注:
- ...
--------------------
#### 简要描述:
- [...]
#### 请求URL:
- http://localhost/Hello.HelloS3
#### 请求方式:
- post
#### 请求参数:
- ` ReqTest1 ` :
|参数名|是否必须|类型|说明|
|:---- |:---|:----- |----- |
|`access_token` | 否|string|access_token |
|`user_name` | `是`|string|user name |
|`password` | 否|string|password |
#### 请求示例:
```
{
"access_token": "",
"password": "",
"user_name": ""
}
```
#### 返回参数说明:
- ` ReqTest1 ` :
|参数名|是否必须|类型|说明|
|:---- |:---|:----- |----- |
|`access_token` | 否|string|access_token |
|`user_name` | `是`|string|user name |
|`password` | 否|string|password |
#### 返回示例:
```
{
"access_token": "",
"password": "",
"user_name": ""
}
```
#### 备注:
- ...
--------------------
#### 简要描述:
- [...]
#### 请求URL:
- http://localhost/block
- http://localhost/xxjwxc/block
#### 请求方式:
@@ -159,6 +53,112 @@
#### 备注:
- ...
--------------------
#### 简要描述:
- [...]
#### 请求URL:
- http://localhost/xxjwxc/Hello.HelloS2
#### 请求方式:
- post
#### 请求参数:
- ` ReqTest1 ` :
|参数名|是否必须|类型|说明|
|:---- |:---|:----- |----- |
|`access_token` | 否|string|access_token |
|`user_name` | `是`|string|user name |
|`password` | 否|string|password |
#### 请求示例:
```
{
"access_token": "",
"password": "",
"user_name": ""
}
```
#### 返回参数说明:
#### 返回示例:
```
{}
```
#### 备注:
- ...
--------------------
#### 简要描述:
- [...]
#### 请求URL:
- http://localhost/xxjwxc/Hello.HelloS3
#### 请求方式:
- post
#### 请求参数:
- ` ReqTest1 ` :
|参数名|是否必须|类型|说明|
|:---- |:---|:----- |----- |
|`access_token` | 否|string|access_token |
|`user_name` | `是`|string|user name |
|`password` | 否|string|password |
#### 请求示例:
```
{
"access_token": "",
"password": "",
"user_name": ""
}
```
#### 返回参数说明:
- ` ReqTest1 ` :
|参数名|是否必须|类型|说明|
|:---- |:---|:----- |----- |
|`access_token` | 否|string|access_token |
|`user_name` | `是`|string|user name |
|`password` | 否|string|password |
#### 返回示例:
```
{
"access_token": "",
"password": "",
"user_name": ""
}
```
#### 备注:
- ...
--------------------

View File

@@ -18,7 +18,7 @@
"https"
],
"paths": {
"/Hello.HelloS2": {
"/xxjwxc/Hello.HelloS2": {
"post": {
"tags": [
"Hello"
@@ -57,7 +57,7 @@
}
}
},
"/Hello.HelloS3": {
"/xxjwxc/Hello.HelloS3": {
"post": {
"tags": [
"Hello"
@@ -96,7 +96,7 @@
}
}
},
"/block": {
"/xxjwxc/block": {
"get": {
"tags": [
"Hello"

View File

@@ -106,9 +106,9 @@ func (s *Hello) HelloS3(c *api.Context, req *ReqTest1) (*ReqTest1, error) {
func TestObj(t *testing.T) {
base := New(WithCtx(func(c *gin.Context) interface{} {
return api.NewCtx(c)
}), WithDebug(true), WithBigCamel(true))
}), WithDebug(false), WithBigCamel(true))
router := gin.Default() // .Group("/xxjwxc")
router := gin.Default().Group("/xxjwxc")
h := new(Hello)
h.Index = 123
base.Register(router, h) //, new(api.Hello))

2
go.mod
View File

@@ -8,4 +8,4 @@ require (
github.com/xxjwxc/public v0.0.0-20200526160023-d8d1bd6babeb
)
replace github.com/xxjwxc/public => ../public
// replace github.com/xxjwxc/public => ../public

View File

@@ -1,10 +0,0 @@
package routers
import (
"github.com/xxjwxc/ginrpc"
)
func init() {
ginrpc.SetVersion(1590669806)
ginrpc.AddGenOne("Hello.HelloS", "