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
78fca931
Commit
78fca931
authored
Sep 08, 2020
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:对接接口,配合服务端红点消失隐藏的需求
parent
ab9603dd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
1 deletions
+49
-1
ImRetrofitApi.kt
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
+5
-0
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+33
-1
BuryRedPointsParm.kt
m-im/src/main/java/com/yidianling/im/ui/param/BuryRedPointsParm.kt
+11
-0
im_ui_message_custom_business_card.xml
m-im/src/main/res/layout/im_ui_message_custom_business_card.xml
+0
-0
im_arrow_right_4dp.png
m-im/src/main/res_uikit/drawable-xhdpi/im_arrow_right_4dp.png
+0
-0
No files found.
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
View file @
78fca931
...
...
@@ -8,6 +8,7 @@ import com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.im.api.bean.IMExpertBuild
import
com.yidianling.im.bean.*
import
io.reactivex.Observable
import
okhttp3.RequestBody
import
retrofit2.http.*
/**
...
...
@@ -102,4 +103,7 @@ interface ImRetrofitApi {
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getPushConfideStatus
(
@Query
(
"uid"
)
uid
:
String
,
@Query
(
"listenerUid"
)
listenerUid
:
String
):
Observable
<
BaseAPIResponse
<
PushConfideStatusBean
>>
@POST
(
"lingxi/asistant/buryRedPoint"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
imBuryRedPoints
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
78fca931
...
...
@@ -6,6 +6,7 @@ import android.content.Intent;
import
android.text.TextUtils
;
import
android.view.View
;
import
com.google.gson.Gson
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.RequestCallback
;
import
com.netease.nimlib.sdk.StatusCode
;
...
...
@@ -19,12 +20,15 @@ import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.netease.nimlib.sdk.team.constant.TeamTypeEnum
;
import
com.netease.nimlib.sdk.team.model.Team
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.UpLoadLogUtils
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.yidianling.avchatkit.TeamAVChatProfile
;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.http.ImRetrofitApi
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.im.session.action.AVChatAction
;
import
com.yidianling.im.session.action.H5VideoAction
;
...
...
@@ -93,10 +97,12 @@ import com.yidianling.im.session.viewholder.MsgViewHolderSticker;
import
com.yidianling.im.session.viewholder.MsgViewHolderSubscriptTime
;
import
com.yidianling.im.session.viewholder.MsgViewHolderSystemTips
;
import
com.yidianling.im.session.viewholder.MsgViewHolderTip
;
import
com.yidianling.im.ui.param.BuryRedPointsParm
;
import
com.yidianling.nimbase.api.model.session.SessionCustomization
;
import
com.yidianling.nimbase.api.model.session.SessionEventListener
;
import
com.yidianling.nimbase.business.session.actions.BaseAction
;
import
com.yidianling.nimbase.impl.cache.TeamDataCache
;
import
com.yidianling.uikit.business.session.activity.YDLP2PMessageActivity
;
import
com.yidianling.user.api.bean.UserResponseBean
;
import
com.yidianling.uikit.api.NimUIKit
;
import
com.yidianling.uikit.business.session.actions.ImageAction
;
...
...
@@ -107,8 +113,15 @@ import com.yidianling.uikit.business.team.model.TeamRequestCode;
import
com.yidianling.uikit.custom.bridge.ActionHandlerStorage
;
import
com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler
;
import
java.util.ArrayList
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.schedulers.Schedulers
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
/**
* UIKit自定义消息界面用法展示类
*/
...
...
@@ -126,7 +139,6 @@ public class SessionHelper {
private
static
int
last_user_type
=
-
2
;
public
static
void
init
()
{
// 注册自定义消息附件解析器
NIMClient
.
getService
(
MsgService
.
class
).
registerCustomAttachmentParser
(
new
CustomAttachParser
());
...
...
@@ -140,6 +152,8 @@ public class SessionHelper {
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
"开启聊天:"
+
"user_type = "
+
user_type
+
", account = "
+
account
);
//只要打开聊天页面,就请求接口,服务端用来判断消息红点显示隐藏
notifyRedPoint
(
context
,
account
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
());
StatusCode
status
=
NIMClient
.
getStatus
();
if
(
status
==
StatusCode
.
UNLOGIN
)
{
RequestCallback
<
LoginInfo
>
callback
=
new
RequestCallback
<
LoginInfo
>()
{
...
...
@@ -195,6 +209,24 @@ public class SessionHelper {
}
}
/*
* 通知服务端红点
* */
private
static
void
notifyRedPoint
(
Context
context
,
String
assistantUid
,
String
userId
)
{
String
str
=
new
Gson
().
toJson
(
new
BuryRedPointsParm
(
assistantUid
,
userId
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
);
Disposable
subscribe
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
imBuryRedPoints
(
body
)
.
compose
(
RxUtils
.
INSTANCE
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
it
->
{
LogUtil
.
e
(
"redPointsSuccess"
);
},
throwable
->
LogUtil
.
e
(
throwable
.
getMessage
())
);
}
public
static
void
startTeamSession
(
Context
context
,
String
tid
)
{
startTeamSession
(
context
,
tid
,
null
,
null
);
}
...
...
m-im/src/main/java/com/yidianling/im/ui/param/BuryRedPointsParm.kt
0 → 100644
View file @
78fca931
package
com.yidianling.im.ui.param
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/9/8
*/
class
BuryRedPointsParm
(
assistantUid
:
String
,
userId
:
String
)
\ No newline at end of file
m-im/src/main/res/layout/im_ui_message_custom_business_card.xml
View file @
78fca931
This diff is collapsed.
Click to expand it.
m-im/src/main/res_uikit/drawable-xhdpi/im_arrow_right_4dp.png
View replaced file @
ab9603dd
View file @
78fca931
214 Bytes
|
W:
|
H:
360 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
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