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
49bbe94d
Commit
49bbe94d
authored
Dec 10, 2019
by
liangyuzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change name
parent
ee77a11a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
42 deletions
+26
-42
app/controllers/application_controller.rb
+1
-1
app/controllers/concerns/token_validate.rb
+1
-1
app/services/huawei/pusher.rb
+1
-1
app/services/igetui/android_pusher.rb
+0
-16
app/services/igetui/ios_pusher.rb
+0
-16
app/services/igetui/pusher.rb
+3
-3
app/services/push_tool_client.rb
+5
-4
app/services/xiaomi/pusher.rb
+0
-0
config/initializers/pusher.rb
+15
-0
No files found.
app/controllers/application_controller.rb
View file @
49bbe94d
class
ApplicationController
<
ActionController
::
Base
rescue_from
StandardError
,
with: :rescue_all
include
Token
include
Token
Validate
def
rescue_all
(
e
)
ErrorLog
.
error
(
e
)
...
...
app/controllers/concerns/token.rb
→
app/controllers/concerns/token
_validate
.rb
View file @
49bbe94d
module
Token
module
Token
Validate
extend
ActiveSupport
::
Concern
ACCESS_TOEKN_EXPIRE_TIME
=
7200
...
...
app/services/huawei/
base
.rb
→
app/services/huawei/
pusher
.rb
View file @
49bbe94d
module
Huawei
class
Base
class
Pusher
ACCESS_TOKEN_KEY
=
"push:huawei_push:access_token"
.
freeze
TOKEN_URL
=
'https://login.cloud.huawei.com/oauth2/v2/token'
.
freeze
PUSH_URL
=
'https://api.push.hicloud.com/pushsend.do'
.
freeze
...
...
app/services/igetui/android_pusher.rb
deleted
100644 → 0
View file @
ee77a11a
module
Igetui
class
AndroidPusher
include
Singleton
def
self
.
pusher
$android_pusher
||=
IGeTui
.
pusher
(
Settings
.
platform_settings
.
igetui
.
android
[
'app_id'
],
Settings
.
platform_settings
.
igetui
.
android
[
'app_key'
],
Settings
.
platform_settings
.
igetui
.
android
[
'master_secret'
]
)
end
end
end
\ No newline at end of file
app/services/igetui/ios_pusher.rb
deleted
100644 → 0
View file @
ee77a11a
module
Igetui
class
IosPusher
include
Singleton
def
self
.
pusher
$android_pusher
||=
IGeTui
.
pusher
(
Settings
.
platform_settings
.
igetui
.
ios
[
'app_id'
],
Settings
.
platform_settings
.
igetui
.
ios
[
'app_key'
],
Settings
.
platform_settings
.
igetui
.
ios
[
'master_secret'
]
)
end
end
end
\ No newline at end of file
app/services/igetui/
base
.rb
→
app/services/igetui/
pusher
.rb
View file @
49bbe94d
module
Igetui
class
Base
class
Pusher
def
initialize
(
user_device_ids
,
opts
)
opts
=
HashWithIndifferentAccess
.
new
(
opts
)
...
...
@@ -26,9 +26,9 @@ module Igetui
def
pusher
(
device_platform
)
case
device_platform
when
'android'
Igetui
::
AndroidPusher
.
pusher
$android_
pusher
when
'ios'
Igetui
::
IosPusher
.
pusher
$ios_
pusher
end
end
...
...
app/services/push_tool_client.rb
View file @
49bbe94d
...
...
@@ -16,8 +16,8 @@ class PushToolClient
igetui_android_device_ids
=
@igetui_push_device_collections
[
'android'
].
map
(
&
:device_id
)
igetui_ios_device_ids
=
@igetui_push_device_collections
[
'ios'
].
map
(
&
:device_id
)
Igetui
::
Base
.
new
(
igetui_android_device_ids
,
@opts
.
merge
(
device_platform:
'android'
)).
perform
if
igetui_android_device_ids
.
present?
Igetui
::
Base
.
new
(
igetui_ios_device_ids
,
@opts
.
merge
(
device_platform:
'ios'
)).
perform
if
igetui_ios_device_ids
.
present?
Igetui
::
Pusher
.
new
(
igetui_android_device_ids
,
@opts
.
merge
(
device_platform:
'android'
)).
perform
if
igetui_android_device_ids
.
present?
Igetui
::
Pusher
.
new
(
igetui_ios_device_ids
,
@opts
.
merge
(
device_platform:
'ios'
)).
perform
if
igetui_ios_device_ids
.
present?
#现在好像不用了
# Push::IgetuiIos.push(@push_collections[:igetui_ios], @opts) if @push_collections[:apns].present?
...
...
@@ -26,7 +26,7 @@ class PushToolClient
xiaomi_device_ids
=
@push_device_collections
[
'xiaomi'
].
map
(
&
:device_id
)
huawei_device_ids
=
@push_device_collections
[
'huawei'
].
map
(
&
:device_id
)
Xiaomi
::
Base
.
new
(
xiaomi_device_ids
,
@opts
[
:message
]).
perform
if
xiaomi_device_ids
.
present?
Huawei
::
Base
.
new
(
huawei_device_ids
,
@opts
[
:message
]).
perform
if
huawei_device_ids
.
present?
Xiaomi
::
Pusher
.
new
(
xiaomi_device_ids
,
@opts
[
:message
]).
perform
if
xiaomi_device_ids
.
present?
Huawei
::
Pusher
.
new
(
huawei_device_ids
,
@opts
[
:message
]).
perform
if
huawei_device_ids
.
present?
end
end
\ No newline at end of file
app/services/xiaomi/
base
.rb
→
app/services/xiaomi/
pusher
.rb
View file @
49bbe94d
File moved
config/initializers/pusher.rb
0 → 100644
View file @
49bbe94d
$android_pusher
||=
IGeTui
.
pusher
(
Settings
.
platform_settings
.
igetui
.
android
[
'app_id'
],
Settings
.
platform_settings
.
igetui
.
android
[
'app_key'
],
Settings
.
platform_settings
.
igetui
.
android
[
'master_secret'
]
)
$ios_pusher
||=
IGeTui
.
pusher
(
Settings
.
platform_settings
.
igetui
.
ios
[
'app_id'
],
Settings
.
platform_settings
.
igetui
.
ios
[
'app_key'
],
Settings
.
platform_settings
.
igetui
.
ios
[
'master_secret'
]
)
\ No newline at end of file
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