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
a8c5ea32
Commit
a8c5ea32
authored
Nov 07, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-bacground-im' into dev
parents
bfac67cb
78ca98e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
202 deletions
+30
-202
AddMsgParam.java
...src/main/java/com/xxfc/platform/im/model/AddMsgParam.java
+3
-200
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+21
-2
MsgController.java
...rc/main/java/com/xxfc/platform/im/rest/MsgController.java
+6
-0
No files found.
xx-im/xx-im-api/src/main/java/com/xxfc/platform/im/model/AddMsgParam.java
View file @
a8c5ea32
package
com
.
xxfc
.
platform
.
im
.
model
;
package
com
.
xxfc
.
platform
.
im
.
model
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.List
;
@Data
public
class
AddMsgParam
extends
BaseExample
{
public
class
AddMsgParam
extends
BaseExample
{
private
String
address
;
//地理位置
private
String
address
;
//地理位置
private
String
audios
;
// 语音地址
private
String
audios
;
// 语音地址
...
@@ -30,204 +33,4 @@ public class AddMsgParam extends BaseExample {
...
@@ -30,204 +33,4 @@ public class AddMsgParam extends BaseExample {
private
int
isAllowComment
;
// 是否允许评论 0:允许 1:禁止评论
private
int
isAllowComment
;
// 是否允许评论 0:允许 1:禁止评论
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getAddress
()
{
return
address
;
}
public
String
getAudios
()
{
return
audios
;
}
public
int
getFlag
()
{
return
flag
;
}
public
String
getImages
()
{
return
images
;
}
public
String
getMessageId
()
{
return
messageId
;
}
public
String
getRemark
()
{
return
remark
;
}
public
int
getSource
()
{
return
source
;
}
public
String
getText
()
{
return
text
;
}
public
long
getTime
()
{
return
time
;
}
public
String
getTitle
()
{
return
title
;
}
public
int
getType
()
{
return
type
;
}
public
String
getVideos
()
{
return
videos
;
}
public
int
getVisible
()
{
return
visible
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
void
setAudios
(
String
audios
)
{
this
.
audios
=
audios
;
}
public
void
setFlag
(
int
flag
)
{
this
.
flag
=
flag
;
}
public
void
setImages
(
String
images
)
{
this
.
images
=
images
;
}
public
void
setMessageId
(
String
messageId
)
{
this
.
messageId
=
messageId
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
void
setSource
(
int
source
)
{
this
.
source
=
source
;
}
public
void
setText
(
String
text
)
{
this
.
text
=
text
;
}
public
void
setTime
(
long
time
)
{
this
.
time
=
time
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
void
setVideos
(
String
videos
)
{
this
.
videos
=
videos
;
}
public
void
setVisible
(
int
visible
)
{
this
.
visible
=
visible
;
}
public
List
<
Integer
>
getUserLook
()
{
return
userLook
;
}
public
void
setUserLook
(
List
<
Integer
>
userLook
)
{
this
.
userLook
=
userLook
;
}
public
List
<
Integer
>
getUserNotLook
()
{
return
userNotLook
;
}
public
void
setUserNotLook
(
List
<
Integer
>
userNotLook
)
{
this
.
userNotLook
=
userNotLook
;
}
public
List
<
Integer
>
getUserRemindLook
()
{
return
userRemindLook
;
}
public
void
setUserRemindLook
(
List
<
Integer
>
userRemindLook
)
{
this
.
userRemindLook
=
userRemindLook
;
}
public
String
getFiles
()
{
return
files
;
}
public
void
setFiles
(
String
files
)
{
this
.
files
=
files
;
}
public
String
getSdkUrl
()
{
return
sdkUrl
;
}
public
void
setSdkUrl
(
String
sdkUrl
)
{
this
.
sdkUrl
=
sdkUrl
;
}
public
String
getSdkIcon
()
{
return
sdkIcon
;
}
public
void
setSdkIcon
(
String
sdkIcon
)
{
this
.
sdkIcon
=
sdkIcon
;
}
public
String
getSdkTitle
()
{
return
sdkTitle
;
}
public
void
setSdkTitle
(
String
sdkTitle
)
{
this
.
sdkTitle
=
sdkTitle
;
}
public
String
getLable
()
{
return
lable
;
}
public
void
setLable
(
String
lable
)
{
this
.
lable
=
lable
;
}
public
String
getMusicId
()
{
return
musicId
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
void
setMusicId
(
String
musicId
)
{
this
.
musicId
=
musicId
;
}
public
int
getIsAllowComment
()
{
return
isAllowComment
;
}
public
void
setIsAllowComment
(
int
isAllowComment
)
{
this
.
isAllowComment
=
isAllowComment
;
}
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
a8c5ea32
...
@@ -350,7 +350,10 @@ public class MsgBiz {
...
@@ -350,7 +350,10 @@ public class MsgBiz {
log
.
info
(
"后台添加消息: param = {}"
,
param
);
log
.
info
(
"后台添加消息: param = {}"
,
param
);
Msg
entity
=
Msg
.
build
(
param
.
getUserId
(),
param
.
getNickname
(),
param
);
Msg
entity
=
Msg
.
build
(
param
.
getUserId
(),
param
.
getNickname
(),
param
);
// 保存商务圈消息
// 保存商务圈消息
mongoTemplate
.
save
(
entity
);
Msg
msg
=
mongoTemplate
.
save
(
entity
,
"s_msg"
);
if
(
msg
==
null
)
{
return
null
;
}
// 如果musicId不为空维护音乐使用次数
// 如果musicId不为空维护音乐使用次数
if
(!
StringUtils
.
isEmpty
(
param
.
getMusicId
())){
if
(!
StringUtils
.
isEmpty
(
param
.
getMusicId
())){
updateUseCount
(
new
ObjectId
(
param
.
getMusicId
()));
updateUseCount
(
new
ObjectId
(
param
.
getMusicId
()));
...
@@ -381,8 +384,24 @@ public class MsgBiz {
...
@@ -381,8 +384,24 @@ public class MsgBiz {
UpdateResult
updateResult
=
mongoTemplate
.
updateFirst
(
query
,
update
,
MusicInfo
.
class
,
"musicInfo"
);
UpdateResult
updateResult
=
mongoTemplate
.
updateFirst
(
query
,
update
,
MusicInfo
.
class
,
"musicInfo"
);
log
.
info
(
"修改音乐使用次数: updateResult = {}"
,
updateResult
);
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 @
a8c5ea32
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.im.rest;
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.im.rest;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.im.biz.MsgBiz
;
import
com.xxfc.platform.im.biz.MsgBiz
;
import
com.xxfc.platform.im.model.AddMsgParam
;
import
com.xxfc.platform.im.model.AddMsgParam
;
import
com.xxfc.platform.im.model.Msg
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -44,4 +45,9 @@ public class MsgController {
...
@@ -44,4 +45,9 @@ public class MsgController {
public
ObjectRestResponse
addMsg
(
@RequestBody
AddMsgParam
param
)
{
public
ObjectRestResponse
addMsg
(
@RequestBody
AddMsgParam
param
)
{
return
ObjectRestResponse
.
succ
(
msgBiz
.
add
(
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