Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
82501221
Commit
82501221
authored
Jul 08, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
a01256f6
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
111 additions
and
14 deletions
+111
-14
HotTopic.java
.../main/java/com/tanpu/community/api/beans/qo/HotTopic.java
+20
-0
ThemeContentQo.java
...java/com/tanpu/community/api/beans/qo/ThemeContentQo.java
+23
-0
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+6
-6
TopicDetailQo.java
.../java/com/tanpu/community/api/beans/qo/TopicDetailQo.java
+2
-0
TopicHotQo.java
...ain/java/com/tanpu/community/api/beans/qo/TopicHotQo.java
+19
-0
TopicTitileQo.java
.../java/com/tanpu/community/api/beans/qo/TopicTitileQo.java
+1
-1
CreateCommentReq.java
...tanpu/community/api/beans/req/theme/CreateCommentReq.java
+5
-2
ThemeContentReq.java
.../tanpu/community/api/beans/req/theme/ThemeContentReq.java
+19
-0
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+1
-1
TopicController.java
.../java/com/tanpu/community/controller/TopicController.java
+10
-0
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+3
-2
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+2
-2
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/HotTopic.java
0 → 100644
View file @
82501221
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"热门话题"
)
public
class
HotTopic
{
@ApiModelProperty
(
value
=
"话题ID"
)
private
String
topicId
;
@ApiModelProperty
(
value
=
"话题名称"
)
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"类型 1:热 2:新"
)
private
Integer
type
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeContentQo.java
0 → 100644
View file @
82501221
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"主题内容"
)
public
class
ThemeContentQo
{
@ApiModelProperty
(
value
=
"类型,0:文本,1:产品 2:直播 3:短视频 4:课程,5:图片 6:图片列表(讨论)"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"文本的值是内容,附件的值为id"
)
private
String
value
;
@ApiModelProperty
(
value
=
"类型为6时,传入图片列表"
)
private
String
[]
imgList
;
@ApiModelProperty
(
value
=
"对象详情"
)
private
Object
detail
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
82501221
...
@@ -19,11 +19,14 @@ public class ThemeQo {
...
@@ -19,11 +19,14 @@ public class ThemeQo {
@ApiModelProperty
(
value
=
"标题"
)
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
private
String
title
;
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题"
)
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题
3:转发
"
)
private
Integer
themeType
;
private
Integer
themeType
;
@ApiModelProperty
(
value
=
"文本内容"
)
@ApiModelProperty
(
value
=
"内容"
)
private
String
content
;
private
ThemeContentQo
content
;
@ApiModelProperty
(
value
=
"转发内容"
)
private
ThemeContentQo
forwardContent
;
@ApiModelProperty
(
value
=
"作者id"
)
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
private
String
authorId
;
...
@@ -58,9 +61,6 @@ public class ThemeQo {
...
@@ -58,9 +61,6 @@ public class ThemeQo {
@ApiModelProperty
(
value
=
"点赞量"
)
@ApiModelProperty
(
value
=
"点赞量"
)
private
Integer
likeCount
;
private
Integer
likeCount
;
@ApiModelProperty
(
"附件"
)
private
AttachmentQo
attachmentQo
;
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicDetailQo.java
View file @
82501221
...
@@ -20,4 +20,6 @@ public class TopicDetailQo {
...
@@ -20,4 +20,6 @@ public class TopicDetailQo {
@ApiModelProperty
(
value
=
"讨论量"
)
@ApiModelProperty
(
value
=
"讨论量"
)
private
Integer
disscussCount
;
private
Integer
disscussCount
;
@ApiModelProperty
(
value
=
"类型 1:热 2:新"
)
private
Integer
type
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicHotQo.java
0 → 100644
View file @
82501221
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"热点话题对象"
)
public
class
TopicHotQo
{
@ApiModelProperty
(
value
=
"话题ID"
)
private
String
topicId
;
@ApiModelProperty
(
value
=
"话题名称"
)
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"类型 1:热 2:新"
)
private
Integer
type
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicTitileQo.java
View file @
82501221
...
@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
*
APP端
话题列表页
* 话题列表页
*/
*/
@Data
@Data
@ApiModel
(
"话题列表对象"
)
@ApiModel
(
"话题列表对象"
)
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/CreateCommentReq.java
→
community-api/src/main/java/com/tanpu/community/api/beans/req/
theme/
CreateCommentReq.java
View file @
82501221
package
com
.
tanpu
.
community
.
api
.
beans
.
req
;
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -20,5 +20,8 @@ public class CreateCommentReq {
...
@@ -20,5 +20,8 @@ public class CreateCommentReq {
private
String
replyId
;
private
String
replyId
;
@NotEmpty
(
message
=
"评论内容不能为空"
)
@NotEmpty
(
message
=
"评论内容不能为空"
)
private
String
comment
;
private
ThemeContentReq
comment
;
@ApiModelProperty
(
value
=
"是否同步到专栏"
)
private
boolean
copyToNewsFeed
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/ThemeContentReq.java
0 → 100644
View file @
82501221
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"主题内容"
)
public
class
ThemeContentReq
{
@ApiModelProperty
(
value
=
"类型,0:文本,1:产品 2:直播 3:短视频 4:课程,5:图片 6:图片列表(讨论)"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"文本的值是内容,附件的值为id"
)
private
String
value
;
@ApiModelProperty
(
value
=
"类型为6时,传入图片列表"
)
private
String
[]
imgList
;
}
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
82501221
...
@@ -3,7 +3,7 @@ package com.tanpu.community.controller;
...
@@ -3,7 +3,7 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.
theme.
CreateCommentReq
;
import
com.tanpu.community.manager.CommentManager
;
import
com.tanpu.community.manager.CommentManager
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
community-service/src/main/java/com/tanpu/community/controller/TopicController.java
View file @
82501221
...
@@ -3,6 +3,7 @@ package com.tanpu.community.controller;
...
@@ -3,6 +3,7 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.community.api.beans.qo.TopicDetailQo
;
import
com.tanpu.community.api.beans.qo.TopicDetailQo
;
import
com.tanpu.community.api.beans.qo.TopicHotQo
;
import
com.tanpu.community.api.beans.qo.TopicTitileQo
;
import
com.tanpu.community.api.beans.qo.TopicTitileQo
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.topic.TopicSearchReq
;
import
com.tanpu.community.api.beans.req.topic.TopicSearchReq
;
...
@@ -12,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -12,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
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.*
;
import
java.util.List
;
@RestController
@RestController
@Slf4j
@Slf4j
@RequestMapping
(
value
=
"/api/topic"
)
@RequestMapping
(
value
=
"/api/topic"
)
...
@@ -42,6 +45,13 @@ public class TopicController {
...
@@ -42,6 +45,13 @@ public class TopicController {
}
}
@GetMapping
(
value
=
"/titleList"
)
@ApiOperation
(
"首页顶部话题列表"
)
@ResponseBody
public
CommonResp
<
List
<
TopicHotQo
>>
getHomePage
(
@RequestParam
String
topicId
){
//todo
return
CommonResp
.
success
();
}
}
}
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
82501221
package
com
.
tanpu
.
community
.
manager
;
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.
theme.
CreateCommentReq
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
...
@@ -35,7 +36,7 @@ public class CommentManager {
...
@@ -35,7 +36,7 @@ public class CommentManager {
.
parentId
(
req
.
getParentId
())
.
parentId
(
req
.
getParentId
())
.
replyId
(
req
.
getReplyId
())
.
replyId
(
req
.
getReplyId
())
.
authorId
(
userId
)
.
authorId
(
userId
)
.
content
(
req
.
getComment
(
))
.
content
(
JsonUtil
.
toJson
(
req
.
getComment
()
))
.
commentType
(
CommentTypeEnum
.
THEME
.
getCode
())
.
commentType
(
CommentTypeEnum
.
THEME
.
getCode
())
.
build
();
.
build
();
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
82501221
...
@@ -217,7 +217,7 @@ public class ThemeManager {
...
@@ -217,7 +217,7 @@ public class ThemeManager {
if
(!
CollectionUtils
.
isEmpty
(
attachments
))
{
if
(!
CollectionUtils
.
isEmpty
(
attachments
))
{
ThemeAttachmentEntity
attachmentEntity
=
attachments
.
get
(
0
);
ThemeAttachmentEntity
attachmentEntity
=
attachments
.
get
(
0
);
AttachmentQo
attachmentQo
=
AttachmentQo
.
builder
().
type
(
attachmentEntity
.
getAttachType
()).
attachment
(
transferAttachment
(
attachmentEntity
,
userId
)).
build
();
AttachmentQo
attachmentQo
=
AttachmentQo
.
builder
().
type
(
attachmentEntity
.
getAttachType
()).
attachment
(
transferAttachment
(
attachmentEntity
,
userId
)).
build
();
themeQO
.
setAttachmentQo
(
attachmentQo
);
//TODO CONTENT添加附件detail
}
}
//迄今时间
//迄今时间
themeQO
.
setUpToNowTime
(
calUpToNowTime
(
themeQO
.
getCreateTime
()));
themeQO
.
setUpToNowTime
(
calUpToNowTime
(
themeQO
.
getCreateTime
()));
...
@@ -241,7 +241,7 @@ public class ThemeManager {
...
@@ -241,7 +241,7 @@ public class ThemeManager {
//组装正文详情
//组装正文详情
private
void
buildMainTestExtraInfo
(
MainTextQo
maintTextQo
,
String
userId
)
{
private
void
buildMainTestExtraInfo
(
MainTextQo
maintTextQo
,
String
userId
)
{
//附件列表
//附件列表
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
maintTextQo
.
getId
());
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
maintTextQo
.
get
Theme
Id
());
if
(!
CollectionUtils
.
isEmpty
(
attachments
))
{
if
(!
CollectionUtils
.
isEmpty
(
attachments
))
{
List
<
AttachmentQo
>
attachmentQos
=
new
ArrayList
<>();
List
<
AttachmentQo
>
attachmentQos
=
new
ArrayList
<>();
attachments
.
forEach
(
o
->
attachmentQos
.
add
(
AttachmentQo
.
builder
()
attachments
.
forEach
(
o
->
attachmentQos
.
add
(
AttachmentQo
.
builder
()
...
...
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