Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ashermed_old_push
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
backend
ashermed_old_push
Commits
e1d8ca03
Commit
e1d8ca03
authored
Oct 22, 2022
by
席世权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送添加环境参数
parent
f9087de0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
12 deletions
+25
-12
OutProcessTaskBLL.cs
PushApi.Act/BLL/OutProcessTaskBLL.cs
+2
-1
PushValModel.cs
PushApi.Act/Models/Send/PushValModel.cs
+4
-0
ProcessTaskBLL.cs
PushInfo.Core/BLL/ProcessTaskBLL.cs
+15
-9
Map_Project_Push.cs
PushInfo.Core/Models/Tables/Map_Project_Push.cs
+4
-2
No files found.
PushApi.Act/BLL/OutProcessTaskBLL.cs
View file @
e1d8ca03
...
@@ -55,6 +55,7 @@ namespace PushApi.Act.BLL
...
@@ -55,6 +55,7 @@ namespace PushApi.Act.BLL
task
.
Push_WebLink
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
PushWebLink
,
task
.
Push_WebLink
),
data
);
task
.
Push_WebLink
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
PushWebLink
,
task
.
Push_WebLink
),
data
);
task
.
Push_WechatLink
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
PushWechatLink
,
task
.
Push_WechatLink
),
data
);
task
.
Push_WechatLink
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
PushWechatLink
,
task
.
Push_WechatLink
),
data
);
task
.
EnvType
=
valModel
.
EnvType
;
if
(
taskBll
.
ConfirmSend
(
task
,
data
))
if
(
taskBll
.
ConfirmSend
(
task
,
data
))
{
{
result
.
DetailedMessage
=
"发送成功"
;
result
.
DetailedMessage
=
"发送成功"
;
...
...
PushApi.Act/Models/Send/PushValModel.cs
View file @
e1d8ca03
...
@@ -69,5 +69,9 @@ namespace PushApi.Act.Models.Send
...
@@ -69,5 +69,9 @@ namespace PushApi.Act.Models.Send
/// 推送数据包
/// 推送数据包
/// </summary>
/// </summary>
public
Dictionary
<
string
,
string
>
DicValue
{
get
;
set
;
}
public
Dictionary
<
string
,
string
>
DicValue
{
get
;
set
;
}
/// <summary>
/// 环境类型1-生产,2-测试
/// </summary>
public
int
?
EnvType
{
get
;
set
;
}
=
1
;
}
}
}
}
PushInfo.Core/BLL/ProcessTaskBLL.cs
View file @
e1d8ca03
...
@@ -455,7 +455,7 @@ namespace PushInfo.Core.BLL
...
@@ -455,7 +455,7 @@ namespace PushInfo.Core.BLL
AppPushConfig
appCfgModel
=
JsonUtil
.
ConvertToObject
<
AppPushConfig
>(
appCfg
.
Config_Info
);
AppPushConfig
appCfgModel
=
JsonUtil
.
ConvertToObject
<
AppPushConfig
>(
appCfg
.
Config_Info
);
if
(!
string
.
IsNullOrEmpty
(
Data
.
clientID
)
&&
!
string
.
IsNullOrEmpty
(
Data
.
clientType
))
if
(!
string
.
IsNullOrEmpty
(
Data
.
clientID
)
&&
!
string
.
IsNullOrEmpty
(
Data
.
clientType
))
{
{
result
=
Send_PushJg
(
appCfgModel
,
Data
.
clientID
,
Data
.
clientType
,
mapProPush
.
Push_Title
,
mapProPush
.
Push_Body
,
mapProPush
.
Push_AndLink
,
mapProPush
.
Push_IosLink
);
result
=
Send_PushJg
(
appCfgModel
,
Data
.
clientID
,
Data
.
clientType
,
mapProPush
);
}
}
else
else
{
{
...
@@ -523,11 +523,15 @@ namespace PushInfo.Core.BLL
...
@@ -523,11 +523,15 @@ namespace PushInfo.Core.BLL
/// <param name="andActionLink"></param>
/// <param name="andActionLink"></param>
/// <param name="iosActionLink"></param>
/// <param name="iosActionLink"></param>
/// <returns></returns>
/// <returns></returns>
public
APIResult
<
string
>
Send_PushJg
(
AppPushConfig
appCfgModel
,
string
clientId
,
string
clientType
,
string
pushTitle
,
string
pushBody
,
string
andActionLink
,
string
iosActionLink
)
public
APIResult
<
string
>
Send_PushJg
(
AppPushConfig
appCfgModel
,
string
clientId
,
string
clientType
,
Map_Project_Push
mapProPush
)
{
{
var
message
=
new
JiguangPushMessage
(
appCfgModel
.
AppKey
,
appCfgModel
.
MasterSecret
);
var
message
=
new
JiguangPushMessage
(
appCfgModel
.
AppKey
,
appCfgModel
.
MasterSecret
);
string
pushTitle
=
mapProPush
.
Push_Title
;
string
pushBody
=
mapProPush
.
Push_Body
;
string
andActionLink
=
mapProPush
.
Push_AndLink
;
string
iosActionLink
=
mapProPush
.
Push_IosLink
;
Dictionary
<
string
,
object
>
extras
=
new
Dictionary
<
string
,
object
>();
Dictionary
<
string
,
object
>
extras
=
new
Dictionary
<
string
,
object
>();
if
(
clientType
.
ToLower
()
==
"ios"
)
if
(
clientType
.
ToLower
()
==
"ios"
||
clientType
==
"2"
)
{
{
if
(!
string
.
IsNullOrEmpty
(
iosActionLink
))
if
(!
string
.
IsNullOrEmpty
(
iosActionLink
))
{
{
...
@@ -549,6 +553,8 @@ namespace PushInfo.Core.BLL
...
@@ -549,6 +553,8 @@ namespace PushInfo.Core.BLL
bool
isProd
=
false
;
bool
isProd
=
false
;
if
(
System
.
Configuration
.
ConfigurationManager
.
AppSettings
[
"IsProd"
]
==
"1"
)
if
(
System
.
Configuration
.
ConfigurationManager
.
AppSettings
[
"IsProd"
]
==
"1"
)
isProd
=
true
;
isProd
=
true
;
if
(
mapProPush
.
EnvType
==
2
)
isProd
=
false
;
return
message
.
SendPush
(
new
Jiguang
.
JPush
.
Model
.
Audience
{
RegistrationId
=
new
List
<
string
>
{
clientId
}
},
return
message
.
SendPush
(
new
Jiguang
.
JPush
.
Model
.
Audience
{
RegistrationId
=
new
List
<
string
>
{
clientId
}
},
pushTitle
,
pushBody
,
intent
,
pushTitle
,
pushBody
,
intent
,
extras
,
isProd
);
extras
,
isProd
);
...
@@ -580,12 +586,12 @@ namespace PushInfo.Core.BLL
...
@@ -580,12 +586,12 @@ namespace PushInfo.Core.BLL
{
{
try
try
{
{
//
ConfirmSendTask(mapProPush, data);
ConfirmSendTask
(
mapProPush
,
data
);
if
(
mapProPush
.
Push_Style
.
IndexOf
(((
int
)
PushStyle
.
APP
).
ToString
())
>
-
1
)
//
if (mapProPush.Push_Style.IndexOf(((int)PushStyle.APP).ToString()) > -1)
MqNameTwo
=
MqName
;
//
MqNameTwo = MqName;
else
if
(
mapProPush
.
Push_Style
.
IndexOf
(((
int
)
PushStyle
.
极光
App
).
ToString
())
>
-
1
)
//
else if (mapProPush.Push_Style.IndexOf(((int)PushStyle.极光App).ToString()) > -1)
MqNameTwo
=
MqNameUrora
;
//
MqNameTwo = MqNameUrora;
ActiveMQHelper
.
CreateMQProducer
(
MqNameTwo
,
MQMode
.
Queue
,
new
DataCenterMessage
{
ObjectID
=
""
,
MsgData
=
mapProPush
.
ToJson
(),
MsgSecondData
=
data
.
ToJson
()
},
sendDate
);
//
ActiveMQHelper.CreateMQProducer(MqNameTwo, MQMode.Queue, new DataCenterMessage { ObjectID = "", MsgData = mapProPush.ToJson(), MsgSecondData = data.ToJson() }, sendDate);
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
...
...
PushInfo.Core/Models/Tables/Map_Project_Push.cs
View file @
e1d8ca03
...
@@ -156,7 +156,9 @@ namespace PushInfo.Core.Models.Tables
...
@@ -156,7 +156,9 @@ namespace PushInfo.Core.Models.Tables
/// </summary>
/// </summary>
[
IgnoreColumn
]
[
IgnoreColumn
]
public
Dictionary
<
string
,
string
>
valMap
{
get
;
set
;
}
public
Dictionary
<
string
,
string
>
valMap
{
get
;
set
;
}
/// <summary>
/// 环境类型
/// </summary>
public
int
?
EnvType
{
get
;
set
;
}
}
}
}
}
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