-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deepcopy operator, to fix all request share the same operator ob…
…ject problem
- Loading branch information
Showing
5 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package failed | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/gin-gonic/gin" | ||
"github.com/go-jarvis/rum-gonic/pkg/httpx" | ||
) | ||
|
||
type CreateUser struct { | ||
httpx.MethodPost `path:"/create-user"` | ||
|
||
Data CreateUserParams `body:"body"` | ||
Sleep int `query:"sleep"` | ||
} | ||
|
||
type CreateUserParams struct { | ||
Name string `json:"name"` | ||
Password string `json:"password"` | ||
} | ||
|
||
func (u *CreateUser) Output(c *gin.Context) (interface{}, error) { | ||
|
||
fmt.Println("before:", u) | ||
|
||
d := time.Duration(u.Sleep) * time.Second | ||
time.Sleep(d) | ||
|
||
fmt.Println("after:", u) | ||
|
||
return u, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
|
||
|
||
### GET | ||
GET http://127.0.0.1:8080/rum/binding?name=zhangsan&password=zhangsan123 | ||
|
||
|
||
|
||
|
||
### GET | ||
GET http://127.0.0.1:8080/rum/binding | ||
|
||
|
||
### create user | ||
POST http://127.0.0.1:8080/rum/create-user?sleep=5 | ||
Content-Type: application/json | ||
|
||
{ | ||
"name":"zhangsan", | ||
"password":"zhangsan123" | ||
} | ||
|
||
|
||
### create user | ||
POST http://127.0.0.1:8080/rum/create-user?sleep=3 | ||
Content-Type: application/json | ||
|
||
{ | ||
"name":"wangwu", | ||
"password":"wangwu123" | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters