Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mzyy
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
mzyy
Commits
170f4f3c
提交
170f4f3c
authored
1月 20, 2020
作者:
chaoyanjun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
56726ee9
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
172 行增加
和
14 行删除
+172
-14
.classpath
com.zrqx.sysuser/.classpath
+3
-1
.project
com.zrqx.sysuser/.project
+5
-0
org.eclipse.jdt.core.prefs
com.zrqx.sysuser/.settings/org.eclipse.jdt.core.prefs
+4
-0
org.springframework.ide.eclipse.prefs
...x.sysuser/.settings/org.springframework.ide.eclipse.prefs
+2
-0
YdccTopicController.java
...qx/sysuser/ydcc/controller/topic/YdccTopicController.java
+62
-7
YdccTopicCommentMapper.java
...rqx/sysuser/ydcc/mapper/topic/YdccTopicCommentMapper.java
+36
-0
YdccTopicService.java
...com/zrqx/sysuser/ydcc/service/topic/YdccTopicService.java
+8
-0
YdccTopicServiceImpl.java
...zrqx/sysuser/ydcc/service/topic/YdccTopicServiceImpl.java
+52
-6
没有找到文件。
com.zrqx.sysuser/.classpath
浏览文件 @
170f4f3c
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
including=
"**/*.java"
kind=
"src"
output=
"target/classes"
path=
"src/main/java"
>
<classpathentry
kind=
"src"
output=
"target/classes"
path=
"src/main/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
...
...
@@ -15,11 +15,13 @@
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
<attribute
name=
"test"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
excluding=
"**"
kind=
"src"
output=
"target/test-classes"
path=
"src/test/resources"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
<attribute
name=
"test"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
>
...
...
com.zrqx.sysuser/.project
浏览文件 @
170f4f3c
...
...
@@ -26,6 +26,11 @@
</arguments>
</buildCommand>
<buildCommand>
<name>
org.springframework.ide.eclipse.boot.validation.springbootbuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.m2e.core.maven2Builder
</name>
<arguments>
</arguments>
...
...
com.zrqx.sysuser/.settings/org.eclipse.jdt.core.prefs
浏览文件 @
170f4f3c
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
com.zrqx.sysuser/.settings/org.springframework.ide.eclipse.prefs
0 → 100644
浏览文件 @
170f4f3c
boot.validation.initialized=true
eclipse.preferences.version=1
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/ydcc/controller/topic/YdccTopicController.java
浏览文件 @
170f4f3c
package
com
.
zrqx
.
sysuser
.
ydcc
.
controller
.
topic
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
com.zrqx.core.constant.sysuser.SysUserRequestPath
;
import
com.zrqx.core.form.member.wap.member.UpdateFabulousForm
;
import
com.zrqx.core.form.resource.wap.LoadByIdForm
;
import
com.zrqx.core.model.sysuser.topic.Topic
;
import
com.zrqx.core.model.sysuser.topic.TopicComment
;
import
com.zrqx.core.util.ip.CusAccessObjectUtil
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.core.vo.sysuser.bg.comment.CommentDetailsVo
;
import
com.zrqx.core.vo.sysuser.bg.topic.TopicVo
;
import
com.zrqx.core.vo.topic.TopicCommentVo
;
import
com.zrqx.sysuser.wap.service.WapCommentAgreeService
;
import
com.zrqx.sysuser.ydcc.service.topic.YdccTopicService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
SysUserRequestPath
.
YDCC
+
SysUserRequestPath
.
TOPIC
)
@Api
(
description
=
"医道传承-
话题管理
"
)
@Api
(
description
=
"医道传承-
前台-话题/评论
"
)
public
class
YdccTopicController
{
@Autowired
@Autowired
private
WapCommentAgreeService
wapService
;
@Autowired
private
YdccTopicService
ydccTopicService
;
@ApiOperation
(
value
=
"话题互动分页列表"
)
...
...
@@ -41,4 +59,41 @@ public class YdccTopicController {
public
CallBack
<
List
<
TopicVo
>>
getTopicList
(
LoadByIdForm
form
)
{
return
CallBack
.
success
(
ydccTopicService
.
queryTopicsByMemberId
(
form
.
getId
()));
}
@ApiOperation
(
value
=
"查看话题详情"
,
notes
=
"查看话题详情"
)
@PostMapping
(
SysUserRequestPath
.
OID
)
public
CallBack
<
Topic
>
getTopic
(
@PathVariable
Integer
oid
)
{
return
CallBack
.
success
(
ydccTopicService
.
selectByPrimaryKey
(
oid
));
}
@ApiOperation
(
value
=
"添加评论"
,
notes
=
"添加评论,状态默认为未审核"
)
@PostMapping
(
SysUserRequestPath
.
ADD
)
public
CallBack
<
Boolean
>
saveTopicComment
(
@RequestBody
TopicComment
form
)
{
return
ydccTopicService
.
saveTopicComment
(
form
)
?
CallBack
.
success
()
:
CallBack
.
fail
();
}
@ApiOperation
(
value
=
"查所有评论"
,
notes
=
"查询评论,状态默认为已审核"
)
@PostMapping
(
SysUserRequestPath
.
ALL
)
public
CallBack
<
List
<
TopicCommentVo
>>
getList
(
Integer
id
)
{
// 查询所有已审核的评论list不分页
return
CallBack
.
success
(
ydccTopicService
.
getList
(
id
));
}
@ApiOperation
(
value
=
"查评论详情"
,
notes
=
"查评论详情,状态默认为已审核"
)
@PostMapping
(
SysUserRequestPath
.
LIST
)
public
CallBack
<
CommentDetailsVo
>
getListInfo
(
Integer
id
)
{
// 查询所有已审核的评论的评论list不分页
return
CallBack
.
success
(
ydccTopicService
.
getListInfo
(
id
));
}
@PostMapping
(
"/thumbs-up"
)
@ApiOperation
(
value
=
"评论点赞 "
,
notes
=
"评论点赞/取消点赞"
)
public
CallBack
<
Boolean
>
thumbsUp
(
UpdateFabulousForm
form
,
HttpServletRequest
request
)
{
//IP
form
.
setUserAddress
(
CusAccessObjectUtil
.
getIpAddress
(
request
));
return
wapService
.
updateFabulousNum
(
form
)
?
CallBack
.
success
()
:
CallBack
.
fail
();
}
}
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/ydcc/mapper/topic/YdccTopicCommentMapper.java
0 → 100644
浏览文件 @
170f4f3c
package
com
.
zrqx
.
sysuser
.
ydcc
.
mapper
.
topic
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.sysuser.topic.TopicComment
;
import
com.zrqx.core.vo.sysuser.bg.comment.ReplyVo
;
import
com.zrqx.core.vo.topic.TopicCommentVo
;
@Mapper
public
interface
YdccTopicCommentMapper
extends
BaseMapper
<
TopicComment
>
{
@Select
(
"<script>"
+
" select id,userName,userImg,content,score,fabulousNum,releaseTime from sys_ydcc_topic_comment "
+
" where 1=1 and status = '1' and resourceId = #{id} ORDER BY releaseTime DESC "
+
"</script>"
)
List
<
TopicCommentVo
>
selectForVoById
(
@Param
(
"id"
)
Integer
id
);
@Select
(
"<script>"
+
" SELECT * "
+
" FROM sys_ydcc_topic_comment "
+
" WHERE 1=1 and status = '1' and mainId = #{id} and ORDER BY releaseTime DESC "
+
"</script>"
)
List
<
ReplyVo
>
selectForListById
(
@Param
(
"id"
)
Integer
id
);
@Select
(
"<script>"
+
" select count(*) from sys_ydcc_topic_comment "
+
" where 1=1 and status = '1' and mainId = #{id} "
+
"</script>"
)
int
selectCountById
(
@Param
(
"id"
)
Integer
id
);
}
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/ydcc/service/topic/YdccTopicService.java
浏览文件 @
170f4f3c
package
com
.
zrqx
.
sysuser
.
ydcc
.
service
.
topic
;
import
com.zrqx.core.model.sysuser.topic.Topic
;
import
com.zrqx.core.model.sysuser.topic.TopicComment
;
import
com.zrqx.core.service.BaseService
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.sysuser.bg.comment.CommentDetailsVo
;
import
com.zrqx.core.vo.sysuser.bg.topic.TopicVo
;
import
com.zrqx.core.vo.topic.TopicCommentVo
;
import
java.util.List
;
...
...
@@ -35,4 +38,9 @@ public interface YdccTopicService extends BaseService<Topic,Integer>{
*/
List
<
TopicVo
>
queryTopicsByMemberId
(
Integer
id
);
boolean
saveTopicComment
(
TopicComment
form
);
List
<
TopicCommentVo
>
getList
(
Integer
id
);
CommentDetailsVo
getListInfo
(
Integer
id
);
}
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/ydcc/service/topic/YdccTopicServiceImpl.java
浏览文件 @
170f4f3c
package
com
.
zrqx
.
sysuser
.
ydcc
.
service
.
topic
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zrqx.core.enums.sysuser.comment.UserTypeEnum
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.sysuser.topic.Topic
;
import
com.zrqx.core.model.sysuser.topic.TopicComment
;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.datatype.DateUtils
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.sysuser.bg.comment.CommentDetailsVo
;
import
com.zrqx.core.vo.sysuser.bg.comment.ReplyVo
;
import
com.zrqx.core.vo.sysuser.bg.topic.TopicVo
;
import
com.zrqx.core.vo.topic.TopicCommentVo
;
import
com.zrqx.sysuser.commons.redis.Redis
;
import
com.zrqx.sysuser.ydcc.mapper.topic.YdccTopicCommentMapper
;
import
com.zrqx.sysuser.ydcc.mapper.topic.YdccTopicMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Service
public
class
YdccTopicServiceImpl
extends
BaseServiceImpl
<
Topic
,
Integer
>
implements
YdccTopicService
{
@Autowired
private
YdccTopicMapper
ydccTopicMapper
;
@Autowired
private
YdccTopicCommentMapper
tocMapper
;
@Autowired
private
Redis
redis
;
...
...
@@ -55,4 +66,39 @@ public class YdccTopicServiceImpl extends BaseServiceImpl<Topic,Integer> impleme
@Override
public
boolean
saveTopicComment
(
TopicComment
form
)
{
form
.
setReleaseTime
(
new
Date
());
form
.
setUserId
(
redis
.
getMember
().
getId
()+
""
);
form
.
setUserName
(
redis
.
getMember
().
getNickName
());
form
.
setUserImg
(
redis
.
getMember
().
getImg
());
form
.
setName
(
redis
.
getMember
().
getName
());
form
.
setUserClass
(
UserTypeEnum
.
STATUS_0
.
getCode
());
form
.
setAccessMedium
(
1
);
// 访问媒介 1:PC端,2:Wap端
return
tocMapper
.
insert
(
form
)
>
0
;
}
@Override
public
List
<
TopicCommentVo
>
getList
(
Integer
id
)
{
List
<
TopicCommentVo
>
list
=
tocMapper
.
selectForVoById
(
id
);
list
.
forEach
(
vo
->{
long
fromNow
=
DateUtils
.
secondsFromNow
(
vo
.
getReleaseTime
());
vo
.
setSeconds
(
fromNow
);
// 根据评论id 查回复个数
int
score
=
tocMapper
.
selectCountById
(
vo
.
getId
());
vo
.
setScore
(
score
);
});
return
list
;
}
@Override
public
CommentDetailsVo
getListInfo
(
Integer
id
)
{
TopicComment
top
=
tocMapper
.
selectByPrimaryKey
(
id
);
CommentDetailsVo
vo
=
new
CommentDetailsVo
();
BeanUtils
.
copyProperties
(
top
,
vo
);
List
<
ReplyVo
>
list
=
tocMapper
.
selectForListById
(
id
);
vo
.
setReplyVoList
(
list
);
return
vo
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论