Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
131b3c18
Commit
131b3c18
authored
Jun 10, 2020
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置设备信息
parent
8c9bb5d7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
15 deletions
+26
-15
config.gradle
config.gradle
+2
-2
LoginHelper.java
m-user/src/main/java/com/yidianling/user/LoginHelper.java
+11
-5
UserApi.kt
m-user/src/main/java/com/yidianling/user/http/UserApi.kt
+3
-3
UserHttpImpl.kt
m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
+3
-2
ChannelIdParam.kt
m-user/src/main/java/com/yidianling/user/http/request/ChannelIdParam.kt
+6
-2
HttpConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
+1
-1
No files found.
config.gradle
View file @
131b3c18
...
...
@@ -8,9 +8,9 @@ ext {
"m-confide"
:
"0.0.48.73"
,
"m-consultant"
:
"0.0.59.23"
,
"m-fm"
:
"0.0.30.00"
,
"m-user"
:
"0.0.60.2
0
"
,
"m-user"
:
"0.0.60.2
1
"
,
"m-home"
:
"0.0.22.20"
,
"m-im"
:
"0.0.18.1
3
"
,
"m-im"
:
"0.0.18.1
4
"
,
"m-dynamic"
:
"0.0.7.70"
,
"m-article"
:
"0.0.0.6"
,
...
...
m-user/src/main/java/com/yidianling/user/LoginHelper.java
View file @
131b3c18
package
com
.
yidianling
.
user
;
import
android.annotation.SuppressLint
;
import
android.util.Log
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
;
...
...
@@ -13,6 +14,8 @@ import com.yidianling.user.http.UserHttpImpl;
import
com.yidianling.user.http.request.ChannelIdParam
;
import
de.greenrobot.event.EventBus
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
org.jetbrains.annotations.NotNull
;
/**
...
...
@@ -25,6 +28,7 @@ public class LoginHelper {
public
static
boolean
isRegister
;
@SuppressLint
(
"CheckResult"
)
public
static
void
setChannelId
()
{
String
channelId
=
JPushUtils
.
INSTANCE
.
getRegistrationID
();
...
...
@@ -32,13 +36,15 @@ public class LoginHelper {
UserHttp
userHttp
=
UserHttpImpl
.
Companion
.
getInstance
();
userHttp
.
channelId
(
new
ChannelIdParam
(
channelId
))
.
compose
(
RxUtils
.
resultData
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
map
->
{
if
(
map
.
get
(
"upload_log"
).
equals
(
"1"
))
{
LogHelper
.
Companion
.
getInstance
().
uploadLog
(
false
);
.
subscribe
(
it
->
{
if
(
it
.
data
!=
null
){
if
(
it
.
data
.
get
(
"upload_log"
).
equals
(
"1"
))
{
LogHelper
.
Companion
.
getInstance
().
uploadLog
(
false
);
}
Log
.
d
(
"TAG"
,
"setChannelId: "
);
}
Log
.
d
(
"TAG"
,
"setChannelId: "
);
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
...
...
m-user/src/main/java/com/yidianling/user/http/UserApi.kt
View file @
131b3c18
...
...
@@ -58,9 +58,9 @@ interface UserApi {
fun
register
(
@FieldMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
Any
>>
//设置推送的channelId
@
FormUrlEncoded
@
POST
(
"user/set-channel-id"
)
fun
setChannelId
(
@
FieldMap
params
:
Map
<
String
,
String
>
):
Observable
<
BaseResponse
<
LinkedTreeMap
<
String
,
String
>>>
@
POST
(
"user/device/modify"
)
@
Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
setChannelId
(
@
Body
body
:
RequestBody
):
Observable
<
BaseResponse
<
LinkedTreeMap
<
String
,
String
>>>
//第三方登录
@POST
(
"user/user_q_w"
)
...
...
m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
View file @
131b3c18
...
...
@@ -99,8 +99,9 @@ class UserHttpImpl private constructor() : UserHttp {
}
override
fun
channelId
(
param
:
ChannelIdParam
):
Observable
<
BaseResponse
<
LinkedTreeMap
<
String
,
String
>>>
{
return
RxUtils
.
mapObservable
(
param
)
.
flatMap
{
getUserApi
().
setChannelId
(
it
)
}
var
param
:
String
=
Gson
().
toJson
(
param
)
val
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
param
)
return
getUserApi
().
setChannelId
(
body
)
}
override
fun
thirdPartLogin
(
param
:
ThirdLoginParam
):
Observable
<
BaseAPIResponse
<
UserResponseBean
>>
{
...
...
m-user/src/main/java/com/yidianling/user/http/request/ChannelIdParam.kt
View file @
131b3c18
package
com.yidianling.user.http.request
import
com.ydl.ydlcommon.base.BaseApp
import
com.yidianling.common.tools.RxNetTool
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/02/05
*/
data class
ChannelIdParam
(
val
channelId
:
String
,
val
type
:
String
)
{
data class
ChannelIdParam
(
val
channelId
:
String
,
val
type
:
String
,
val
netType
:
String
)
{
constructor
(
channelId
:
String
):
this
(
channelId
,
"android"
)
constructor
(
channelId
:
String
):
this
(
channelId
,
"android"
,
RxNetTool
.
getNetWorkTypeName
(
BaseApp
.
getApp
())
)
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
View file @
131b3c18
...
...
@@ -318,7 +318,7 @@ class HttpConfig {
.
addHeader
(
VERSION
,
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
.
addHeader
(
OS_BUILD
,
RxDeviceTool
.
getBuildMANUFACTURER
()
+
","
+
RxDeviceTool
.
getBuildBrandModel
()
+
"
,"
+
RxDeviceTool
.
getOsBuileVersion
()
+
",
"
+
RxDeviceTool
.
getAppVersionName
(
RxDeviceTool
.
getBuildMANUFACTURER
()
+
","
+
RxDeviceTool
.
getBuildBrandModel
()
+
"
#"
+
RxDeviceTool
.
getOsBuileVersion
()
+
"#
"
+
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()
)
)
...
...
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