Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TestAuto
InterfaceAutoTest
Commits
cbe6da00
Commit
cbe6da00
authored
Apr 30, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Plain Diff
制造冲突
parents
75fe69ae
5bb0a00e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
common/db.py
+29
-0
No files found.
common/db.py
View file @
cbe6da00
import
redis
# redis类
class
RedisBase
:
def
__init__
(
self
,
inum
):
"""每一个数据库实例管理一个连接池"""
self
.
num
=
inum
pool
=
redis
.
ConnectionPool
(
host
=
'10.197.236.197'
,
port
=
6379
,
db
=
0
,
password
=
'123456'
)
self
.
r
=
redis
.
Redis
(
connection_pool
=
pool
)
class
RedisString
(
RedisBase
):
def
__init__
(
self
,
inum
):
RedisBase
.
__init__
(
self
,
inum
=
inum
)
def
get
(
self
,
xx
):
"""获取值"""
result
=
self
.
r
.
get
(
xx
)
return
result
if
__name__
==
'__main__'
:
# r= RedisString(6).get('bmc:captcha:bf46c0c0-11b4-4b7d-99d7-530f77f8ab88')
# r = RedisString(0).get('edl:sms_value:17822000010:MOBILE_REGISTER')
# print(r)
# print(str(r)[-7:-1])
pass
\ No newline at end of file
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