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
207f3324
Commit
207f3324
authored
Jan 09, 2020
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
私聊改造关注功能修复
parent
302fa15a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
46 additions
and
40 deletions
+46
-40
build.gradle
app/build.gradle
+2
-2
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+2
-2
config.gradle
config.gradle
+8
-8
NimSDKOptionConfig.java
m-im/src/main/java/com/yidianling/im/config/NimSDKOptionConfig.java
+5
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+8
-11
ServiceApi.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
+3
-3
ServiceImpl.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
+2
-3
FocusParams.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/request/FocusParams.kt
+3
-2
FocusBean.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/response/FocusBean.kt
+0
-6
YDLCommonPlugin.kt
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
+13
-1
No files found.
app/build.gradle
View file @
207f3324
...
...
@@ -180,8 +180,8 @@ dependencies {
implementation
fileTree
(
dir:
'aars'
,
include:
[
'*.aar'
])
implementation
project
(
':m-user'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
// implementation
project(':m-tests')
implementation
project
(
':m-consultant'
)
api
project
(
':m-tests'
)
api
project
(
':m-consultant'
)
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
// implementation project(':m-confide')
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
207f3324
...
...
@@ -28,7 +28,7 @@ import com.yidianling.common.tools.ToastUtil
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.fm.api.service.IFMService
//
import com.yidianling.tests.home.NewTestHomeActivity
import
com.yidianling.tests.home.NewTestHomeActivity
import
kotlinx.android.synthetic.main.activity_main.*
/**
...
...
@@ -102,7 +102,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
FragmentContainerActivity
.
start
(
this
,
"TrendsHomeFragment"
)
}
bt_to_tests
.
setOnClickListener
{
//
startActivity(Intent(this, NewTestHomeActivity::class.java))
startActivity
(
Intent
(
this
,
NewTestHomeActivity
::
class
.
java
))
}
// bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016")
...
...
config.gradle
View file @
207f3324
...
...
@@ -47,12 +47,12 @@ ext {
"m-fm"
:
"0.0.24"
,
"m-user"
:
"0.0.42"
,
"m-home"
:
"0.0.8.2"
,
"m-im"
:
"0.0.4.6
4
"
,
"m-im"
:
"0.0.4.6
8
"
,
"m-dynamic"
:
"0.0.2"
,
"m-muse"
:
"0.0.2
1
"
,
"m-tests"
:
"0.0.1
6
"
,
"m-course"
:
"0.0.3
5
"
,
"m-muse"
:
"0.0.2
3.2
"
,
"m-tests"
:
"0.0.1
8.2
"
,
"m-course"
:
"0.0.3
7.2
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.5"
,
...
...
@@ -81,7 +81,7 @@ ext {
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.1"
,
"ydl-utils"
:
"0.0.3"
,
"ydl-flutter-base"
:
"0.0.5.
2
1"
,
"ydl-flutter-base"
:
"0.0.5.
4
1"
,
]
...
...
@@ -98,7 +98,7 @@ ext {
"m-dynamic"
:
"0.0.1.7"
,
"m-muse"
:
"0.0.20.7"
,
"m-tests"
:
"0.0.1
5.7
"
,
"m-tests"
:
"0.0.1
8.1
"
,
"m-course"
:
"0.0.34.10"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.5"
,
...
...
@@ -128,7 +128,7 @@ ext {
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.1"
,
"ydl-utils"
:
"0.0.3"
,
"ydl-flutter-base"
:
"0.0.5.
2
1"
,
"ydl-flutter-base"
:
"0.0.5.
4
1"
,
]
dependencies
=
[
...
...
@@ -266,7 +266,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base"
:
"com.ydl:ydl-flutter-base:${ydlCompileVersion["
ydl
-
flutter
-
base
"]}"
,
//组件化项目中的flutter base模块
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.16.
8
@aar"
,
//flutter aar
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.16.
9
@aar"
,
//flutter aar
"ydl-flutter-sp"
:
"com.ydl:ydl-flutter-sp:0.0.2@aar"
,
//flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
...
...
m-im/src/main/java/com/yidianling/im/config/NimSDKOptionConfig.java
View file @
207f3324
...
...
@@ -13,6 +13,7 @@ import com.netease.nimlib.sdk.msg.model.IMMessage;
import
com.ydl.ydlcommon.base.BaseApp
;
import
com.ydl.ydlcommon.base.config.YDLConstants
;
import
com.ydl.ydlcommon.utils.YDLCacheUtils
;
import
com.yidianling.im.BuildConfig
;
import
com.yidianling.im.R
;
import
com.yidianling.im.config.constants.UserPreferences
;
import
com.yidianling.im.config.provider.CustomUserInfoProvider
;
...
...
@@ -43,8 +44,10 @@ class NimSDKOptionConfig {
String
appEnv
=
BaseApp
.
Companion
.
getInstance
().
getGlobalConfig
().
getAppEnv
();
//debug包根据url判断使用正式或者测试key
if
(!
TextUtils
.
isEmpty
(
YDLCacheUtils
.
Companion
.
getCacheApi
()))
{
if
(
YDLConstants
.
ENV_TEST
.
equals
(
appEnv
))
{
String
cacheAppEnv
=
YDLCacheUtils
.
Companion
.
getCacheApi
();
//这边不能加BuildConfig.DEBUG,因为发布了aar之后,必定为release,导致切换云信的环境失败
if
(!
TextUtils
.
isEmpty
(
cacheAppEnv
))
{
if
(
YDLConstants
.
ENV_TEST
.
equals
(
cacheAppEnv
))
{
options
.
appKey
=
"9a8cefe97b7690537fc1334091af9208"
;
}
else
{
options
.
appKey
=
"4e258ba5cdf489fa188274ebf0fb5669"
;
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
207f3324
...
...
@@ -483,7 +483,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
try
{
good_num_icons
.
setGrade
(
Float
.
parseFloat
(
good_num
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtil
.
i
(
e
.
toString
());
}
...
...
@@ -513,7 +513,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
void
initCommentBanner
()
{
if
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
commentList
.
size
()
==
0
)
{
comment_banner_view_ll
.
setVisibility
(
View
.
GONE
);
return
;
return
;
}
int
commentCounter
=
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
commentCounter
;
...
...
@@ -531,7 +531,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
im_focus_btn
.
setText
(
"已关注"
);
im_focus_btn
.
setTextColor
(
Color
.
parseColor
(
"#999999"
));
im_focus_btn
.
setBackgroundResource
(
R
.
drawable
.
im_unfocus_btn_bg
);
}
else
{
}
else
{
im_focus_btn
.
setText
(
"关注"
);
im_focus_btn
.
setTextColor
(
Color
.
parseColor
(
"#1DA1F2"
));
im_focus_btn
.
setBackgroundResource
(
R
.
drawable
.
im_focus_btn_bg
);
...
...
@@ -548,13 +548,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
// 未关注才能进行关注
if
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
isFollowed
==
false
)
{
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
isFollowed
=
true
;
ServiceImpl
.
Companion
.
getInstance
().
focus
(
new
FocusParams
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
toUid
,
"1"
)
)
ServiceImpl
.
Companion
.
getInstance
().
focus
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorId
,
"1"
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
res
->
{
if
(
res
.
code
==
0
)
{
String
status
=
String
.
valueOf
(
res
.
status
);
if
(
"1"
.
equals
(
status
))
{
if
(
"200"
.
equals
(
res
.
code
))
{
ToastUtil
.
toastShort
(
"关注成功"
);
im_focus_btn
.
setText
(
"已关注"
);
im_focus_btn
.
setTextColor
(
Color
.
parseColor
(
"#999999"
));
...
...
@@ -563,7 +561,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
isFollowed
=
true
;
}
}
}
},
throwable
->
{
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
isFollowed
=
false
;
ToastUtil
.
toastShort
(
throwable
.
toString
());
...
...
@@ -582,7 +579,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
View
rela_zixun
=
rootView
.
findViewById
(
R
.
id
.
rela_zixun
);
rela_zixun
.
setOnClickListener
(
view
->
{
if
(
sessionId
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
()
!=
null
)
{
if
(
sessionId
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
()
!=
null
)
{
if
(
expertConsultServiceListDialog
==
null
)
{
ServiceImpl
.
Companion
.
getInstance
().
serviceList
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorId
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -593,12 +590,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
expertConsultServiceListDialog
=
new
ExpertConsultServiceListDialog
(
getActivity
(),
res
.
data
);
expertConsultServiceListDialog
.
show
();
}
}
else
{
}
else
{
ToastUtil
.
toastShort
(
"咨询师暂未发布服务"
);
}
},
throwable
->
{
});
}
else
{
}
else
{
expertConsultServiceListDialog
.
show
();
}
}
else
{
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
View file @
207f3324
...
...
@@ -51,9 +51,9 @@ interface ServiceApi{
fun
submitUserCollect
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
//关注
@
FormUrlEncoded
@
POST
(
"sq-active/focus"
)
fun
focus
(
@
FieldMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
FocusBean
>>
@
GET
(
"consult/expert-page/toggle-follow"
)
@
Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
focus
(
@
Query
(
"doctorId"
)
doctorId
:
String
,
@Query
(
"status"
)
status
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
//服务列表
@GET
(
"consult/expert-page/products"
)
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
View file @
207f3324
...
...
@@ -72,9 +72,8 @@ class ServiceImpl private constructor(){
/**
* 关注用户
*/
fun
focus
(
param
:
FocusParams
):
Observable
<
BaseResponse
<
FocusBean
>>
{
return
RxUtils
.
mapObservable
(
param
)
.
flatMap
{
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
focus
(
it
)
}
fun
focus
(
doctorId
:
String
,
status
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
focus
(
doctorId
,
status
)
}
/**
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/request/FocusParams.kt
View file @
207f3324
package
com.yidianling.uikit.custom.http.request
class
FocusParams
(
val
i
d
:
String
,
//话题id或用户uid
val
type
:
String
//业务类型:1关注用户,2关注话题
val
doctorI
d
:
String
,
//话题id或用户uid
val
status
:
String
//业务类型:1关注用户,2关注话题
)
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/response/FocusBean.kt
deleted
100644 → 0
View file @
302fa15a
package
com.yidianling.uikit.custom.http.response
class
FocusBean
(
val
status
:
Int
)
\ No newline at end of file
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
View file @
207f3324
...
...
@@ -5,9 +5,11 @@ import android.text.TextUtils
import
com.channel.ydl_flutter_base.BuildConfig
import
com.channel.ydl_flutter_base.base.BaseFlutterFragment
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.yidianling.common.tools.RxDeviceTool
import
io.flutter.app.FlutterActivity
import
io.flutter.embedding.engine.FlutterEngine
...
...
@@ -55,7 +57,17 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
val
mMap
=
mutableMapOf
<
String
,
Any
>()
var
uid
=
loginBean
?.
userId
?:
""
mMap
[
"isDevelopment"
]
=
false
val
appEnv
=
BaseApp
.
instance
.
getGlobalConfig
().
appEnv
val
cacheAppEnv
=
YDLCacheUtils
.
getCacheApi
()
var
isDevelopment
:
Boolean
=
false
if
(!
TextUtils
.
isEmpty
(
cacheAppEnv
))
{
isDevelopment
=
YDLConstants
.
ENV_TEST
==
cacheAppEnv
}
else
{
isDevelopment
=
YDLConstants
.
ENV_TEST
==
appEnv
||
YDLConstants
.
ENV_AUTO_TEST
==
appEnv
}
mMap
[
"isDevelopment"
]
=
isDevelopment
mMap
[
"uid"
]
=
if
(
TextUtils
.
isEmpty
(
uid
))
"0"
else
uid
mMap
[
"accessToken"
]
=
loginBean
?.
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