Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
thirdCallbackServer
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wang
thirdCallbackServer
Commits
2a8891f8
Commit
2a8891f8
authored
Jul 30, 2023
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加了一些路由和处理函数。
parent
209c564a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
main.py
main.py
+48
-0
No files found.
main.py
View file @
2a8891f8
import
random
import
uvicorn
from
fastapi
import
FastAPI
,
Body
...
...
@@ -15,6 +17,52 @@ async def type_1(req: dict = Body()):
return
"success"
@app.post
(
"/type_2/"
)
async
def
type_1
(
req
:
dict
=
Body
()):
print
(
req
)
return
{
"code"
:
0
}
@app.post
(
"/type_3/"
)
async
def
type_1
(
req
:
dict
=
Body
()):
print
(
req
)
return
{
"status"
:
200
,
"msg"
:
""
,
"data"
:
""
}
@app.post
(
"/type_4/"
)
async
def
type_1
(
req
:
dict
=
Body
()):
print
(
req
)
return
{
"msg"
:
""
,
"code"
:
0
}
@app.post
(
"/type_5/"
)
async
def
type_1
(
req
:
dict
=
Body
()):
print
(
req
)
return
{
"code"
:
0
,
"message"
:
"success"
}
@app.post
(
"/type_6/"
)
async
def
type_1
(
req
:
dict
=
Body
()):
print
(
req
)
return
{
"code"
:
0
,
"msg"
:
"ok"
}
@app.post
(
"/type_random/"
)
async
def
type_1
(
req
:
dict
=
Body
()):
result
=
[
"success"
,
{
"code"
:
0
},
{
"status"
:
200
,
"msg"
:
""
,
"data"
:
""
},
{
"msg"
:
""
,
"code"
:
0
},
{
"code"
:
0
,
"message"
:
"success"
},
{
"code"
:
0
,
"msg"
:
"ok"
},
{
"code"
:
1
,
"msg"
:
"no query results for model [app
\\
services
\\
ordermachine
\\
model
\\
deliveryorderkfwmodel]."
,
"data"
:
[]},
{
"msg"
:
"重复回调"
,
"code"
:
1
}
]
return
random
.
choice
(
result
)
if
__name__
==
'__main__'
:
uvicorn
.
run
(
app
=
"main:app"
,
...
...
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