Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jk_interface_test
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangqiang
jk_interface_test
Commits
1e87a764
Commit
1e87a764
authored
Sep 04, 2020
by
huangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加数据
parent
d45bc3ad
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
38 deletions
+47
-38
config.py
config.py
+39
-0
jky_api.xlsx
data/api/jky_api.xlsx
+0
-0
jky_request_data.xlsx
data/request_data/jky_request_data.xlsx
+0
-0
run.py
run.py
+8
-38
No files found.
config.py
0 → 100644
View file @
1e87a764
# coding: utf-8
run_setting
=
{
"host"
:
"192.168.32.43:3000"
,
# [ding_ding_url]
"web_hook"
:
"https://oapi.dingtalk.com/robot/send?access_token=a57807f226f62dfa680edafc9394354c16754c88d111312361f24fab3b36b690"
,
"report_path"
:
"data/report/jky_report.xls"
,
"email"
:
{
"host"
:
"smtp.exmail.qq.com"
,
"port"
:
465
,
"from_adress"
:
"huangqiang1@jiuaoedu.com"
,
"password"
:
"JhyC5M5rCtfBGsab"
,
"to_adresses"
:
[
"mzx6010@dingtalk.com"
]
},
"postgreSql"
:
{
"database"
:
"edu-admin"
,
"user"
:
"dev"
,
"password"
:
"192.168.32.41"
,
"port"
:
"5432"
},
"headers"
:
{
"header1"
:
"""{"Content-Type": "application/json;charset=UTF-8", "Accept": "application/json, text/plain, */*"}"""
,
"header2"
:
"""{"Content-Type": "application/json;charset=UTF-8", "Authorization": "Bearer ${global_token}"}"""
,
"header3"
:
"""{"Accept": "application/json, text/plain, */*"}"""
,
"header4"
:
"""{"Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json, text/plain, */*"}"""
},
"excel_setting"
:
{
"sys_name"
:
"极运营"
,
"module_name"
:
"登录、教务管理、报名、财务管理、系统设置、报表、知识库"
,
"api_data_path"
:
"data/api/jky_api.xlsx"
,
"request_data_path"
:
"data/request_data/jky_request_data.xlsx"
,
# "sheet_name": ["login","teach_manage","apply","financial_manage","system_setting","statistics_report","knowledge"]
"sheet_name"
:
[
"login"
]
},
"global_variable"
:
{
"global_school_area_id"
:
3015
,
"student_id"
:
"5878455"
}
}
data/api/jky_api.xlsx
View file @
1e87a764
No preview for this file type
data/request_data/jky_request_data.xlsx
View file @
1e87a764
No preview for this file type
run.py
View file @
1e87a764
# coding:utf-8
# coding:utf-8
import
sys
import
sys
from
hq_framework.main.run_api
import
Run
from
hq_framework.main.run_api
import
Run
from
hq_framework.main
import
init_conf
from
hq_framework.common.operation_log
import
Log
from
hq_framework.common.operation_log
import
Log
from
config
import
run_setting
log
=
Log
(
__name__
)
.
get_logger
()
log
=
Log
(
__name__
)
.
get_logger
()
class
GetSysArgs
:
def
get_host
(
args
:
list
):
def
__init__
(
self
,
args
:
list
):
log
.
info
(
"输入的命令行参数args:
%
s"
%
repr
(
args
))
if
len
(
args
)
==
2
:
return
args
[
1
]
if
len
(
args
)
==
2
else
"192.168.32.43:3000"
self
.
ip
=
args
[
1
]
print
(
self
.
ip
)
log
.
info
(
"输入的命令行参数args:
%
s"
%
args
)
else
:
print
(
args
)
self
.
ip
=
"132.232.15.12"
log
.
info
(
"输入的命令行参数args:
%
s没有ip或参数过多使用: ip: 132.232.15.12"
%
args
)
def
get_ip
(
self
):
if
self
.
ip
==
"geek.jkwljy.com"
or
self
.
validate_ip
():
return
self
.
ip
else
:
log
.
info
(
"输入的ip:
%
s有误,使用默认Ip: ip: 132.232.15.12"
%
self
.
ip
)
return
"132.232.15.12"
def
validate_ip
(
self
)
->
bool
:
sep
=
self
.
ip
.
split
(
':'
)[
0
]
.
split
(
"."
)
if
len
(
sep
)
!=
4
:
return
False
for
i
,
x
in
enumerate
(
sep
):
try
:
int_x
=
int
(
x
)
if
int_x
<
0
or
int_x
>
255
:
return
False
except
ValueError
:
return
False
return
True
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
ip
=
GetSysArgs
(
sys
.
argv
)
.
get_ip
()
host
=
get_host
(
sys
.
argv
)
print
(
"获取的ip:"
+
ip
)
log
.
info
(
"获取的host:"
+
host
)
log
.
info
(
"用于初始化config的ip:"
+
ip
)
run_setting
.
setdefault
(
"host"
,
host
)
config_path
=
"data/config/config.conf"
Run
(
run_setting
)
.
run
()
path_config_path
=
"data/config/data_path.conf"
init_conf
.
InitConfig
(
ip
,
config_path
)
Run
(
config_path
,
path_config_path
)
.
run
()
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