Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
bp
ShenghuoquanBusiness
Commits
9bf2c4da
Commit
9bf2c4da
authored
Jul 27, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log.i -> timber
parent
4511959e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
BPushApplication.kt
...ava/com/yidian/shenghuoquan/bpush/app/BPushApplication.kt
+6
-2
PushService.kt
...java/com/yidian/shenghuoquan/bpush/service/PushService.kt
+6
-3
No files found.
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/app/BPushApplication.kt
View file @
9bf2c4da
...
...
@@ -4,14 +4,17 @@ import com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.news.util.ProcessUtil
import
com.yidian.shenghuoquan.bpush.service.PushService
import
com.yidian.yac.core.core.YacModuleSpec
import
com.yidian.yac.core.zap.Zap
import
timber.log.Timber
@YacModuleSpec
class
BPushApplication
:
YdBaseApplication
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
registerXpage
()
initServie
()
initServi
c
e
()
}
}
...
...
@@ -19,7 +22,8 @@ class BPushApplication: YdBaseApplication() {
}
private
fun
initServie
()
{
private
fun
initService
()
{
Timber
.
tag
(
"BPushApplication"
).
i
(
"initService"
)
Zap
.
addService
(
ZapServiceNameConstants
.
BPush
,
PushService
())
}
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/service/PushService.kt
View file @
9bf2c4da
package
com.yidian.shenghuoquan.bpush.service
import
android.util.Log
import
com.yidian.bcommon.services.ZapServiceActionConstants
import
com.yidian.xarc.xrouter.ResultResolver
import
com.yidian.yac.core.zap.ZapService
import
org.json.JSONObject
import
timber.log.Timber
class
PushService
:
ZapService
()
{
private
lateinit
var
resolver
:
ResultResolver
override
fun
onAction
(
path
:
String
,
action
:
String
,
params
:
Any
,
options
:
Any
,
resolver
:
ResultResolver
)
{
Log
.
i
(
"PushService"
,
"aciton is "
+
action
)
this
.
resolver
=
resolver
params
as
JSONObject
when
(
action
)
{
ZapServiceActionConstants
.
ActionPushMessage
->
pushMessage
()
ZapServiceActionConstants
.
ActionPushMessage
->
pushMessage
(
params
.
toString
()
)
}
}
...
...
@@ -21,8 +24,8 @@ class PushService : ZapService() {
override
fun
onInit
()
{
}
private
fun
pushMessage
()
{
private
fun
pushMessage
(
message
:
String
)
{
Timber
.
tag
(
"PushService"
).
i
(
message
)
}
...
...
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