Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app_push
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
ikcrm_server
app_push
Commits
ddb1aa07
Commit
ddb1aa07
authored
Oct 17, 2019
by
李福中
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sync_push options
parent
4c671d66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
app/controllers/pushs_controller.rb
+8
-1
No files found.
app/controllers/pushs_controller.rb
View file @
ddb1aa07
...
@@ -25,13 +25,20 @@ class PushsController < ApplicationController
...
@@ -25,13 +25,20 @@ class PushsController < ApplicationController
param!
:message
,
String
,
required:
true
param!
:message
,
String
,
required:
true
param!
:igetui_opts
,
String
param!
:igetui_opts
,
String
param!
:app_type
,
String
param!
:app_type
,
String
param!
:sync_push
,
String
igetui_opts
=
JSON
.
parse
(
params
[
:igetui_opts
])
rescue
{}
igetui_opts
=
JSON
.
parse
(
params
[
:igetui_opts
])
rescue
{}
message
=
JSON
.
parse
(
params
[
:message
])
rescue
{}
message
=
JSON
.
parse
(
params
[
:message
])
rescue
{}
device_ids_opts
=
JSON
.
parse
(
params
[
:device_ids_opts
])
rescue
{}
device_ids_opts
=
JSON
.
parse
(
params
[
:device_ids_opts
])
rescue
{}
token
=
token_and_options
(
request
).
first
token
=
token_and_options
(
request
).
first
if
token
==
Token
.
token
(
params
[
:app_name
])
if
token
==
Token
.
token
(
params
[
:app_name
])
::
PushWorker
.
perform_async
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
if
params
.
has_key?
(
:sync_push
)
Timeout
.
timeout
(
3
)
{
::
PushWorker
.
new
.
perform
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
}
else
::
PushWorker
.
perform_async
(
device_ids_opts
,
message
,
igetui_opts
,
params
[
:app_type
])
end
render
json:
{
code:
0
,
message:
'success'
,
describe:
'异步任务正在处理'
}
render
json:
{
code:
0
,
message:
'success'
,
describe:
'异步任务正在处理'
}
else
else
render
json:
{
code:
-
1
,
message:
'token 错误/过期'
}
render
json:
{
code:
-
1
,
message:
'token 错误/过期'
}
...
...
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