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
0b385b67
Commit
0b385b67
authored
Jul 12, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev接口测试
parent
92f48f88
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
18 deletions
+71
-18
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+3
-2
CreateCommentReq.java
...npu/community/api/beans/req/comment/CreateCommentReq.java
+2
-1
QueryCommentReq.java
...anpu/community/api/beans/req/comment/QueryCommentReq.java
+23
-0
QueryFollowReq.java
...anpu/community/api/beans/req/homepage/QueryFollowReq.java
+2
-1
LikeThemeReq.java
...com/tanpu/community/api/beans/req/theme/LikeThemeReq.java
+16
-0
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+8
-5
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+4
-3
CodeAutoGenerator.java
.../main/java/com/tanpu/community/dao/CodeAutoGenerator.java
+1
-1
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+1
-1
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+11
-4
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
0b385b67
...
...
@@ -48,7 +48,6 @@ public class ThemeQo {
@ApiModelProperty
(
value
=
"发表时间"
)
private
String
upToNowTime
;
@ApiModelProperty
(
value
=
"转发量"
)
private
Integer
forwardCount
;
...
...
@@ -58,13 +57,15 @@ public class ThemeQo {
@ApiModelProperty
(
value
=
"点赞量"
)
private
Integer
likeCount
;
@ApiModelProperty
(
value
=
"当前用户是否点赞"
)
private
boolean
isLiked
;
@ApiModelProperty
(
value
=
"图片九宫格"
)
private
List
<
ImagesDTO
>
imgList
;
@ApiModelProperty
(
value
=
"转发的主题"
)
private
ThemeFormerQo
formerTheme
;
private
LocalDateTime
createTime
;
private
LocalDateTime
updateTime
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/
theme
/CreateCommentReq.java
→
community-api/src/main/java/com/tanpu/community/api/beans/req/
comment
/CreateCommentReq.java
View file @
0b385b67
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
comment
;
import
com.tanpu.community.api.beans.req.theme.ThemeContentReq
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/comment/QueryCommentReq.java
0 → 100644
View file @
0b385b67
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
comment
;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
@ApiModel
(
value
=
"评论查询"
)
@Data
public
class
QueryCommentReq
{
@NotEmpty
(
message
=
"主题id不能为空"
)
@ApiModelProperty
(
value
=
"主题Id"
)
private
String
themeId
;
@NotEmpty
(
message
=
"page不能为空"
)
@ApiModelProperty
(
value
=
"分页"
)
private
Pageable
page
;
}
community-api/src/main/java/com/tanpu/community/api/beans/req/homepage/QueryFollowReq.java
View file @
0b385b67
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
@Data
@ApiModel
(
value
=
"查询关注/粉丝列表"
)
...
...
@@ -19,7 +20,7 @@ public class QueryFollowReq {
@ApiModelProperty
(
value
=
"查询类型,1:粉丝 2:关注"
)
private
Integer
queryType
;
@Not
Empty
(
message
=
"page不能为空"
)
@Not
Null
(
message
=
"page不能为空"
)
@ApiModelProperty
(
value
=
"分页"
)
private
Pageable
page
;
}
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/LikeThemeReq.java
0 → 100644
View file @
0b385b67
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"请求"
)
@Data
public
class
LikeThemeReq
{
@ApiModelProperty
(
value
=
"主题Id"
)
private
String
themeId
;
@ApiModelProperty
(
value
=
"类型,1:点赞 2:取消点赞"
)
private
Integer
type
;
}
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
0b385b67
...
...
@@ -3,8 +3,11 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.theme.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.QueryCommentReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.manager.CommentManager
;
import
com.tanpu.community.util.PageUtils
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -30,13 +33,13 @@ public class CommentController {
}
@ApiOperation
(
"查看评论"
)
@
Ge
tMapping
(
value
=
"/queryComment"
)
@
Pos
tMapping
(
value
=
"/queryComment"
)
@ResponseBody
public
CommonResp
<
List
<
CommentQo
>>
queryComment
(
@RequestParam
String
themeId
){
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@RequestBody
QueryCommentReq
req
){
//todo
String
userId
=
"liujm"
;
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
themeId
,
userId
);
return
CommonResp
.
success
(
result
);
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
()
,
userId
);
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
)
);
}
@ApiOperation
(
"点赞评论"
)
...
...
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
0b385b67
...
...
@@ -5,6 +5,7 @@ import com.tanpu.common.api.CommonResp;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.theme.CreateThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ForwardThemeReq
;
import
com.tanpu.community.api.beans.req.theme.LikeThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ThemeListReq
;
import
com.tanpu.community.manager.ThemeManager
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -66,11 +67,11 @@ public class ThemeController {
@ApiOperation
(
"点赞主题"
)
@
Ge
tMapping
(
value
=
"/like"
)
@
Pos
tMapping
(
value
=
"/like"
)
@ResponseBody
public
CommonResp
likeOnTheme
(
@Request
Param
String
themeId
)
{
public
CommonResp
likeOnTheme
(
@Request
Body
LikeThemeReq
req
)
{
String
user
=
"liujm"
;
themeManager
.
like
(
themeId
,
user
);
themeManager
.
like
(
req
,
user
);
return
CommonResp
.
success
();
}
...
...
community-service/src/main/java/com/tanpu/community/dao/CodeAutoGenerator.java
View file @
0b385b67
...
...
@@ -23,7 +23,7 @@ public class CodeAutoGenerator {
String
mysqlPassword
=
"qimeng123"
;
String
jdbcUrl
=
"jdbc:mysql://47.101.189.151:31931/tamp_community"
;
// String[] tables = new String[]{"follow_rel"};
String
[]
tables
=
new
String
[]{
"
visit_summary
"
,
"black_list"
,
"collection"
,
"comment"
,
"follow_rel"
,
"file_record"
,
"home_page"
,
"theme"
,
"topic"
,
"theme_attachment"
};
String
[]
tables
=
new
String
[]{
"
follow_rel
"
,
"black_list"
,
"collection"
,
"comment"
,
"follow_rel"
,
"file_record"
,
"home_page"
,
"theme"
,
"topic"
,
"theme_attachment"
};
String
basePackage
=
"com.tanpu.community"
;
String
mapperPackage
=
"dao.mapper.community"
;
String
entityPackage
=
"dao.entity.community"
;
...
...
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
0b385b67
...
...
@@ -2,7 +2,7 @@ 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.req.
theme
.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.
comment
.CreateCommentReq
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
0b385b67
...
...
@@ -9,6 +9,7 @@ import com.tanpu.community.api.beans.qo.ThemeQo;
import
com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq
;
import
com.tanpu.community.api.beans.req.theme.CreateThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ForwardThemeReq
;
import
com.tanpu.community.api.beans.req.theme.LikeThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ThemeListReq
;
import
com.tanpu.community.api.beans.vo.feign.CoursePackageDetail
;
import
com.tanpu.community.api.beans.vo.feign.ProductInfoVO
;
...
...
@@ -149,9 +150,15 @@ public class ThemeManager {
return
themeQo
;
}
// 点赞
public
void
like
(
String
themeId
,
String
userId
)
{
collectionService
.
addIfNotExist
(
themeId
,
userId
,
CollectionTypeEnum
.
LIKE_THEME
);
// 点赞/取消点赞
public
void
like
(
LikeThemeReq
req
,
String
userId
)
{
//todo 枚举值
if
(
1
==
req
.
getType
()){
collectionService
.
addIfNotExist
(
req
.
getThemeId
(),
userId
,
CollectionTypeEnum
.
LIKE_THEME
);
}
else
if
(
2
==
req
.
getType
())
{
collectionService
.
delete
(
req
.
getThemeId
(),
userId
,
CollectionTypeEnum
.
LIKE_THEME
);
}
}
public
void
unlike
(
String
themeId
,
String
userId
)
{
...
...
@@ -299,7 +306,7 @@ public class ThemeManager {
feignClientForTanpuroom
.
getShortVideoBaseInfo
(
Arrays
.
asList
(
attachmentIds
));
themeContentQo
.
setDetail
(
AttachmentDetailVo
.
builder
().
shortVideoBaseInfoResp
(
shortVideoBaseInfo
.
getData
().
get
(
0
)).
build
());
}
else
if
(
RelTypeEnum
.
PACKAG
E
.
type
.
equals
(
type
))
{
}
else
if
(
RelTypeEnum
.
NEW_COURSE_WAR
E
.
type
.
equals
(
type
))
{
//课程
String
packageId
=
themeContentQo
.
getValue
();
CommonResp
<
CoursePackageDetail
>
courseIdDetailInfo
=
feignClientForCourse
.
getCoursePackageDetailInfo
(
packageId
);
...
...
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