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
dd910344
Commit
dd910344
authored
Nov 08, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
4582f258
df2f918e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
2 deletions
+42
-2
ImQuestionBiz.java
...src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
+12
-0
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+18
-2
ImQuestionController.java
.../java/com/xxfc/platform/im/rest/ImQuestionController.java
+6
-0
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/ImQuestionBiz.java
View file @
dd910344
...
...
@@ -117,6 +117,18 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
deleteById
(
Long
id
)
{
if
(
id
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
ImQuestion
imQuestion
=
mapper
.
selectByPrimaryKey
(
id
);
if
(
imQuestion
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
imQuestion
.
setIsDel
(
true
);
updateSelectiveByIdRe
(
imQuestion
);
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
update
(
Long
id
,
MsgTypeEnum
type
,
UpdateTypeEnum
updateType
)
{
if
(
id
==
null
||
type
==
null
)
{
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
dd910344
...
...
@@ -366,12 +366,12 @@ public class MsgBiz {
if
(
msgQueryDto
.
getSource
()
==
1
)
{
query
.
addCriteria
(
Criteria
.
where
(
"source"
).
is
(
msgQueryDto
.
getSource
()));
}
else
{
query
.
addCriteria
(
Criteria
.
where
(
"source"
).
is
(
msgQueryDto
.
getSource
()).
orOperator
(
Criteria
.
where
(
"source"
).
is
(
null
)
));
query
.
addCriteria
(
Criteria
.
where
(
"source"
).
is
(
2
));
}
}
//下单时间
if
(
msgQueryDto
.
getStartTime
()
!=
null
)
{
query
.
addCriteria
(
Criteria
.
where
(
"body.time"
).
gte
(
msgQueryDto
.
getStartTime
())
.
orOperator
(
Criteria
.
where
(
"body.time"
).
lte
(
msgQueryDto
.
getEndTime
())));
query
.
addCriteria
(
Criteria
.
where
(
"body.time"
).
gte
(
msgQueryDto
.
getStartTime
())
).
addCriteria
(
(
Criteria
.
where
(
"body.time"
).
lte
(
msgQueryDto
.
getEndTime
())));
}
//用户名
if
(
StringUtils
.
isNotBlank
(
msgQueryDto
.
getUsername
()))
{
...
...
@@ -470,4 +470,20 @@ public class MsgBiz {
return
ObjectRestResponse
.
succ
(
newValue
);
}
public
ObjectRestResponse
deleteById
(
String
id
)
{
if
(
StringUtils
.
isBlank
(
id
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
Query
query
=
new
Query
(
Criteria
.
where
(
"_id"
).
is
(
id
));
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
));
}
DeleteResult
deleteResult
=
mongoTemplate
.
remove
(
query
,
Msg
.
class
,
"s_msg"
);
if
(
deleteResult
!=
null
&&
deleteResult
.
getDeletedCount
()
==
1
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
IM_DELETE_FAIL_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
IM_DELETE_FAIL_CODE
));
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/ImQuestionController.java
View file @
dd910344
...
...
@@ -41,4 +41,10 @@ public class ImQuestionController {
public
ObjectRestResponse
delete
(
Long
id
)
{
return
imQuestionBiz
.
delete
(
id
);
}
@GetMapping
(
value
=
"/bg/app/unauth/delete"
)
@ApiOperation
(
value
=
"删除问答信息"
)
public
ObjectRestResponse
deleteById
(
Long
id
)
{
return
imQuestionBiz
.
deleteById
(
id
);
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/MsgController.java
View file @
dd910344
...
...
@@ -41,6 +41,10 @@ public class MsgController {
return
msgBiz
.
deleteByList
(
ids
);
}
@GetMapping
(
value
=
"/bg/app/unauth/delete"
)
public
ObjectRestResponse
deleteById
(
String
id
)
{
return
msgBiz
.
deleteById
(
id
);
}
@PostMapping
(
value
=
"/bg/app/unauth/addMsg"
)
public
ObjectRestResponse
addMsg
(
@RequestBody
AddMsgParam
param
)
{
...
...
@@ -56,4 +60,6 @@ public class MsgController {
public
ObjectRestResponse
getMsgList
(
@RequestBody
MsgQueryDto
msgQueryDto
)
{
return
msgBiz
.
getMsgList
(
msgQueryDto
);
}
}
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