Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
8a51a500
Commit
8a51a500
authored
Apr 10, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/new_report' into dev
parents
fc7f11fb
5dd9c7f5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
6 deletions
+16
-6
performance/Performance.Api/appsettings.json
+2
-1
performance/Performance.ConsoleApp/Program.cs
+1
-1
performance/Performance.ConsoleApp/appsettings.json
+2
-1
performance/Performance.Extract.Api/appsettings.json
+2
-1
performance/Performance.Infrastructure/Util/EmailService.cs
+7
-0
performance/Performance.Services/AllotService.cs
+1
-1
performance/Performance.Services/DFExtractService.cs
+1
-1
No files found.
performance/Performance.Api/appsettings.json
View file @
8a51a500
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
"EmailOptions"
:
{
"EmailOptions"
:
{
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Password"
:
"SuValue123456"
"Password"
:
"SuValue123456"
,
"IsEnable"
:
true
},
},
"Application"
:
{
"Application"
:
{
//登录过期时间
//登录过期时间
...
...
performance/Performance.ConsoleApp/Program.cs
View file @
8a51a500
...
@@ -55,7 +55,7 @@ static void Main(string[] args)
...
@@ -55,7 +55,7 @@ static void Main(string[] args)
var
option
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
EmailOptions
>>();
var
option
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
EmailOptions
>>();
services
.
AddEmailUtil
(
config
=>
{
config
.
Account
=
option
.
Value
.
Account
;
config
.
Password
=
option
.
Value
.
Password
;
config
.
SmtpServer
=
option
.
Value
.
SmtpServer
;
});
services
.
AddEmailUtil
(
config
=>
{
config
.
Account
=
option
.
Value
.
Account
;
config
.
Password
=
option
.
Value
.
Password
;
config
.
SmtpServer
=
option
.
Value
.
SmtpServer
;
config
.
IsEnable
=
option
.
Value
.
IsEnable
;
});
var
emailService
=
services
.
BuildServiceProvider
().
GetService
<
IEmailService
>();
var
emailService
=
services
.
BuildServiceProvider
().
GetService
<
IEmailService
>();
var
message
=
new
EmailMessage
var
message
=
new
EmailMessage
{
{
...
...
performance/Performance.ConsoleApp/appsettings.json
View file @
8a51a500
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
"EmailOptions"
:
{
"EmailOptions"
:
{
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Password"
:
"SuValue123456"
"Password"
:
"SuValue123456"
,
"IsEnable"
:
true
},
},
"Application"
:
{
"Application"
:
{
//登录过期时间
//登录过期时间
...
...
performance/Performance.Extract.Api/appsettings.json
View file @
8a51a500
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
"EmailOptions"
:
{
"EmailOptions"
:
{
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Password"
:
"SuValue123456"
"Password"
:
"SuValue123456"
,
"IsEnable"
:
true
},
},
"Application"
:
{
"Application"
:
{
//登录过期时间
//登录过期时间
...
...
performance/Performance.Infrastructure/Util/EmailService.cs
View file @
8a51a500
...
@@ -25,6 +25,10 @@ public class EmailOptions
...
@@ -25,6 +25,10 @@ public class EmailOptions
/// 密码
/// 密码
/// </summary>
/// </summary>
public
string
Password
{
get
;
set
;
}
public
string
Password
{
get
;
set
;
}
/// <summary>
/// 是否启用
/// </summary>
public
bool
IsEnable
{
get
;
set
;
}
}
}
...
@@ -80,6 +84,9 @@ public Task<bool> SendAsync(EmailMessage message)
...
@@ -80,6 +84,9 @@ public Task<bool> SendAsync(EmailMessage message)
public
bool
Send
(
EmailMessage
message
)
public
bool
Send
(
EmailMessage
message
)
{
{
if
(!
options
.
IsEnable
)
return
true
;
MailMessage
mail
=
new
MailMessage
();
MailMessage
mail
=
new
MailMessage
();
try
try
{
{
...
...
performance/Performance.Services/AllotService.cs
View file @
8a51a500
...
@@ -382,7 +382,7 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time)
...
@@ -382,7 +382,7 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time)
$"您可以登录<a href=\"http://jixiao.suvalue.com\" target=\"_blank\">http://jixiao.suvalue.com</a>查看详细清空。</p>"
;
$"您可以登录<a href=\"http://jixiao.suvalue.com\" target=\"_blank\">http://jixiao.suvalue.com</a>查看详细清空。</p>"
;
}
}
//
emailService.SendAsync(message);
emailService
.
SendAsync
(
message
);
}
}
/// <summary>
/// <summary>
...
...
performance/Performance.Services/DFExtractService.cs
View file @
8a51a500
...
@@ -1123,7 +1123,7 @@ private void SendEmail(string mail, string path, string subject, string body)
...
@@ -1123,7 +1123,7 @@ private void SendEmail(string mail, string path, string subject, string body)
};
};
if
(!
string
.
IsNullOrEmpty
(
path
))
if
(!
string
.
IsNullOrEmpty
(
path
))
message
.
Attachments
=
new
List
<
string
>
{
path
};
message
.
Attachments
=
new
List
<
string
>
{
path
};
//
emailService.Send(message);
emailService
.
Send
(
message
);
}
}
/// <summary>
/// <summary>
...
...
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