Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
78ca98e6
Commit
78ca98e6
authored
Nov 07, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台添加IM接口
parent
e92d5477
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+17
-1
MsgController.java
...rc/main/java/com/xxfc/platform/im/rest/MsgController.java
+6
-0
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
78ca98e6
...
...
@@ -384,8 +384,24 @@ public class MsgBiz {
UpdateResult
updateResult
=
mongoTemplate
.
updateFirst
(
query
,
update
,
MusicInfo
.
class
,
"musicInfo"
);
log
.
info
(
"修改音乐使用次数: updateResult = {}"
,
updateResult
);
}
}
//修改消息信息
public
ObjectRestResponse
update
(
Msg
msg
)
{
if
(
msg
==
null
||
msg
.
getId
()
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
Query
query
=
new
Query
(
Criteria
.
where
(
"_id"
).
is
(
msg
.
getId
()));
Msg
oldValue
=
mongoTemplate
.
findOne
(
query
,
Msg
.
class
,
"s_msg"
);
if
(
oldValue
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
IM_MSG_NOT_EXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
IM_MSG_NOT_EXIST_CODE
));
}
BeanUtil
.
copyProperties
(
msg
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
Msg
newValue
=
mongoTemplate
.
save
(
oldValue
,
"s_msg"
);
if
(
newValue
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"更新失败"
);
}
return
ObjectRestResponse
.
succ
(
newValue
);
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/MsgController.java
View file @
78ca98e6
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.im.rest;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.im.biz.MsgBiz
;
import
com.xxfc.platform.im.model.AddMsgParam
;
import
com.xxfc.platform.im.model.Msg
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -44,4 +45,9 @@ public class MsgController {
public
ObjectRestResponse
addMsg
(
@RequestBody
AddMsgParam
param
)
{
return
ObjectRestResponse
.
succ
(
msgBiz
.
add
(
param
));
}
@PostMapping
(
value
=
"/bg/app/unauth/update"
)
public
ObjectRestResponse
updateMsg
(
@RequestBody
Msg
msg
)
{
return
msgBiz
.
update
(
msg
);
}
}
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