Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test_platform
Project
Project
Details
Activity
Releases
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
Wallen姚文辉
test_platform
Commits
cd8f79da
Commit
cd8f79da
authored
May 29, 2024
by
Wallen姚文辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增默认抄送人
parent
f4542600
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
Tool.py
controller/Tool.py
+15
-1
User.py
controller/User.py
+1
-1
Model.py
model/Model.py
+1
-0
No files found.
controller/Tool.py
View file @
cd8f79da
...
...
@@ -167,7 +167,7 @@ def deleteemailuser(id_):
@
tool
.
route
(
'/testport/emailuserlist'
,
methods
=
[
"GET"
])
def
emailuserlist
():
data
=
db
.
session
.
query
(
Emails
.
id
,
Emails
.
name
,
Emails
.
address
)
.
all
()
data
=
db
.
session
.
query
(
Emails
.
id
,
Emails
.
name
,
Emails
.
address
,
Emails
.
default_cc
)
.
all
()
db
.
session
.
close
()
return
jsonify
({
"code"
:
200
,
"message"
:
"请求成功"
,
"data"
:
sqlOrmToJson
(
data
)}),
200
...
...
@@ -178,6 +178,20 @@ def editemailuser():
db
.
session
.
close
()
return
jsonify
({
"code"
:
200
,
"message"
:
"请求成功"
}),
200
@
tool
.
route
(
'/testport/changedefaultCC/<id_>'
,
methods
=
[
"POST"
])
def
changedefaultCC
(
id_
):
a
=
db
.
session
.
query
(
Emails
)
.
filter_by
(
id
=
int
(
id_
))
.
first
()
a
.
default_cc
=
int
(
not
a
.
default_cc
)
db
.
session
.
commit
()
db
.
session
.
close
()
return
jsonify
({
"code"
:
200
,
"message"
:
"修改成功"
}),
200
@
tool
.
route
(
'/testport/defaultCClist'
,
methods
=
[
"GET"
])
def
defaultCClist
():
data
=
db
.
session
.
query
(
Emails
.
id
,
Emails
.
name
,
Emails
.
address
,
Emails
.
default_cc
)
.
filter
(
Emails
.
default_cc
==
1
)
.
all
()
db
.
session
.
close
()
return
jsonify
({
"code"
:
200
,
"message"
:
"请求成功"
,
"data"
:
sqlOrmToJson
(
data
)}),
200
@
tool
.
route
(
'/testcase/uploadcase'
,
methods
=
[
"POST"
])
def
uplooadcase
():
data_
=
request
.
json
...
...
controller/User.py
View file @
cd8f79da
...
...
@@ -152,7 +152,7 @@ def finduser():
data
=
request
.
args
page_size
=
int
(
data
.
get
(
"page_size"
))
page_num
=
int
(
data
.
get
(
"page_num"
))
users
=
db
.
session
.
query
(
User
.
id
,
User
.
name
,
func
.
date_format
(
User
.
create_date
,
"
%
Y-
%
m-
%
d
%
H:
%
i:
%
s"
)
.
label
(
'create_date'
),
User
.
role_id
,
Role
.
name
.
label
(
"role_name"
),
Organization
.
id
.
label
(
"organization_id"
),
Organization
.
path
)
.
outerjoin
(
Role
,
Role
.
id
==
User
.
role_id
)
.
outerjoin
(
Organization
,
Organization
.
id
==
User
.
organization_id
)
users
=
db
.
session
.
query
(
User
.
id
,
User
.
name
,
User
.
disable
,
func
.
date_format
(
User
.
create_date
,
"
%
Y-
%
m-
%
d
%
H:
%
i:
%
s"
)
.
label
(
'create_date'
),
User
.
role_id
,
Role
.
name
.
label
(
"role_name"
),
Organization
.
id
.
label
(
"organization_id"
),
Organization
.
path
)
.
outerjoin
(
Role
,
Role
.
id
==
User
.
role_id
)
.
outerjoin
(
Organization
,
Organization
.
id
==
User
.
organization_id
)
if
data
.
get
(
"name"
):
users
=
users
.
filter
(
User
.
name
.
like
(
"
%
"
+
data
.
get
(
"name"
)
+
"
%
"
))
if
data
.
getlist
(
'organizations[]'
):
...
...
model/Model.py
View file @
cd8f79da
...
...
@@ -96,6 +96,7 @@ class Emails(db.Model):
__table_args__
=
{
'mysql_engine'
:
'InnoDB'
,
'mysql_charset'
:
'utf8mb4'
}
id
=
Column
(
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
name
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'邮件的用户名'
)
default_cc
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
text
(
"0"
),
comment
=
'默认抄送人,1true-0false'
)
address
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'地址'
)
...
...
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