Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
be8fc2fd
Commit
be8fc2fd
authored
Jan 11, 2021
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
0a880f7e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
11 deletions
+31
-11
__main__.py
app/api/__main__.py
+1
-1
config.yaml
app/config/config.yaml
+4
-2
template_manage.py
app/controller/template_manage.py
+14
-2
base.py
app/model/base.py
+3
-1
template_manage_service.py
app/service/template_manage_service.py
+8
-4
start.sh
start.sh
+1
-1
No files found.
app/api/__main__.py
View file @
be8fc2fd
...
...
@@ -9,5 +9,5 @@
from
app.api.app
import
app
if
__name__
==
'__main__'
:
app
.
run
(
'0.0.0.0'
,
port
=
8000
,
debug
=
Fals
e
)
app
.
run
(
'0.0.0.0'
,
port
=
8000
,
debug
=
Tru
e
)
app/config/config.yaml
View file @
be8fc2fd
...
...
@@ -3,10 +3,12 @@ dev:
tamp_product_db
:
tamp_product
tamp_order_db
:
tamp_order
tamp_user_db
:
tamp_user
tamp_fund_db
:
tamp_fund
tamp_diagnose_app_db
:
tamp_diagnose_app
host
:
47.101.189.151
port
:
31931
user
:
root
password
:
mysql
user
:
dev
password
:
qimeng123
redis
:
host
:
localhost
port
:
6379
...
...
app/controller/template_manage.py
View file @
be8fc2fd
...
...
@@ -56,6 +56,12 @@ class TemplateManage(Resource):
args
=
self
.
parser
.
parse_args
()
args
[
'ifa_id'
]
=
self
.
ifa_id
add_template
(
args
)
resp
=
{
"statusCode"
:
"0000"
,
"message"
:
"成功"
,
"attributes"
:
[]
}
return
resp
def
put
(
self
):
"""更新模版."""
...
...
@@ -79,12 +85,18 @@ class TemplateManage(Resource):
self
.
parser
.
add_argument
(
'id'
,
type
=
str
,
required
=
True
,
help
=
'模版id'
)
args
=
self
.
parser
.
parse_args
()
args
[
'ifa_id'
]
=
self
.
ifa_id
delete_template
(
args
)
res
=
delete_template
(
args
)
resp
=
{
"statusCode"
:
"0000"
,
"message"
:
"成功"
,
"attributes"
:
[]
}
if
not
res
:
resp
=
{
"statusCode"
:
"9002"
,
"message"
:
"删除失败"
,
"attributes"
:
[]
}
return
resp
...
...
@@ -102,7 +114,7 @@ class TemplateList(Resource):
self
.
parser
=
reqparse
.
RequestParser
()
def
get
(
self
):
"""获取模版列表
,分页
."""
"""获取模版列表
分页数据
."""
self
.
parser
.
add_argument
(
'type'
,
type
=
int
,
required
=
True
,
help
=
'0为全部1为持仓报告2为诊断报告'
)
self
.
parser
.
add_argument
(
'pageNumber'
,
type
=
int
,
required
=
False
)
self
.
parser
.
add_argument
(
'pageSize'
,
type
=
int
,
required
=
False
)
...
...
app/model/base.py
View file @
be8fc2fd
...
...
@@ -6,6 +6,8 @@
# @Email : acepengxiong@163.com
# @Software : PyCharm
# -----------------------------------------------------------------------------
import
datetime
from
sqlalchemy.ext.declarative
import
declarative_base
Base
=
declarative_base
()
...
...
@@ -17,6 +19,6 @@ class BaseModel():
pass
def
to_dict
(
self
):
return
{
c
.
name
:
getattr
(
self
,
c
.
name
)
for
c
in
self
.
__table__
.
columns
}
return
{
c
.
name
:
int
(
getattr
(
self
,
c
.
name
)
.
timestamp
())
if
isinstance
(
getattr
(
self
,
c
.
name
),
datetime
.
datetime
)
else
getattr
(
self
,
c
.
name
)
for
c
in
self
.
__table__
.
columns
}
app/service/template_manage_service.py
View file @
be8fc2fd
...
...
@@ -50,7 +50,7 @@ def add_template(args):
args
[
'default_template'
]
=
json
.
dumps
(
hold_default_template
)
args
[
'create_by'
]
=
args
.
get
(
'ifa_id'
)
args
[
'create_time'
]
=
datetime
.
datetime
.
now
()
fund_report_manange
=
FundReportManange
(
args
)
fund_report_manange
=
FundReportManange
(
**
args
)
tamp_diagnose_session
.
add
(
fund_report_manange
)
def
update_template
(
args
):
...
...
@@ -98,13 +98,17 @@ def delete_template(args):
"""."""
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_session
=
tamp_diagnose_app
.
session
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
FundReportManange
.
id
==
args
.
get
(
id
)
)
.
update
({
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
FundReportManange
.
id
==
args
.
get
(
'id'
),
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
)
))
.
update
({
'delete_tag'
:
1
,
'update_by'
:
args
.
get
(
'ifa_id'
),
'update_time'
:
datetime
.
datetime
.
now
()
})
if
res
>
0
:
return
True
return
False
def
get_template_list
(
args
):
...
...
start.sh
View file @
be8fc2fd
#!/bin/bash
gunicorn
-w
2
-k
gevent
-D
-p
tamp_order.pid
-b
127.0.0.1:8000 app.api.app:api prod
\ No newline at end of file
gunicorn
-w
2
-k
gevent
-D
-p
fund_report.pid
-b
127.0.0.1:8000 app.api.app:api prod
\ 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