Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
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
李伟
cust-api
Commits
42ee46f4
Commit
42ee46f4
authored
Jan 20, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了动态的关注查询
parent
0b3842cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
9 deletions
+50
-9
MemInfoRepository.java
...a/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
+5
-0
OpmArticle.java
...va/org/rcisoft/business/opmArticle/entity/OpmArticle.java
+11
-0
OpmArticleServiceImpl.java
...siness/opmArticle/service/impl/OpmArticleServiceImpl.java
+20
-8
MemInfoMapper.xml
...esources/mapper/business/memInfo/mapper/MemInfoMapper.xml
+4
-0
OpmArticleMapper.xml
...es/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
+7
-0
OpmTopicMapper.xml
...ources/mapper/business/opmTopic.mapper/OpmTopicMapper.xml
+3
-1
No files found.
src/main/java/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
View file @
42ee46f4
...
@@ -117,5 +117,10 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
...
@@ -117,5 +117,10 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
* 点赞
* 点赞
*/
*/
Integer
addLike
(
@Param
(
"entity"
)
MemLikeDTO
likeDTO
);
Integer
addLike
(
@Param
(
"entity"
)
MemLikeDTO
likeDTO
);
/**
* 查询关注的id集合
*/
List
<
Integer
>
queryFollowIdById
(
String
authenBusinessId
);
}
}
src/main/java/org/rcisoft/business/opmArticle/entity/OpmArticle.java
View file @
42ee46f4
...
@@ -201,5 +201,16 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> {
...
@@ -201,5 +201,16 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> {
*/
*/
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
Integer
parentId
;
private
Integer
parentId
;
/**
* 动态查询类型 1:个人 0:关注 2:最近 3:话题
*/
@TableField
(
exist
=
false
)
private
String
articleType
;
/**
* 关注的数组
*/
private
List
<
Integer
>
followList
;
}
}
src/main/java/org/rcisoft/business/opmArticle/service/impl/OpmArticleServiceImpl.java
View file @
42ee46f4
...
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.baidu.censor.dto.CensorResult
;
import
org.rcisoft.baidu.censor.dto.CensorResult
;
import
org.rcisoft.baidu.censor.service.ContentCensorService
;
import
org.rcisoft.baidu.censor.service.ContentCensorService
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.opmArticle.dao.OpmArticleRepository
;
import
org.rcisoft.business.opmArticle.dao.OpmArticleRepository
;
import
org.rcisoft.business.opmArticle.entity.ArticleCommentDTO
;
import
org.rcisoft.business.opmArticle.entity.ArticleCommentDTO
;
import
org.rcisoft.business.opmArticle.entity.ArticleCommentVO
;
import
org.rcisoft.business.opmArticle.entity.ArticleCommentVO
;
...
@@ -46,6 +47,8 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
...
@@ -46,6 +47,8 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
private
ContentCensorService
contentCensorService
;
private
ContentCensorService
contentCensorService
;
@Autowired
@Autowired
private
CyFileStorageService
cyFileStorageService
;
private
CyFileStorageService
cyFileStorageService
;
@Autowired
private
MemInfoRepository
memInfoRepository
;
/**
/**
* 保存 opmArticle管理
* 保存 opmArticle管理
* @param opmArticle
* @param opmArticle
...
@@ -160,15 +163,24 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
...
@@ -160,15 +163,24 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
@Override
@Override
public
IPage
<
OpmArticle
>
findAllByPagination
(
CyPageInfo
<
OpmArticle
>
paginationUtility
,
public
IPage
<
OpmArticle
>
findAllByPagination
(
CyPageInfo
<
OpmArticle
>
paginationUtility
,
OpmArticle
opmArticle
){
OpmArticle
opmArticle
){
IPage
<
OpmArticle
>
result
=
null
;
if
(
opmArticle
.
getArticleType
().
equals
(
"0"
)){
//关注
//查询该用户关注对象的id集合
List
<
Integer
>
list
=
memInfoRepository
.
queryFollowIdById
(
CyUserUtil
.
getAuthenBusinessId
());
opmArticle
.
setFollowList
(
list
);
result
=
baseMapper
.
queryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
}
else
{
if
(
StringUtils
.
isNotEmpty
(
opmArticle
.
getUserId
())){
if
(
StringUtils
.
isNotEmpty
(
opmArticle
.
getUserId
())){
//设置查询用户 查询某个人的动态列表
//设置查询用户 查询某个人的动态列表
opmArticle
.
setUserId
(
opmArticle
.
getUserId
());
opmArticle
.
setUserId
(
opmArticle
.
getUserId
());
}
}
if
(
StringUtils
.
isNotEmpty
(
CyUserUtil
.
getAuthenBusinessId
())){
if
(
StringUtils
.
isNotEmpty
(
CyUserUtil
.
getAuthenBusinessId
())){
//设置当前登录人id
//设置当前登录人id 用来查询该用户对文章是否已点赞
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
}
}
IPage
<
OpmArticle
>
result
=
baseMapper
.
queryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
result
=
baseMapper
.
queryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
}
return
result
;
return
result
;
}
}
...
...
src/main/resources/mapper/business/memInfo/mapper/MemInfoMapper.xml
View file @
42ee46f4
...
@@ -523,6 +523,10 @@
...
@@ -523,6 +523,10 @@
SELECT MAX(CASE WHEN ouf.business_id IS NOT NULL THEN 1 ELSE 0 END) AS isFollowed
SELECT MAX(CASE WHEN ouf.business_id IS NOT NULL THEN 1 ELSE 0 END) AS isFollowed
FROM (SELECT 1 AS dummy) d LEFT JOIN opm_user_follow ouf ON ouf.user_id = #{entity.userId} AND ouf.target_id = #{entity.targetId};
FROM (SELECT 1 AS dummy) d LEFT JOIN opm_user_follow ouf ON ouf.user_id = #{entity.userId} AND ouf.target_id = #{entity.targetId};
</select>
</select>
<select
id=
"queryFollowIdById"
resultType=
"java.lang.Integer"
>
select ouf.target_id from opm_user_follow ouf WHERE ouf.user_id = #{userId}
</select>
<delete
id=
"deleteFollow"
parameterType=
"org.rcisoft.business.memInfo.entity.MemFollowDTO"
>
<delete
id=
"deleteFollow"
parameterType=
"org.rcisoft.business.memInfo.entity.MemFollowDTO"
>
delete from opm_user_follow
delete from opm_user_follow
where user_id = #{entity.userId} and target_id = #{entity.targetId}
where user_id = #{entity.userId} and target_id = #{entity.targetId}
...
...
src/main/resources/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
View file @
42ee46f4
...
@@ -173,6 +173,13 @@
...
@@ -173,6 +173,13 @@
<if
test=
"entity.commentCount !=null and entity.commentCount != '' "
>
<if
test=
"entity.commentCount !=null and entity.commentCount != '' "
>
and opa.comment_count
>
= #{entity.commentCount}
and opa.comment_count
>
= #{entity.commentCount}
</if>
</if>
<if
test=
"entity.followList != null and entity.followList.size > 0"
>
and opa.create_by IN
<foreach
item=
"item"
index=
"index"
collection=
"entity.followList"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
GROUP BY
GROUP BY
opa.business_id
opa.business_id
ORDER BY
ORDER BY
...
...
src/main/resources/mapper/business/opmTopic.mapper/OpmTopicMapper.xml
View file @
42ee46f4
...
@@ -30,7 +30,9 @@
...
@@ -30,7 +30,9 @@
su.nick_name as nickName
su.nick_name as nickName
FROM opm_topic cn
FROM opm_topic cn
LEFT JOIN sys_user su on su.business_id = cn.create_by
LEFT JOIN sys_user su on su.business_id = cn.create_by
where cn.del_flag='0'
where 1=1
and cn.del_flag = '0'
and cn.flag = '1'
<if
test=
"entity.flag!=null and entity.flag != '' "
>
<if
test=
"entity.flag!=null and entity.flag != '' "
>
and cn.flag = #{entity.flag}
and cn.flag = #{entity.flag}
</if>
</if>
...
...
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