Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
share
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张振华
share
Commits
5a6cfb9d
Commit
5a6cfb9d
authored
Dec 10, 2019
by
张振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace interface_check_tool.py
parent
14fae211
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
interface_check_tool.py
接口文档和代码对比工具/interface_check_tool.py
+5
-6
No files found.
接口文档和代码对比工具/interface_check_tool.py
View file @
5a6cfb9d
impor
t
requests
impor
t
requests
...
...
@@ -5,7 +5,6 @@ import requests
import
os
import
sys
#注意:此处需要按照本地实际的项目路径来填写
plugpath
=
'/home/user/code/go/plugin/plugin'
command
=
"ls $GOPATH/pkg/mod/github.com/33cn|tail -n 1"
...
...
@@ -178,7 +177,7 @@ def checkInterfacesByCid(cid):
for
line
in
open
(
cidFile
):
#print(line)
if
flag
==
0
:
#初始状态
if
line
.
find
(
u"请求报文
[
"
)
!=
-
1
:
if
line
.
find
(
u"请求报文
<
"
)
!=
-
1
:
flag
=
1
req
=
line
.
split
(
'['
)[
1
]
.
split
(
']'
)[
0
]
print
(
reqMsg
)
...
...
@@ -235,7 +234,7 @@ def checkInterfacesByCid(cid):
flag
=
4
file2
.
close
()
compareFields
(
subpath
,
method
,
reqMsg
)
cidResultFile
.
write
(
'
\t\t\t
"method":"'
+
method
+
'",
\n\t\t\t
"msg":"'
+
reqMsg
+
'",
\n
'
)
cidResultFile
.
write
(
'
\t\t\t
"method":"'
+
method
[
0
:
len
(
method
)
-
len
(
reqMsg
)
-
1
]
+
'",
\n\t\t\t
"msg":"'
+
reqMsg
+
'",
\n
'
)
f
=
open
(
subpath
+
'/diff'
)
content
=
f
.
read
()
if
len
(
content
)
==
0
:
...
...
@@ -282,13 +281,13 @@ def collectResults(cids):
file
.
write
(
',
\n\t
'
+
content
)
tmpFile
.
close
()
file
.
write
(
'
]
\n
}
\n
'
)
file
.
write
(
'
\t
]
\n
}
'
)
file
.
close
()
cids
=
[
'93'
,
'94'
,
'100'
,
'99'
,
'98'
,
'97'
,
'96'
,
'102'
,
'105'
,
'104'
,
'108'
,
'110'
,
'115'
,
'118'
,
'134'
,
'135'
]
#cids = ['
93
']
#cids = ['
135
']
for
cid
in
cids
:
checkInterfacesByCid
(
cid
)
...
...
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