Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wang
/
golang-open-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1a40590d
authored
Feb 07, 2021
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
锁测试
parent
ed7e60aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
controller/test.go
routes/router.go
controller/test.go
View file @
1a40590d
...
@@ -11,6 +11,13 @@ ctx.JSON(200,nil)
...
@@ -11,6 +11,13 @@ ctx.JSON(200,nil)
}
}
func
LockTest
(
ctx
*
gin
.
Context
)
{
defer
delOnlyLock
(
"test_lock"
)
addOnlyLock
(
"test_lock"
)
ctx
.
JSON
(
200
,
"锁测试"
)
}
//如果锁不存在并设置锁
//如果锁不存在并设置锁
func
addOnlyLock
(
key
string
){
func
addOnlyLock
(
key
string
){
redisWriteConn
:=
gredis
.
Conn
(
"search_w"
)
redisWriteConn
:=
gredis
.
Conn
(
"search_w"
)
...
...
routes/router.go
View file @
1a40590d
...
@@ -27,5 +27,6 @@ func InitRouter() *gin.Engine {
...
@@ -27,5 +27,6 @@ func InitRouter() *gin.Engine {
controller
.
Open_Middleware
(
"GetSkuListPrice"
),
controller
.
GetSkuListPrice
)
controller
.
Open_Middleware
(
"GetSkuListPrice"
),
controller
.
GetSkuListPrice
)
//
//
r
.
GET
(
"Test"
,
controller
.
Error_Middleware
(
"sku_query"
),
controller
.
TestRequest
)
r
.
GET
(
"Test"
,
controller
.
Error_Middleware
(
"sku_query"
),
controller
.
TestRequest
)
r
.
GET
(
"LockTest"
,
controller
.
Error_Middleware
(
"sku_query"
),
controller
.
LockTest
)
return
r
return
r
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment