Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
615f7b7a
Commit
615f7b7a
authored
May 20, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息修改为已接收状态;
离线消息列表;
parent
df551751
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
769 additions
and
498 deletions
+769
-498
bootstrap/src/test/java/io/geekidea/springbootplus/test/ImConversationTest.java
+5
-1
bootstrap/src/test/java/io/geekidea/springbootplus/test/LoginTest.java
+2
-2
bootstrap/src/test/java/io/geekidea/springbootplus/test/SignTest.java
+6
-6
common/src/main/java/com/wecloud/im/controller/AppHelloWorldController.java
+73
-73
common/src/main/java/com/wecloud/im/controller/ImApplicationController.java
+97
-97
common/src/main/java/com/wecloud/im/controller/ImClientController.java
+55
-70
common/src/main/java/com/wecloud/im/controller/ImConversationController.java
+3
-3
common/src/main/java/com/wecloud/im/controller/ImInboxController.java
+62
-60
common/src/main/java/com/wecloud/im/controller/ImMessageController.java
+64
-60
common/src/main/java/com/wecloud/im/mapper/ImConversationMapper.java
+11
-1
common/src/main/java/com/wecloud/im/mapper/ImInboxMapper.java
+3
-0
common/src/main/java/com/wecloud/im/mapper/ImMessageMapper.java
+32
-23
common/src/main/java/com/wecloud/im/param/ImMessageQueryVo.java
+0
-11
common/src/main/java/com/wecloud/im/param/ImMsgReceivedUpdate.java
+28
-0
common/src/main/java/com/wecloud/im/param/ImTokenVerify.java
+1
-1
common/src/main/java/com/wecloud/im/service/ImConversationService.java
+4
-1
common/src/main/java/com/wecloud/im/service/ImInboxService.java
+11
-0
common/src/main/java/com/wecloud/im/service/ImMessageService.java
+59
-35
common/src/main/java/com/wecloud/im/service/impl/ImClientLoginServiceImpl.java
+1
-1
common/src/main/java/com/wecloud/im/service/impl/ImClientServiceImpl.java
+1
-2
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+9
-2
common/src/main/java/com/wecloud/im/service/impl/ImInboxServiceImpl.java
+16
-0
common/src/main/java/com/wecloud/im/service/impl/ImMessageServiceImpl.java
+93
-32
common/src/main/java/com/wecloud/im/vo/ImMessageOfflineListVo.java
+33
-0
common/src/main/java/com/wecloud/im/vo/OfflineMsgDto.java
+49
-0
common/src/main/resources/mapper/ImConversationMapper.xml
+13
-4
common/src/main/resources/mapper/ImInboxMapper.xml
+13
-0
common/src/main/resources/mapper/ImMessageMapper.xml
+25
-13
No files found.
bootstrap/src/test/java/io/geekidea/springbootplus/test/ImConversationTest.java
View file @
615f7b7a
package
io
.
geekidea
.
springbootplus
.
test
;
import
com.wecloud.im.entity.ImConversation
;
import
com.wecloud.im.mapper.ImConversationMapper
;
import
com.wecloud.im.vo.MyConversationListVo
;
import
org.junit.Test
;
...
...
@@ -22,6 +23,9 @@ public class ImConversationTest {
@Test
public
void
listConversation
()
{
List
<
MyConversationListVo
>
myImConversationList
=
imConversationMapper
.
getMyImConversationList
(
1394579719625773056L
);
List
<
MyConversationListVo
>
myImConversationList
=
imConversationMapper
.
getMyImConversationListAndMsgCount
(
1394579719625773056L
);
List
<
ImConversation
>
myImConversationList1
=
imConversationMapper
.
getMyImConversationList
(
1394579719625773056L
);
}
}
bootstrap/src/test/java/io/geekidea/springbootplus/test/LoginTest.java
View file @
615f7b7a
...
...
@@ -96,11 +96,11 @@ public class LoginTest {
@Test
public
void
test
()
throws
Exception
{
// 时间戳
String
timest
e
mp
=
"1620456403794"
;
String
timest
a
mp
=
"1620456403794"
;
String
clientId
=
"hahah_30"
;
String
appKey
=
"elLwpel1gWCHDqZy"
;
String
sign
=
"9db5c1383829d346adba48182fd8f503"
;
String
token
=
getToken
(
timest
e
mp
,
clientId
,
appKey
,
sign
);
String
token
=
getToken
(
timest
a
mp
,
clientId
,
appKey
,
sign
);
System
.
out
.
println
(
"token:"
+
token
);
}
}
bootstrap/src/test/java/io/geekidea/springbootplus/test/SignTest.java
View file @
615f7b7a
...
...
@@ -17,16 +17,16 @@ public class SignTest {
/**
* 获取sign,客户端sdk得到sign之后就可以进行登录,websocket连接初始化需要带上sign,验证通过才能连接成功
* <p>
* sign = MD5{timest
e
mp + clientId + appKey + appSecret}
* sign = MD5{timest
a
mp + clientId + appKey + appSecret}
*
* @param appKey
* @param appSecret
*/
private
static
void
getSign
(
String
timest
e
mp
,
String
clientId
,
String
appKey
,
String
appSecret
)
{
private
static
void
getSign
(
String
timest
a
mp
,
String
clientId
,
String
appKey
,
String
appSecret
)
{
String
sign
=
new
MD5
().
digestHex
(
timest
e
mp
+
clientId
+
appKey
+
appSecret
);
String
sign
=
new
MD5
().
digestHex
(
timest
a
mp
+
clientId
+
appKey
+
appSecret
);
System
.
out
.
println
(
"timest
emp:"
+
timeste
mp
);
System
.
out
.
println
(
"timest
amp:"
+
timesta
mp
);
System
.
out
.
println
(
"sign:"
+
sign
);
}
...
...
@@ -35,8 +35,8 @@ public class SignTest {
String
clientId
=
"client_333"
;
String
appKey
=
"elLwpel1gWCHDqZy"
;
String
appSecret
=
"68809bb5a9077a83631aeb0b17b5965d6b2302faf2ab3737"
;
String
timest
e
mp
=
String
.
valueOf
(
new
Date
().
getTime
());
getSign
(
timest
e
mp
,
clientId
,
appKey
,
appSecret
);
String
timest
a
mp
=
String
.
valueOf
(
new
Date
().
getTime
());
getSign
(
timest
a
mp
,
clientId
,
appKey
,
appSecret
);
}
private
static
void
jsonTest
()
throws
JsonProcessingException
{
...
...
common/src/main/java/com/wecloud/im/controller/AppHelloWorldController.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
controller
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.IOException
;
/**
* Hello World Controller
**/
@Slf4j
@Api
(
value
=
"权限测试"
,
tags
=
{
"APP Hello World2"
})
@RestController
@RequestMapping
(
"/app"
)
public
class
AppHelloWorldController
{
/**
* Hello World
*
* @return
* @throws IOException
*/
@GetMapping
(
value
=
"/world"
)
@OperationLog
(
name
=
"helloWorld"
)
@ApiOperation
(
value
=
"helloWorld"
,
response
=
String
.
class
)
public
ApiResult
<
String
>
helloWorld
()
throws
IOException
{
log
.
debug
(
"Hello World...app"
);
return
ApiResult
.
ok
(
"Hello World app"
);
}
@GetMapping
(
value
=
"/needRole"
)
@OperationLog
(
name
=
"needRole"
)
@ApiOperation
(
value
=
"needRole"
,
response
=
String
.
class
)
public
ApiResult
<
String
>
needRole
()
throws
IOException
{
log
.
debug
(
"Hello World...app"
);
return
ApiResult
.
ok
(
"Hello World app"
);
}
@GetMapping
(
value
=
"/needRoleAdmin"
)
@OperationLog
(
name
=
"needRoleAdmin"
)
@ApiOperation
(
value
=
"needRoleAdmin"
,
response
=
String
.
class
)
@RequiresRoles
(
"app:admin"
)
public
ApiResult
<
String
>
needRoleAdmin
()
throws
IOException
{
log
.
debug
(
"Hello World...app"
);
return
ApiResult
.
ok
(
"Hello World needRoleAdmin"
);
}
@GetMapping
(
value
=
"/needRoleAll"
)
@OperationLog
(
name
=
"needRoleAll"
)
@ApiOperation
(
value
=
"needRoleAll"
,
response
=
String
.
class
)
@RequiresRoles
(
"app:all"
)
public
ApiResult
<
String
>
needRoleAll
()
throws
IOException
{
log
.
debug
(
"Hello World...app"
);
return
ApiResult
.
ok
(
"Hello World needRoleAll"
);
}
@GetMapping
(
value
=
"/noRole"
)
@OperationLog
(
name
=
"noRole"
)
@ApiOperation
(
value
=
"noRole"
,
response
=
String
.
class
)
public
ApiResult
<
String
>
noRole
()
throws
IOException
{
log
.
info
(
"Hello World...app"
);
return
ApiResult
.
ok
(
"Hello World app noRole"
);
}
}
//
package com.wecloud.im.controller;
//
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
//
import io.swagger.annotations.Api;
//
import io.swagger.annotations.ApiOperation;
//
import lombok.extern.slf4j.Slf4j;
//
import org.apache.shiro.authz.annotation.RequiresRoles;
//
import org.springframework.web.bind.annotation.GetMapping;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
import org.springframework.web.bind.annotation.RestController;
//
//
import java.io.IOException;
//
/
//
**
//
* Hello World Controller
//
**/
//
@Slf4j
//
@Api(value = "权限测试", tags = {"APP Hello World2"})
//
@RestController
//
@RequestMapping("/app")
//
public class AppHelloWorldController {
//
//
/**
//
* Hello World
//
*
//
* @return
//
* @throws IOException
//
*/
//
@GetMapping(value = "/world")
//
@OperationLog(name = "helloWorld")
//
@ApiOperation(value = "helloWorld", response = String.class)
//
public ApiResult<String> helloWorld() throws IOException {
//
log.debug("Hello World...app");
//
return ApiResult.ok("Hello World app");
//
}
//
//
//
@GetMapping(value = "/needRole")
//
@OperationLog(name = "needRole")
//
@ApiOperation(value = "needRole", response = String.class)
//
public ApiResult<String> needRole() throws IOException {
//
log.debug("Hello World...app");
//
return ApiResult.ok("Hello World app");
//
}
//
//
@GetMapping(value = "/needRoleAdmin")
//
@OperationLog(name = "needRoleAdmin")
//
@ApiOperation(value = "needRoleAdmin", response = String.class)
//
@RequiresRoles("app:admin")
//
public ApiResult<String> needRoleAdmin() throws IOException {
//
log.debug("Hello World...app");
//
return ApiResult.ok("Hello World needRoleAdmin");
//
}
//
//
@GetMapping(value = "/needRoleAll")
//
@OperationLog(name = "needRoleAll")
//
@ApiOperation(value = "needRoleAll", response = String.class)
//
@RequiresRoles("app:all")
//
public ApiResult<String> needRoleAll() throws IOException {
//
log.debug("Hello World...app");
//
return ApiResult.ok("Hello World needRoleAll");
//
}
//
//
@GetMapping(value = "/noRole")
//
@OperationLog(name = "noRole")
//
@ApiOperation(value = "noRole", response = String.class)
//
public ApiResult<String> noRole() throws IOException {
//
log.info("Hello World...app");
//
return ApiResult.ok("Hello World app noRole");
//
}
//
//
}
common/src/main/java/com/wecloud/im/controller/ImApplicationController.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
controller
;
import
com.wecloud.im.entity.ImApplication
;
import
com.wecloud.im.param.ImApplicationPageParam
;
import
com.wecloud.im.param.ImApplicationQueryVo
;
import
com.wecloud.im.service.ImApplicationService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 第三方应用表 控制器
*
* @author wei
* @since 2021-04-27
*/
@Slf4j
@RestController
@RequestMapping
(
"/imApplication"
)
@Api
(
value
=
"第三方应用表API"
,
tags
=
{
"第三方应用表"
})
public
class
ImApplicationController
extends
BaseController
{
@Autowired
private
ImApplicationService
imApplicationService
;
/**
* 添加第三方应用表
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加第三方应用表"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加第三方应用表"
)
public
ApiResult
<
Boolean
>
addImApplication
(
@Validated
(
Add
.
class
)
@RequestBody
ImApplication
imApplication
)
throws
Exception
{
boolean
flag
=
imApplicationService
.
saveImApplication
(
imApplication
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改第三方应用表
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改第三方应用表"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改第三方应用表"
)
public
ApiResult
<
Boolean
>
updateImApplication
(
@Validated
(
Update
.
class
)
@RequestBody
ImApplication
imApplication
)
throws
Exception
{
boolean
flag
=
imApplicationService
.
updateImApplication
(
imApplication
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除第三方应用表
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除第三方应用表"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除第三方应用表"
)
public
ApiResult
<
Boolean
>
deleteImApplication
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
imApplicationService
.
deleteImApplication
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取第三方应用表详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"第三方应用表详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"第三方应用表详情"
)
public
ApiResult
<
ImApplicationQueryVo
>
getImApplication
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
ImApplicationQueryVo
imApplicationQueryVo
=
imApplicationService
.
getImApplicationById
(
id
);
return
ApiResult
.
ok
(
imApplicationQueryVo
);
}
/**
* 第三方应用表分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"第三方应用表分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"第三方应用表分页列表"
)
public
ApiResult
<
Paging
<
ImApplicationQueryVo
>>
getImApplicationPageList
(
@Validated
@RequestBody
ImApplicationPageParam
imApplicationPageParam
)
throws
Exception
{
Paging
<
ImApplicationQueryVo
>
paging
=
imApplicationService
.
getImApplicationPageList
(
imApplicationPageParam
);
return
ApiResult
.
ok
(
paging
);
}
}
//
package com.wecloud.im.controller;
//
//
import com.wecloud.im.entity.ImApplication;
//
import com.wecloud.im.param.ImApplicationPageParam;
//
import com.wecloud.im.param.ImApplicationQueryVo;
//
import com.wecloud.im.service.ImApplicationService;
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
//
import io.geekidea.springbootplus.framework.common.controller.BaseController;
//
import io.geekidea.springbootplus.framework.core.pagination.Paging;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
//
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
//
import io.swagger.annotations.Api;
//
import io.swagger.annotations.ApiOperation;
//
import lombok.extern.slf4j.Slf4j;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.validation.annotation.Validated;
//
import org.springframework.web.bind.annotation.GetMapping;
//
import org.springframework.web.bind.annotation.PathVariable;
//
import org.springframework.web.bind.annotation.PostMapping;
//
import org.springframework.web.bind.annotation.RequestBody;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
import org.springframework.web.bind.annotation.RestController;
//
/
//
**
//
* 第三方应用表 控制器
//
*
//
* @author wei
//
* @since 2021-04-27
//
*/
//
@Slf4j
//
@RestController
//
@RequestMapping("/imApplication")
//
@Api(value = "第三方应用表API", tags = {"第三方应用表"})
//
public class ImApplicationController extends BaseController {
//
//
@Autowired
//
private ImApplicationService imApplicationService;
//
//
/**
//
* 添加第三方应用表
//
*/
//
@PostMapping("/add")
//
@OperationLog(name = "添加第三方应用表", type = OperationLogType.ADD)
//
@ApiOperation(value = "添加第三方应用表")
//
public ApiResult<Boolean> addImApplication(@Validated(Add.class) @RequestBody ImApplication imApplication) throws Exception {
//
boolean flag = imApplicationService.saveImApplication(imApplication);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 修改第三方应用表
//
*/
//
@PostMapping("/update")
//
@OperationLog(name = "修改第三方应用表", type = OperationLogType.UPDATE)
//
@ApiOperation(value = "修改第三方应用表")
//
public ApiResult<Boolean> updateImApplication(@Validated(Update.class) @RequestBody ImApplication imApplication) throws Exception {
//
boolean flag = imApplicationService.updateImApplication(imApplication);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 删除第三方应用表
//
*/
//
@PostMapping("/delete/{id}")
//
@OperationLog(name = "删除第三方应用表", type = OperationLogType.DELETE)
//
@ApiOperation(value = "删除第三方应用表")
//
public ApiResult<Boolean> deleteImApplication(@PathVariable("id") Long id) throws Exception {
//
boolean flag = imApplicationService.deleteImApplication(id);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 获取第三方应用表详情
//
*/
//
@GetMapping("/info/{id}")
//
@OperationLog(name = "第三方应用表详情", type = OperationLogType.INFO)
//
@ApiOperation(value = "第三方应用表详情")
//
public ApiResult<ImApplicationQueryVo> getImApplication(@PathVariable("id") Long id) throws Exception {
//
ImApplicationQueryVo imApplicationQueryVo = imApplicationService.getImApplicationById(id);
//
return ApiResult.ok(imApplicationQueryVo);
//
}
//
//
/**
//
* 第三方应用表分页列表
//
*/
//
@PostMapping("/getPageList")
//
@OperationLog(name = "第三方应用表分页列表", type = OperationLogType.PAGE)
//
@ApiOperation(value = "第三方应用表分页列表")
//
public ApiResult<Paging<ImApplicationQueryVo>> getImApplicationPageList(@Validated @RequestBody ImApplicationPageParam imApplicationPageParam) throws Exception {
//
Paging<ImApplicationQueryVo> paging = imApplicationService.getImApplicationPageList(imApplicationPageParam);
//
return ApiResult.ok(paging);
//
}
//
//
}
//
common/src/main/java/com/wecloud/im/controller/ImClientController.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
controller
;
import
com.wecloud.im.entity.ImClient
;
import
com.wecloud.im.param.ImClientPageParam
;
import
com.wecloud.im.param.ImClientQueryVo
;
import
com.wecloud.im.service.ImClientService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -37,61 +22,61 @@ public class ImClientController extends BaseController {
@Autowired
private
ImClientService
imClientService
;
/**
* 添加终端表
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加终端表"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加终端表"
)
public
ApiResult
<
Boolean
>
addImClient
(
@Validated
(
Add
.
class
)
@RequestBody
ImClient
imClient
)
throws
Exception
{
boolean
flag
=
imClientService
.
saveImClient
(
imClient
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改终端表
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改终端表"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改终端表"
)
public
ApiResult
<
Boolean
>
updateImClient
(
@Validated
(
Update
.
class
)
@RequestBody
ImClient
imClient
)
throws
Exception
{
boolean
flag
=
imClientService
.
updateImClient
(
imClient
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除终端表
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除终端表"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除终端表"
)
public
ApiResult
<
Boolean
>
deleteImClient
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
imClientService
.
deleteImClient
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取终端表详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"终端表详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"终端表详情"
)
public
ApiResult
<
ImClientQueryVo
>
getImClient
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
ImClientQueryVo
imClientQueryVo
=
imClientService
.
getImClientById
(
id
);
return
ApiResult
.
ok
(
imClientQueryVo
);
}
/**
* 终端表分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"终端表分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"终端表分页列表"
)
public
ApiResult
<
Paging
<
ImClientQueryVo
>>
getImClientPageList
(
@Validated
@RequestBody
ImClientPageParam
imClientPageParam
)
throws
Exception
{
Paging
<
ImClientQueryVo
>
paging
=
imClientService
.
getImClientPageList
(
imClientPageParam
);
return
ApiResult
.
ok
(
paging
);
}
//
//
/**
//
* 添加终端表
//
*/
//
@PostMapping("/add")
//
@OperationLog(name = "添加终端表", type = OperationLogType.ADD)
//
@ApiOperation(value = "添加终端表")
//
public ApiResult<Boolean> addImClient(@Validated(Add.class) @RequestBody ImClient imClient) throws Exception {
//
boolean flag = imClientService.saveImClient(imClient);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 修改终端表
//
*/
//
@PostMapping("/update")
//
@OperationLog(name = "修改终端表", type = OperationLogType.UPDATE)
//
@ApiOperation(value = "修改终端表")
//
public ApiResult<Boolean> updateImClient(@Validated(Update.class) @RequestBody ImClient imClient) throws Exception {
//
boolean flag = imClientService.updateImClient(imClient);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 删除终端表
//
*/
//
@PostMapping("/delete/{id}")
//
@OperationLog(name = "删除终端表", type = OperationLogType.DELETE)
//
@ApiOperation(value = "删除终端表")
//
public ApiResult<Boolean> deleteImClient(@PathVariable("id") Long id) throws Exception {
//
boolean flag = imClientService.deleteImClient(id);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 获取终端表详情
//
*/
//
@GetMapping("/info/{id}")
//
@OperationLog(name = "终端表详情", type = OperationLogType.INFO)
//
@ApiOperation(value = "终端表详情")
//
public ApiResult<ImClientQueryVo> getImClient(@PathVariable("id") Long id) throws Exception {
//
ImClientQueryVo imClientQueryVo = imClientService.getImClientById(id);
//
return ApiResult.ok(imClientQueryVo);
//
}
//
//
/**
//
* 终端表分页列表
//
*/
//
@PostMapping("/getPageList")
//
@OperationLog(name = "终端表分页列表", type = OperationLogType.PAGE)
//
@ApiOperation(value = "终端表分页列表")
//
public ApiResult<Paging<ImClientQueryVo>> getImClientPageList(@Validated @RequestBody ImClientPageParam imClientPageParam) throws Exception {
//
Paging<ImClientQueryVo> paging = imClientService.getImClientPageList(imClientPageParam);
//
return ApiResult.ok(paging);
//
}
}
common/src/main/java/com/wecloud/im/controller/ImConversationController.java
View file @
615f7b7a
...
...
@@ -49,9 +49,9 @@ public class ImConversationController extends BaseController {
* 查询用户加入的所有会话 与每个会话的未读条数 成员
*/
@PostMapping
(
"/getList"
)
@ApiOperation
(
value
=
"查询
用户加入的所有会话
与每个会话的未读条数 成员"
)
public
ApiResult
<
List
<
MyConversationListVo
>>
get
ImConversationPageLis
t
()
throws
Exception
{
List
<
MyConversationListVo
>
conversationList
=
imConversationService
.
getMyImConversationList
();
@ApiOperation
(
value
=
"查询
加入的会话列表"
,
notes
=
"查询用户加入的会话列表
与每个会话的未读条数 成员"
)
public
ApiResult
<
List
<
MyConversationListVo
>>
get
MyImConversationListAndMsgCoun
t
()
throws
Exception
{
List
<
MyConversationListVo
>
conversationList
=
imConversationService
.
getMyImConversationList
AndMsgCount
();
return
ApiResult
.
ok
(
conversationList
);
}
...
...
common/src/main/java/com/wecloud/im/controller/ImInboxController.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
controller
;
import
com.wecloud.im.entity.ImInbox
;
import
com.wecloud.im.param.ImInboxPageParam
;
import
com.wecloud.im.param.ImInboxQueryVo
;
import
com.wecloud.im.param.ImMsgReceivedUpdate
;
import
com.wecloud.im.service.ImInboxService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -38,60 +28,72 @@ public class ImInboxController extends BaseController {
@Autowired
private
ImInboxService
imInboxService
;
/**
* 添加消息收件箱表
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加消息收件箱表"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加消息收件箱表"
)
public
ApiResult
<
Boolean
>
addImInbox
(
@Validated
(
Add
.
class
)
@RequestBody
ImInbox
imInbox
)
throws
Exception
{
boolean
flag
=
imInboxService
.
saveImInbox
(
imInbox
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改消息收件箱表
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改消息收件箱表"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改消息收件箱表"
)
public
ApiResult
<
Boolean
>
updateImInbox
(
@Validated
(
Update
.
class
)
@RequestBody
ImInbox
imInbox
)
throws
Exception
{
boolean
flag
=
imInboxService
.
updateImInbox
(
imInbox
);
return
ApiResult
.
result
(
flag
);
}
/**
*
删除消息收件箱表
*
消息修改为已接收状态
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除消息收件箱表"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除消息收件箱表"
)
public
ApiResult
<
Boolean
>
deleteImInbox
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
imInboxService
.
deleteImInbox
(
id
);
return
ApiResult
.
result
(
flag
);
@PostMapping
(
"/msgReceivedUpdate"
)
@ApiOperation
(
value
=
"消息修改为已接收状态"
)
public
ApiResult
<
Boolean
>
updateImMsgReceived
(
@RequestBody
ImMsgReceivedUpdate
imMsgReceivedUpdate
)
throws
Exception
{
imInboxService
.
updateImMsgReceived
(
imMsgReceivedUpdate
);
return
ApiResult
.
ok
();
}
/**
* 获取消息收件箱表详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"消息收件箱表详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"消息收件箱表详情"
)
public
ApiResult
<
ImInboxQueryVo
>
getImInbox
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
ImInboxQueryVo
imInboxQueryVo
=
imInboxService
.
getImInboxById
(
id
);
return
ApiResult
.
ok
(
imInboxQueryVo
);
}
/**
* 消息收件箱表分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"消息收件箱表分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"消息收件箱表分页列表"
)
public
ApiResult
<
Paging
<
ImInboxQueryVo
>>
getImInboxPageList
(
@Validated
@RequestBody
ImInboxPageParam
imInboxPageParam
)
throws
Exception
{
Paging
<
ImInboxQueryVo
>
paging
=
imInboxService
.
getImInboxPageList
(
imInboxPageParam
);
return
ApiResult
.
ok
(
paging
);
}
//
// /**
// * 添加消息收件箱表
// */
// @PostMapping("/add")
// @OperationLog(name = "添加消息收件箱表", type = OperationLogType.ADD)
// @ApiOperation(value = "添加消息收件箱表")
// public ApiResult<Boolean> addImInbox(@Validated(Add.class) @RequestBody ImInbox imInbox) throws Exception {
// boolean flag = imInboxService.saveImInbox(imInbox);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改消息收件箱表
// */
// @PostMapping("/update")
// @OperationLog(name = "修改消息收件箱表", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改消息收件箱表")
// public ApiResult<Boolean> updateImInbox(@Validated(Update.class) @RequestBody ImInbox imInbox) throws Exception {
// boolean flag = imInboxService.updateImInbox(imInbox);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除消息收件箱表
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除消息收件箱表", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除消息收件箱表")
// public ApiResult<Boolean> deleteImInbox(@PathVariable("id") Long id) throws Exception {
// boolean flag = imInboxService.deleteImInbox(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取消息收件箱表详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "消息收件箱表详情", type = OperationLogType.INFO)
// @ApiOperation(value = "消息收件箱表详情")
// public ApiResult<ImInboxQueryVo> getImInbox(@PathVariable("id") Long id) throws Exception {
// ImInboxQueryVo imInboxQueryVo = imInboxService.getImInboxById(id);
// return ApiResult.ok(imInboxQueryVo);
// }
//
// /**
// * 消息收件箱表分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "消息收件箱表分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "消息收件箱表分页列表")
// public ApiResult<Paging<ImInboxQueryVo>> getImInboxPageList(@Validated @RequestBody ImInboxPageParam imInboxPageParam) throws Exception {
// Paging<ImInboxQueryVo> paging = imInboxService.getImInboxPageList(imInboxPageParam);
// return ApiResult.ok(paging);
// }
}
common/src/main/java/com/wecloud/im/controller/ImMessageController.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
controller
;
import
com.wecloud.im.entity.ImMessage
;
import
com.wecloud.im.param.ImMessagePageParam
;
import
com.wecloud.im.param.ImMessageQueryVo
;
import
com.wecloud.im.service.ImMessageService
;
import
com.wecloud.im.vo.ImMessageOfflineListVo
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* 消息存储表 控制器
*
...
...
@@ -38,60 +29,73 @@ public class ImMessageController extends BaseController {
@Autowired
private
ImMessageService
imMessageService
;
/**
* 添加消息存储表
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加消息存储表"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加消息存储表"
)
public
ApiResult
<
Boolean
>
addImMessage
(
@Validated
(
Add
.
class
)
@RequestBody
ImMessage
imMessage
)
throws
Exception
{
boolean
flag
=
imMessageService
.
saveImMessage
(
imMessage
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改消息存储表
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改消息存储表"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改消息存储表"
)
public
ApiResult
<
Boolean
>
updateImMessage
(
@Validated
(
Update
.
class
)
@RequestBody
ImMessage
imMessage
)
throws
Exception
{
boolean
flag
=
imMessageService
.
updateImMessage
(
imMessage
);
return
ApiResult
.
result
(
flag
);
}
/**
*
删除消息存储
表
*
离线消息列
表
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除消息存储表"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除消息存储表"
)
public
ApiResult
<
Boolean
>
deleteImMessage
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
imMessageService
.
deleteImMessage
(
id
);
return
ApiResult
.
result
(
flag
);
@PostMapping
(
"/offlineList"
)
@ApiOperation
(
value
=
"离线消息列表"
)
public
ApiResult
<
List
<
ImMessageOfflineListVo
>>
getOfflineList
()
throws
Exception
{
List
<
ImMessageOfflineListVo
>
offlineList
=
imMessageService
.
getOfflineList
();
return
ApiResult
.
ok
(
offlineList
);
}
/**
* 获取消息存储表详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"消息存储表详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"消息存储表详情"
)
public
ApiResult
<
ImMessageQueryVo
>
getImMessage
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
ImMessageQueryVo
imMessageQueryVo
=
imMessageService
.
getImMessageById
(
id
);
return
ApiResult
.
ok
(
imMessageQueryVo
);
}
/**
* 消息存储表分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"消息存储表分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"消息存储表分页列表"
)
public
ApiResult
<
Paging
<
ImMessageQueryVo
>>
getImMessagePageList
(
@Validated
@RequestBody
ImMessagePageParam
imMessagePageParam
)
throws
Exception
{
Paging
<
ImMessageQueryVo
>
paging
=
imMessageService
.
getImMessagePageList
(
imMessagePageParam
);
return
ApiResult
.
ok
(
paging
);
}
//
// /**
// * 添加消息存储表
// */
// @PostMapping("/add")
// @OperationLog(name = "添加消息存储表", type = OperationLogType.ADD)
// @ApiOperation(value = "添加消息存储表")
// public ApiResult<Boolean> addImMessage(@Validated(Add.class) @RequestBody ImMessage imMessage) throws Exception {
// boolean flag = imMessageService.saveImMessage(imMessage);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改消息存储表
// */
// @PostMapping("/update")
// @OperationLog(name = "修改消息存储表", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改消息存储表")
// public ApiResult<Boolean> updateImMessage(@Validated(Update.class) @RequestBody ImMessage imMessage) throws Exception {
// boolean flag = imMessageService.updateImMessage(imMessage);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除消息存储表
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除消息存储表", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除消息存储表")
// public ApiResult<Boolean> deleteImMessage(@PathVariable("id") Long id) throws Exception {
// boolean flag = imMessageService.deleteImMessage(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取消息存储表详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "消息存储表详情", type = OperationLogType.INFO)
// @ApiOperation(value = "消息存储表详情")
// public ApiResult<ImMessageQueryVo> getImMessage(@PathVariable("id") Long id) throws Exception {
// ImMessageQueryVo imMessageQueryVo = imMessageService.getImMessageById(id);
// return ApiResult.ok(imMessageQueryVo);
// }
//
// /**
// * 消息存储表分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "消息存储表分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "消息存储表分页列表")
// public ApiResult<Paging<ImMessageQueryVo>> getImMessagePageList(@Validated @RequestBody ImMessagePageParam imMessagePageParam) throws Exception {
// Paging<ImMessageQueryVo> paging = imMessageService.getImMessagePageList(imMessagePageParam);
// return ApiResult.ok(paging);
// }
}
common/src/main/java/com/wecloud/im/mapper/ImConversationMapper.java
View file @
615f7b7a
...
...
@@ -46,5 +46,15 @@ public interface ImConversationMapper extends BaseMapper<ImConversation> {
* @param clientId
* @return
*/
List
<
MyConversationListVo
>
getMyImConversationList
(
@Param
(
"clientId"
)
Long
clientId
);
List
<
MyConversationListVo
>
getMyImConversationListAndMsgCount
(
@Param
(
"clientId"
)
Long
clientId
);
/**
* 查询用户加入的所有会话
*
* @param clientId
* @return
*/
List
<
ImConversation
>
getMyImConversationList
(
@Param
(
"clientId"
)
Long
clientId
);
}
common/src/main/java/com/wecloud/im/mapper/ImInboxMapper.java
View file @
615f7b7a
...
...
@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
import
org.springframework.stereotype.Repository
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 消息收件箱表 Mapper 接口
...
...
@@ -37,4 +38,6 @@ public interface ImInboxMapper extends BaseMapper<ImInbox> {
*/
IPage
<
ImInboxQueryVo
>
getImInboxPageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
ImInboxPageParam
imInboxPageParam
);
Long
updateImMsgReceivedByIds
(
@Param
(
"clientId"
)
Long
clientId
,
@Param
(
"msgIds"
)
List
<
Long
>
msgIds
);
}
common/src/main/java/com/wecloud/im/mapper/ImMessageMapper.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.wecloud.im.entity.ImMessage
;
import
com.wecloud.im.param.ImMessagePageParam
;
import
com.wecloud.im.param.ImMessageQueryVo
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.wecloud.im.vo.OfflineMsgDto
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 消息存储表 Mapper 接口
...
...
@@ -22,21 +22,30 @@ import java.io.Serializable;
@Repository
public
interface
ImMessageMapper
extends
BaseMapper
<
ImMessage
>
{
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
ImMessageQueryVo
getImMessageById
(
Serializable
id
);
/**
* 获取分页对象
*
* @param page
* @param imMessagePageParam
* @return
*/
IPage
<
ImMessageQueryVo
>
getImMessagePageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
ImMessagePageParam
imMessagePageParam
);
}
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
ImMessageQueryVo
getImMessageById
(
Serializable
id
);
/**
* 获取分页对象
*
* @param page
* @param imMessagePageParam
* @return
*/
IPage
<
ImMessageQueryVo
>
getImMessagePageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
ImMessagePageParam
imMessagePageParam
);
/**
* 根据客户端id与会话id 查询离线消息
*
* @param clientId
* @param conversationId
* @return
*/
List
<
OfflineMsgDto
>
getOfflineListByClientAndConversation
(
@Param
(
"clientId"
)
Long
clientId
,
@Param
(
"conversationId"
)
Long
conversationId
);
}
common/src/main/java/com/wecloud/im/param/ImMessageQueryVo.java
View file @
615f7b7a
...
...
@@ -58,16 +58,6 @@ public class ImMessageQueryVo implements Serializable {
@ApiModelProperty
(
"发送状态, 0AVIMMessageStatusNone(未知) 1AVIMMessageStatusSending(发送中) 2AVIMMessageStatusSent(发送成功) 3AVIMMessageStatusReceipt(被接收) 4AVIMMessageStatusFailed(失败)"
)
private
Integer
sendStatus
;
@ApiModelProperty
(
"类型"
+
"类型 文本消息-1"
+
"图像消息-2"
+
"音频消息-3"
+
"视频消息-4"
+
"位置消息-5"
+
"文件消息-6"
+
"以上类型均使用负数,所有正数留给自定义扩展类型使用,0 作为「没有类型」被保留起来。"
)
private
Integer
type
;
@ApiModelProperty
(
"会话id"
)
private
Long
fkConversationId
;
}
\ No newline at end of file
common/src/main/java/com/wecloud/im/param/ImMsgReceivedUpdate.java
0 → 100644
View file @
615f7b7a
package
com
.
wecloud
.
im
.
param
;
import
io.geekidea.springbootplus.framework.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
/**
* ImMsgReadUpdate
*
* @author wei
* @since 2021-05-07
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"ImMsgReceivedUpdate"
)
public
class
ImMsgReceivedUpdate
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"可选 邀请加入会话的客户端,如创建单聊,则填入对方的clientId"
)
private
List
<
Long
>
msgIds
;
}
common/src/main/java/com/wecloud/im/param/ImTokenVerify.java
View file @
615f7b7a
...
...
@@ -16,7 +16,7 @@ public class ImTokenVerify {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"时间戳"
)
private
String
timest
e
mp
;
private
String
timest
a
mp
;
@ApiModelProperty
(
"client客户端id"
)
private
String
clientId
;
...
...
common/src/main/java/com/wecloud/im/service/ImConversationService.java
View file @
615f7b7a
...
...
@@ -74,6 +74,9 @@ public interface ImConversationService extends BaseService<ImConversation> {
* @return
* @throws Exception
*/
List
<
MyConversationListVo
>
getMyImConversationList
()
throws
Exception
;
List
<
MyConversationListVo
>
getMyImConversationListAndMsgCount
()
throws
Exception
;
List
<
ImConversation
>
getMyImConversationList
()
throws
Exception
;
}
common/src/main/java/com/wecloud/im/service/ImInboxService.java
View file @
615f7b7a
...
...
@@ -3,6 +3,8 @@ package com.wecloud.im.service;
import
com.wecloud.im.entity.ImInbox
;
import
com.wecloud.im.param.ImInboxPageParam
;
import
com.wecloud.im.param.ImInboxQueryVo
;
import
com.wecloud.im.param.ImMsgReceivedUpdate
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
...
...
@@ -59,4 +61,13 @@ public interface ImInboxService extends BaseService<ImInbox> {
*/
Paging
<
ImInboxQueryVo
>
getImInboxPageList
(
ImInboxPageParam
imInboxPageParam
)
throws
Exception
;
/**
* 消息修改为已接收状态
*
* @param imMsgReceivedUpdate
* @return
*/
ApiResult
<
Boolean
>
updateImMsgReceived
(
ImMsgReceivedUpdate
imMsgReceivedUpdate
);
}
common/src/main/java/com/wecloud/im/service/ImMessageService.java
View file @
615f7b7a
...
...
@@ -2,10 +2,14 @@ package com.wecloud.im.service;
import
com.wecloud.im.entity.ImMessage
;
import
com.wecloud.im.param.ImMessagePageParam
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
com.wecloud.im.param.ImMessageQueryVo
;
import
com.wecloud.im.vo.ImMessageOfflineListVo
;
import
com.wecloud.im.vo.OfflineMsgDto
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
java.util.List
;
/**
* 消息存储表 服务类
*
...
...
@@ -14,14 +18,14 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging;
*/
public
interface
ImMessageService
extends
BaseService
<
ImMessage
>
{
/**
* 保存
*
* @param imMessage
* @return
* @throws Exception
*/
boolean
saveImMessage
(
ImMessage
imMessage
)
throws
Exception
;
/**
* 保存
*
* @param imMessage
* @return
* @throws Exception
*/
boolean
saveImMessage
(
ImMessage
imMessage
)
throws
Exception
;
/**
* 修改
...
...
@@ -30,33 +34,53 @@ public interface ImMessageService extends BaseService<ImMessage> {
* @return
* @throws Exception
*/
boolean
updateImMessage
(
ImMessage
imMessage
)
throws
Exception
;
boolean
updateImMessage
(
ImMessage
imMessage
)
throws
Exception
;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean
deleteImMessage
(
Long
id
)
throws
Exception
;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean
deleteImMessage
(
Long
id
)
throws
Exception
;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
ImMessageQueryVo
getImMessageById
(
Long
id
)
throws
Exception
;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
ImMessageQueryVo
getImMessageById
(
Long
id
)
throws
Exception
;
/**
* 获取分页对象
*
* @param imMessagePageParam
* @return
* @throws Exception
*/
Paging
<
ImMessageQueryVo
>
getImMessagePageList
(
ImMessagePageParam
imMessagePageParam
)
throws
Exception
;
/**
* 查询用户所有离线消息
*
* @return
* @throws Exception
*/
List
<
ImMessageOfflineListVo
>
getOfflineList
()
throws
Exception
;
/**
* 根据客户端id与会话id 查询离线消息
*
* @param clientId
* @param conversationId
* @return
*/
List
<
OfflineMsgDto
>
getOfflineListByClientAndConversation
(
Long
clientId
,
Long
conversationId
);
/**
* 获取分页对象
*
* @param imMessagePageParam
* @return
* @throws Exception
*/
Paging
<
ImMessageQueryVo
>
getImMessagePageList
(
ImMessagePageParam
imMessagePageParam
)
throws
Exception
;
}
}
common/src/main/java/com/wecloud/im/service/impl/ImClientLoginServiceImpl.java
View file @
615f7b7a
...
...
@@ -68,7 +68,7 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
// 生成以数据库为准的签名
String
secret
=
imApplication
.
getAppSecret
();
String
mySign
=
new
MD5
().
digestHex
(
imTokenVerify
.
getTimest
e
mp
()
+
imTokenVerify
.
getClientId
()
+
imApplication
.
getAppKey
()
+
secret
);
String
mySign
=
new
MD5
().
digestHex
(
imTokenVerify
.
getTimest
a
mp
()
+
imTokenVerify
.
getClientId
()
+
imApplication
.
getAppKey
()
+
secret
);
// 验证签名
if
(
mySign
.
equals
(
imTokenVerify
.
getSign
()))
{
...
...
common/src/main/java/com/wecloud/im/service/impl/ImClientServiceImpl.java
View file @
615f7b7a
...
...
@@ -76,10 +76,9 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
new
QueryWrapper
<
ImApplication
>().
lambda
().
eq
(
ImApplication:
:
getAppKey
,
curentJwtToken
.
getAppKey
())
);
ImClient
client
=
this
.
getOne
(
new
QueryWrapper
<
ImClient
>().
lambda
()
return
this
.
getOne
(
new
QueryWrapper
<
ImClient
>().
lambda
()
.
eq
(
ImClient:
:
getFkAppid
,
imApplication
.
getId
())
.
eq
(
ImClient:
:
getClientId
,
curentJwtToken
.
getClientId
()));
return
client
;
}
}
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
615f7b7a
...
...
@@ -146,12 +146,19 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
}
@Override
public
List
<
MyConversationListVo
>
getMyImConversationList
()
throws
Exception
{
public
List
<
MyConversationListVo
>
getMyImConversationList
AndMsgCount
()
throws
Exception
{
ImClient
client
=
imClientService
.
getClient
();
return
imConversationMapper
.
getMyImConversationList
(
client
.
getId
());
return
imConversationMapper
.
getMyImConversationListAndMsgCount
(
client
.
getId
());
}
@Override
public
List
<
ImConversation
>
getMyImConversationList
()
throws
Exception
{
ImClient
client
=
imClientService
.
getClient
();
return
imConversationMapper
.
getMyImConversationList
(
client
.
getId
());
}
}
common/src/main/java/com/wecloud/im/service/impl/ImInboxServiceImpl.java
View file @
615f7b7a
...
...
@@ -3,11 +3,15 @@ package com.wecloud.im.service.impl;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.wecloud.im.entity.ImClient
;
import
com.wecloud.im.entity.ImInbox
;
import
com.wecloud.im.mapper.ImInboxMapper
;
import
com.wecloud.im.param.ImInboxPageParam
;
import
com.wecloud.im.param.ImInboxQueryVo
;
import
com.wecloud.im.param.ImMsgReceivedUpdate
;
import
com.wecloud.im.service.ImClientService
;
import
com.wecloud.im.service.ImInboxService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
...
...
@@ -28,6 +32,8 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Autowired
private
ImInboxMapper
imInboxMapper
;
@Autowired
private
ImClientService
imClientService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
...
...
@@ -59,4 +65,14 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
return
new
Paging
<
ImInboxQueryVo
>(
iPage
);
}
@Override
public
ApiResult
<
Boolean
>
updateImMsgReceived
(
ImMsgReceivedUpdate
imMsgReceivedUpdate
)
{
ImClient
client
=
imClientService
.
getClient
();
Long
aLong
=
imInboxMapper
.
updateImMsgReceivedByIds
(
client
.
getId
(),
imMsgReceivedUpdate
.
getMsgIds
());
return
ApiResult
.
ok
();
}
}
common/src/main/java/com/wecloud/im/service/impl/ImMessageServiceImpl.java
View file @
615f7b7a
package
com
.
wecloud
.
im
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.wecloud.im.entity.ImClient
;
import
com.wecloud.im.entity.ImConversation
;
import
com.wecloud.im.entity.ImMessage
;
import
com.wecloud.im.mapper.ImMessageMapper
;
import
com.wecloud.im.param.ImMessagePageParam
;
import
com.wecloud.im.param.ImMessageQueryVo
;
import
com.wecloud.im.service.ImClientService
;
import
com.wecloud.im.service.ImConversationService
;
import
com.wecloud.im.service.ImMessageService
;
import
com.wecloud.im.param.ImMessagePageParam
;
import
com.wecloud.im.param.ImMessageQueryV
o
;
import
com.wecloud.im.vo.ImMessageOfflineListVo
;
import
com.wecloud.im.vo.OfflineMsgDt
o
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 消息存储表 服务实现类
...
...
@@ -26,37 +35,89 @@ import org.springframework.beans.factory.annotation.Autowired;
@Service
public
class
ImMessageServiceImpl
extends
BaseServiceImpl
<
ImMessageMapper
,
ImMessage
>
implements
ImMessageService
{
@Autowired
private
ImMessageMapper
imMessageMapper
;
@Autowired
private
ImMessageMapper
imMessageMapper
;
@Autowired
private
ImClientService
imClientService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
saveImMessage
(
ImMessage
imMessage
)
throws
Exception
{
@Autowired
private
ImConversationService
imConversationService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
saveImMessage
(
ImMessage
imMessage
)
throws
Exception
{
return
super
.
save
(
imMessage
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
updateImMessage
(
ImMessage
imMessage
)
throws
Exception
{
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
updateImMessage
(
ImMessage
imMessage
)
throws
Exception
{
return
super
.
updateById
(
imMessage
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
deleteImMessage
(
Long
id
)
throws
Exception
{
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
deleteImMessage
(
Long
id
)
throws
Exception
{
return
super
.
removeById
(
id
);
}
}
@Override
public
ImMessageQueryVo
getImMessageById
(
Long
id
)
throws
Exception
{
return
imMessageMapper
.
getImMessageById
(
id
);
}
@Override
public
Paging
<
ImMessageQueryVo
>
getImMessagePageList
(
ImMessagePageParam
imMessagePageParam
)
throws
Exception
{
Page
<
ImMessageQueryVo
>
page
=
new
PageInfo
<>(
imMessagePageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
ImMessage:
:
getCreateTime
)));
IPage
<
ImMessageQueryVo
>
iPage
=
imMessageMapper
.
getImMessagePageList
(
page
,
imMessagePageParam
);
public
ImMessageQueryVo
getImMessageById
(
Long
id
)
throws
Exception
{
return
imMessageMapper
.
getImMessageById
(
id
);
}
@Override
public
Paging
<
ImMessageQueryVo
>
getImMessagePageList
(
ImMessagePageParam
imMessagePageParam
)
throws
Exception
{
Page
<
ImMessageQueryVo
>
page
=
new
PageInfo
<>(
imMessagePageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
ImMessage:
:
getCreateTime
)));
IPage
<
ImMessageQueryVo
>
iPage
=
imMessageMapper
.
getImMessagePageList
(
page
,
imMessagePageParam
);
return
new
Paging
<
ImMessageQueryVo
>(
iPage
);
}
}
/**
* 查询用户所有离线消息
*
* @return
* @throws Exception
*/
@Override
public
List
<
ImMessageOfflineListVo
>
getOfflineList
()
throws
Exception
{
// 返回数据
List
<
ImMessageOfflineListVo
>
imMessageOfflineListVoList
=
new
ArrayList
<>();
ImClient
client
=
imClientService
.
getClient
();
// 获取加入的所有会话
List
<
ImConversation
>
myImConversationList
=
imConversationService
.
getMyImConversationList
();
// 遍历会话列表, 查询每个会话列表的离线消息
for
(
ImConversation
imConversation
:
myImConversationList
)
{
//根据客户端id与会话id 查询离线消息
List
<
OfflineMsgDto
>
offlineListByClientAndConversation
=
getOfflineListByClientAndConversation
(
client
.
getId
(),
imConversation
.
getId
());
ImMessageOfflineListVo
imMessageOfflineListVo
=
new
ImMessageOfflineListVo
();
imMessageOfflineListVo
.
setMsgList
(
offlineListByClientAndConversation
);
imMessageOfflineListVo
.
setConversationId
(
imConversation
.
getId
());
imMessageOfflineListVoList
.
add
(
imMessageOfflineListVo
);
}
return
imMessageOfflineListVoList
;
}
/**
* 根据客户端id与会话id 查询离线消息
*
* @param clientId
* @param conversationId
* @return
*/
@Override
public
List
<
OfflineMsgDto
>
getOfflineListByClientAndConversation
(
Long
clientId
,
Long
conversationId
)
{
return
imMessageMapper
.
getOfflineListByClientAndConversation
(
clientId
,
conversationId
);
}
}
common/src/main/java/com/wecloud/im/vo/ImMessageOfflineListVo.java
0 → 100644
View file @
615f7b7a
package
com
.
wecloud
.
im
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <pre>
* 离线消息列表 查询结果对象
* </pre>
*
* @author wei
* @date 2021-04-29
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"ImMessageOfflineListVo"
)
public
class
ImMessageOfflineListVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"会话id"
)
private
Long
conversationId
;
@ApiModelProperty
(
"消息列表"
)
private
List
<
OfflineMsgDto
>
msgList
;
}
\ No newline at end of file
common/src/main/java/com/wecloud/im/vo/OfflineMsgDto.java
0 → 100644
View file @
615f7b7a
package
com
.
wecloud
.
im
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 离线消息内容实体
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"OfflineMsgDto"
)
public
class
OfflineMsgDto
implements
Serializable
{
@ApiModelProperty
(
"消息id"
)
private
Long
id
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"撤回时间"
)
private
Date
withdrawTime
;
@ApiModelProperty
(
"修改时间"
)
private
Date
updateDate
;
@ApiModelProperty
(
"发送者客户端id"
)
private
String
sender
;
@ApiModelProperty
(
"内容"
)
private
String
content
;
@ApiModelProperty
(
"0未撤回; 1已撤回"
)
private
Boolean
withdraw
;
@ApiModelProperty
(
"0非事件; 1为事件"
)
private
Boolean
event
;
@ApiModelProperty
(
"0非系统通知; 1为系统通知"
)
private
Boolean
system
;
@ApiModelProperty
(
"at他人,传入客户端id数组"
)
private
String
at
;
}
common/src/main/resources/mapper/ImConversationMapper.xml
View file @
615f7b7a
...
...
@@ -20,23 +20,24 @@
<include
refid=
"Base_Column_List"
/>
from im_conversation
</select>
<select
id=
"getMyImConversationList"
resultType=
"com.wecloud.im.vo.MyConversationListVo"
>
<select
id=
"getMyImConversationList
AndMsgCount
"
resultType=
"com.wecloud.im.vo.MyConversationListVo"
>
SELECT imConversation.id,
imConversation.create_time,
imConversation.`name`,
imConversation.attributes,
imConversation.system,
im_client.client_id
AS creator,
im_client.client_id AS creator,
(SELECT COUNT(im_inbox.id)
FROM im_inbox
WHERE im_inbox.fk_conversation_id = imConversation.id
AND im_inbox.receiver = #{clientId}) AS msg_not_read_count,
AND im_inbox.receiver = #{clientId}
AND im_inbox.read_msg = 0) AS msg_not_read_count,
(
SELECT GROUP_CONCAT(im_client.client_id)
FROM im_conversation_members AS im_conversation_members
INNER JOIN im_client AS im_client ON im_client.id = im_conversation_members.fk_client_id
WHERE im_conversation_members.fk_conversation_id = imConversation.id
)
AS members
) AS members
FROM im_conversation_members AS imConversationMembers
INNER JOIN im_conversation AS imConversation
ON imConversation.id = imConversationMembers.fk_conversation_id
...
...
@@ -45,4 +46,12 @@
GROUP BY imConversation.id
</select>
<select
id=
"getMyImConversationList"
resultType=
"com.wecloud.im.entity.ImConversation"
>
SELECT imConversation.*
FROM im_conversation_members AS imConversationMembers
INNER JOIN im_conversation imConversation
ON imConversation.id = imConversationMembers.fk_conversation_id
WHERE imConversationMembers.fk_client_id = #{clientId}
</select>
</mapper>
common/src/main/resources/mapper/ImInboxMapper.xml
View file @
615f7b7a
...
...
@@ -7,6 +7,19 @@
id
, create_time, update_time, receiver_date, fk_appid, receiver, fk_msg_id, read_msg, fk_conversation_id
</sql>
<update
id=
"updateImMsgReceivedByIds"
>
UPDATE im_inbox
SET `im_inbox`.`update_time` = NOW(),
`im_inbox`.`read_msg` = 1,
`im_inbox`.`receiver_date` = NOW()
WHERE
im_inbox.receiver = #{clientId}
AND im_inbox.fk_msg_id IN
<foreach
collection=
"msgIds"
item=
"deptId"
index=
"i"
open=
"("
close=
")"
separator=
","
>
#{deptId}
</foreach>
</update>
<select
id=
"getImInboxById"
resultType=
"com.wecloud.im.param.ImInboxQueryVo"
>
select
...
...
common/src/main/resources/mapper/ImMessageMapper.xml
View file @
615f7b7a
...
...
@@ -2,21 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.wecloud.im.mapper.ImMessageMapper"
>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, create_time, withdraw_time, update_date, fk_appid, sender, content, withdraw, event, system, at, send_status, fk_conversation_id
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id
, create_time, withdraw_time, update_date, fk_appid, sender, content, withdraw, event, system, at, send_status, fk_conversation_id
</sql>
<select
id=
"getImMessageById"
resultType=
"com.wecloud.im.param.ImMessageQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from im_message where id = #{id}
</select>
<select
id=
"getImMessageById"
resultType=
"com.wecloud.im.param.ImMessageQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from im_message where id = #{id}
</select>
<select
id=
"getImMessagePageList"
parameterType=
"com.wecloud.im.param.ImMessagePageParam"
resultType=
"com.wecloud.im.param.ImMessageQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from im_message
</select>
<select
id=
"getImMessagePageList"
parameterType=
"com.wecloud.im.param.ImMessagePageParam"
resultType=
"com.wecloud.im.param.ImMessageQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from im_message
</select>
<select
id=
"getOfflineListByClientAndConversation"
resultType=
"com.wecloud.im.vo.OfflineMsgDto"
>
SELECT im_message.*
FROM im_inbox
INNER JOIN im_message im_message ON im_message.id = im_inbox.fk_msg_id
WHERE im_inbox.fk_conversation_id = #{conversationId}
AND im_inbox.receiver = #{clientId}
AND im_inbox.read_msg = 0
</select>
</mapper>
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