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
84ac13b2
Commit
84ac13b2
authored
Jun 26, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-用户进入聊天页面,用户离开聊天页面
parent
b052d78e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
2 deletions
+54
-2
ImRetrofitApi.kt
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
+6
-0
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+4
-0
LingxiWhichQuestionBean.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
+14
-0
YDLP2PMessageActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLP2PMessageActivity.java
+1
-1
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+29
-1
No files found.
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
View file @
84ac13b2
...
...
@@ -124,4 +124,9 @@ interface ImRetrofitApi {
@POST
(
"chat/sendCustomizeMessage"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
lingxiAnswerQuestion
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
//发送通知接口
@POST
(
"chat/sendNoticeMessage"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
lingxiSendNotice
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
84ac13b2
...
...
@@ -25,6 +25,8 @@ import com.yidianling.im.session.viewholder.bean.AnswerBean;
import
com.yidianling.im.session.viewholder.bean.AnswersItem
;
import
com.yidianling.im.session.viewholder.bean.LingxiAnswerBean
;
import
com.yidianling.im.session.viewholder.bean.QuestionItemBean
;
import
com.yidianling.im.session.viewholder.bean.UserIsInPage
;
import
com.yidianling.im.session.viewholder.bean.UserIsInPageData
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
...
...
@@ -212,6 +214,8 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
LogUtil
.
e
(
throwable
.
getMessage
())
);
}
@Override
public
void
onMultipleItemClick
(
@NotNull
QuestionItemBean
string
,
int
position
)
{
//多选发送消息
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
View file @
84ac13b2
...
...
@@ -40,4 +40,17 @@ data class Relates(
var
category
:
String
?,
var
name
:
String
?,
var
score
:
String
?
)
data class
UserIsIn
(
var
data
:
UserIsInPage
,
var
fromUid
:
String
,
var
noticeType
:
String
,
var
toUid
:
String
)
data class
UserIsInPage
(
var
noticeType
:
String
,
var
data
:
UserIsInPageData
)
data class
UserIsInPageData
(
var
content
:
String
)
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLP2PMessageActivity.java
View file @
84ac13b2
...
...
@@ -133,7 +133,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
public
void
onObserverCustomNotification
(
@NotNull
String
fromUid
,
@NotNull
String
toUid
,
@NotNull
String
content
)
{
ServiceBean
serviceBean
=
new
Gson
().
fromJson
(
content
,
ServiceBean
.
class
);
// 切换到客服
if
(
serviceBean
!=
null
&&
serviceBean
.
getData
()
!=
null
&&
serviceBean
.
getBusiness
().
equals
(
"change_doctor"
))
{
if
(
serviceBean
!=
null
&&
serviceBean
.
getData
()
!=
null
&&
serviceBean
.
getBusiness
()!=
null
&&
serviceBean
.
getBusiness
().
equals
(
"change_doctor"
))
{
isChangeDoctor
=
true
;
String
serviceUid
=
String
.
valueOf
(
serviceBean
.
getData
().
getToUid
());
tb
.
setTitle
(
serviceBean
.
getData
().
getName
());
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
84ac13b2
...
...
@@ -28,6 +28,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.alibaba.fastjson.JSON
;
import
com.google.gson.Gson
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.Observer
;
import
com.netease.nimlib.sdk.RequestCallback
;
...
...
@@ -45,6 +46,7 @@ import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.modular.ModularServiceManager
;
import
com.ydl.ydlcommon.utils.AnimUtils
;
import
com.ydl.ydlcommon.utils.LogUtil
;
...
...
@@ -60,7 +62,11 @@ import com.yidianling.common.tools.ToastUtil;
import
com.yidianling.im.R
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.helper.IMChatUtil
;
import
com.yidianling.im.http.ImRetrofitApi
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.im.session.viewholder.bean.UserIsIn
;
import
com.yidianling.im.session.viewholder.bean.UserIsInPage
;
import
com.yidianling.im.session.viewholder.bean.UserIsInPageData
;
import
com.yidianling.nimbase.api.UIKitOptions
;
import
com.yidianling.nimbase.api.model.main.CustomPushContentProvider
;
import
com.yidianling.nimbase.api.model.session.ModuleProxy
;
...
...
@@ -106,7 +112,10 @@ import java.util.Map;
import
de.greenrobot.event.EventBus
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.schedulers.Schedulers
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
/**
...
...
@@ -1067,6 +1076,8 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if
(
aitManager
!=
null
)
{
aitManager
.
reset
();
}
userIsInPage
(
"67"
,
"用户离开当前页面"
,
sessionId
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
());
}
public
void
onEvent
(
MultipleSelectedEvent
event
){
question_multiple
.
setText
(
event
.
getStrSelected
());
...
...
@@ -1118,6 +1129,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if
(
customization
!=
null
)
{
messageListPanel
.
setChattingBackground
(
customization
.
backgroundUri
,
customization
.
backgroundColor
);
}
userIsInPage
(
"66"
,
"用户在当前页面"
,
sessionId
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
());
}
private
void
initAitManager
()
{
...
...
@@ -1381,7 +1393,23 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
ToastUtil
.
toastShort
(
throwable
.
toString
());
});
}
/*
* 用户是否在当前页面
*
* */
private
void
userIsInPage
(
String
noticeType
,
String
content
,
String
fromUid
,
String
toUid
)
{
String
str
=
new
Gson
().
toJson
(
new
UserIsIn
(
new
UserIsInPage
(
noticeType
,
new
UserIsInPageData
(
content
)),
fromUid
,
noticeType
,
toUid
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
);
Disposable
subscribe
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
lingxiSendNotice
(
body
)
.
compose
(
RxUtils
.
INSTANCE
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
it
->
{
LogUtil
.
e
(
it
.
toString
()+
content
);
},
throwable
->
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
throwable
.
getMessage
())
);
}
private
void
initCommonQuestionLayout
()
{
CommonQuestionView
commonQuestionView
=
new
CommonQuestionView
(
getActivity
());
commonQuestionView
.
setData
(
commonQuestionBeanList
);
...
...
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