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
294b669f
Commit
294b669f
authored
Nov 25, 2019
by
徐健
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component
into dev
parents
e16c56dc
9b0a306e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
70 deletions
+70
-70
config.gradle
config.gradle
+17
-17
ExpertSearchAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
+1
-1
HttpConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
+52
-52
No files found.
config.gradle
View file @
294b669f
...
...
@@ -43,13 +43,13 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.2
8
"
,
"m-consultant"
:
"0.0.
39
"
,
"m-course"
:
"0.0.2
5
"
,
"m-fm"
:
"0.0.2
0
"
,
"m-muse"
:
"0.0.1
4
"
,
"m-tests"
:
"0.0.1
1
"
,
"m-user"
:
"0.0.3
3
"
,
"m-confide"
:
"0.0.2
9
"
,
"m-consultant"
:
"0.0.
40
"
,
"m-course"
:
"0.0.2
6
"
,
"m-fm"
:
"0.0.2
1
"
,
"m-muse"
:
"0.0.1
5
"
,
"m-tests"
:
"0.0.1
2
"
,
"m-user"
:
"0.0.3
4
"
,
//-------------- 业务模块 API 层 --------------
...
...
@@ -64,13 +64,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.2
6
"
,
"ydl-platform"
:
"0.0.2
7
"
,
//第二步 若干
"ydl-webview"
:
"0.0.2
7
"
,
"ydl-media"
:
"0.0.1
3
"
,
"ydl-pay"
:
"0.0.1
0
"
,
"m-audioim"
:
"0.0.2
8
"
,
"ydl-webview"
:
"0.0.2
8
"
,
"ydl-media"
:
"0.0.1
4
"
,
"ydl-pay"
:
"0.0.1
1
"
,
"m-audioim"
:
"0.0.2
9
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -101,13 +101,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.2
6
"
,
"ydl-platform"
:
"0.0.2
7
"
,
//第二步 若干
"ydl-webview"
:
"0.0.2
7
"
,
"ydl-media"
:
"0.0.1
3
"
,
"ydl-pay"
:
"0.0.1
0
"
,
"m-audioim"
:
"0.0.2
8
"
,
"ydl-webview"
:
"0.0.2
8
"
,
"ydl-media"
:
"0.0.1
4
"
,
"ydl-pay"
:
"0.0.1
1
"
,
"m-audioim"
:
"0.0.2
9
"
,
//以下 几乎不会动
...
...
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
View file @
294b669f
...
...
@@ -208,7 +208,7 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch
//私聊文案
if
(
TextUtils
.
isEmpty
(
itemBean
.
chatBtnText
)){
holder
.
tvChat
.
text
=
"私聊"
holder
.
tvChat
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
))
holder
.
tvChat
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
consultant_confirm_text_color
))
holder
.
tvChat
.
background
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
consultant_expert_search_chat
)
}
else
{
holder
.
tvChat
.
text
=
itemBean
.
chatBtnText
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
View file @
294b669f
...
...
@@ -18,12 +18,7 @@ import okhttp3.OkHttpClient
import
okio.Buffer
import
okio.BufferedSink
import
java.util.*
import
kotlin.collections.ArrayList
/**
...
...
@@ -95,34 +90,25 @@ class HttpConfig {
//如果是POST请求,则再在Body中增加公共参数
if
(
"POST"
==
request
.
method
()){
var
body
=
request
.
body
()
if
(
body
is
FormBody
)
{
val
paramsName
=
mutableSetOf
<
String
>()
val
bodyBuild
=
FormBody
.
Builder
()
for
(
i
in
0
until
body
.
size
())
{
val
name
=
body
.
name
(
i
)
paramsName
.
add
(
name
)
val
value
=
body
.
value
(
i
)
// 去除假参数和值为空的参数
if
(
YDLConstants
.
HOLDER_PARAM
!=
name
&&
!
TextUtils
.
isEmpty
(
value
))
{
bodyBuild
.
addEncoded
(
name
,
value
)
}
}
bodyBuild
.
addEncoded
(
FFROM
,
PlatformDataManager
.
getRam
().
getChannelName
())
.
addEncoded
(
IS_FROM_APP
,
"1"
)
.
addEncoded
(
OS_BUILD
,
"""${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp.getApp()
)}"""
)
.
addEncoded
(
TS
,
(
System
.
currentTimeMillis
()
/
1000
).
toString
())
.
addEncoded
(
VERSION
,
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
()
)
)
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
if
(
loginBean
!=
null
)
{
bodyBuild
.
addEncoded
(
UID
,
loginBean
.
userId
)
bodyBuild
.
addEncoded
(
TOKEN
,
loginBean
.
token
)
val
paramsValue
=
getCommonParams
(
paramsName
)
paramsValue
.
forEach
{
entry
->
bodyBuild
.
addEncoded
(
entry
.
key
,
entry
.
value
)
}
body
=
bodyBuild
.
build
()
...
...
@@ -132,34 +118,11 @@ class HttpConfig {
val
url
=
request
.
url
()
val
newBuilder
=
url
.
newBuilder
()
// for (i in 0 until url.querySize()) {
// //取出url中?后的参数
// val key = url.queryParameterName(i)
// val value = url.queryParameterValue(i)
// newBuilder.
// addQueryParameter(key, value)
// }
newBuilder
.
addQueryParameter
(
FFROM
,
PlatformDataManager
.
getRam
().
getChannelName
())
.
addQueryParameter
(
IS_FROM_APP
,
"1"
)
.
addQueryParameter
(
OS_BUILD
,
"""${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp.getApp()
)}"""
)
.
addQueryParameter
(
TS
,
(
System
.
currentTimeMillis
()
/
1000
).
toString
())
.
addQueryParameter
(
VERSION
,
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
()
)
)
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
if
(
loginBean
!=
null
)
{
newBuilder
.
addQueryParameter
(
UID
,
loginBean
.
userId
)
.
addQueryParameter
(
TOKEN
,
loginBean
.
token
)
val
paramsName
=
url
.
queryParameterNames
()
val
paramsValue
=
getCommonParams
(
paramsName
)
paramsValue
.
forEach
{
entry
->
newBuilder
.
addQueryParameter
(
entry
.
key
,
entry
.
value
)
}
it
.
proceed
(
request
.
newBuilder
().
url
(
newBuilder
.
build
()).
build
())
...
...
@@ -170,6 +133,43 @@ class HttpConfig {
}
}
/**
* 获取公共参数
* 在原有请求中没有该参数的情况下才添加
*/
private
fun
getCommonParams
(
paramsName
:
MutableSet
<
String
>):
HashMap
<
String
,
String
>
{
val
paramsValue
=
hashMapOf
<
String
,
String
>()
if
(!
paramsName
.
contains
(
FFROM
))
{
paramsValue
[
FFROM
]
=
PlatformDataManager
.
getRam
().
getChannelName
()
}
if
(!
paramsName
.
contains
(
IS_FROM_APP
))
{
paramsValue
[
IS_FROM_APP
]
=
"1"
}
if
(!
paramsName
.
contains
(
OS_BUILD
))
{
paramsValue
[
OS_BUILD
]
=
"""${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp.getApp()
)}"""
}
if
(!
paramsName
.
contains
(
TS
))
{
paramsValue
[
TS
]
=
(
System
.
currentTimeMillis
()
/
1000
).
toString
()
}
if
(!
paramsName
.
contains
(
VERSION
))
{
paramsValue
[
VERSION
]
=
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
()
)
}
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
if
(
loginBean
!=
null
&&
!
paramsName
.
contains
(
UID
))
{
paramsValue
[
UID
]
=
loginBean
.
userId
}
if
(
loginBean
!=
null
&&
!
paramsName
.
contains
(
TOKEN
))
{
paramsValue
[
TOKEN
]
=
loginBean
.
token
}
return
paramsValue
}
private
data class
Param
(
val
name
:
String
,
val
value
:
String
)
...
...
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