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
14a1cb5b
Commit
14a1cb5b
authored
Jul 19, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关注更新条数
parent
de422190
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
3 deletions
+50
-3
ReportThemeReq.java
...m/tanpu/community/api/beans/req/theme/ReportThemeReq.java
+0
-2
ThemeSearchReq.java
...m/tanpu/community/api/beans/req/theme/ThemeSearchReq.java
+27
-0
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+10
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+13
-1
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/ReportThemeReq.java
View file @
14a1cb5b
...
@@ -14,8 +14,6 @@ public class ReportThemeReq {
...
@@ -14,8 +14,6 @@ public class ReportThemeReq {
@ApiModelProperty
(
value
=
"举报理由"
)
@ApiModelProperty
(
value
=
"举报理由"
)
private
String
reason
;
private
String
reason
;
@ApiModelProperty
(
value
=
"举报理由"
)
private
String
ident
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/ThemeSearchReq.java
0 → 100644
View file @
14a1cb5b
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
ThemeSearchReq
{
@ApiModelProperty
(
value
=
"搜索关键字"
)
private
String
keyword
;
@ApiModelProperty
(
value
=
"当前浏览的最后一个themeId,可以为空"
)
private
String
lastId
=
""
;
@NotNull
(
message
=
"PageSize不能为空"
)
@ApiModelProperty
(
value
=
"页面大小"
)
private
Integer
pageSize
;
}
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
14a1cb5b
...
@@ -51,6 +51,16 @@ public class ThemeController {
...
@@ -51,6 +51,16 @@ public class ThemeController {
return
CommonResp
.
success
(
result
);
return
CommonResp
.
success
(
result
);
}
}
@AuthLogin
@ApiOperation
(
"主题搜索"
)
@PostMapping
(
value
=
"/search"
)
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
searchInterestList
(
@Validated
@RequestBody
ThemeSearchReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
List
<
ThemeQo
>
result
=
themeManager
.
searchThemes
(
req
,
userId
);
return
CommonResp
.
success
(
result
);
}
@AuthLogin
@AuthLogin
@ApiOperation
(
"主题正文"
)
@ApiOperation
(
"主题正文"
)
@GetMapping
(
value
=
"/detail"
)
@GetMapping
(
value
=
"/detail"
)
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
14a1cb5b
...
@@ -95,7 +95,12 @@ public class ThemeManager {
...
@@ -95,7 +95,12 @@ public class ThemeManager {
return
CreateThemeResp
.
builder
().
themeId
(
themeEntity
.
getThemeId
()).
build
();
return
CreateThemeResp
.
builder
().
themeId
(
themeEntity
.
getThemeId
()).
build
();
}
}
// 返回推荐主题文章
/**
* 返回主题列表
* @param req
* @param userId
* @return
*/
public
List
<
ThemeQo
>
queryThemes
(
ThemeListReq
req
,
String
userId
)
{
public
List
<
ThemeQo
>
queryThemes
(
ThemeListReq
req
,
String
userId
)
{
List
<
ThemeEntity
>
themeEntities
=
new
ArrayList
<>();
List
<
ThemeEntity
>
themeEntities
=
new
ArrayList
<>();
if
(
ThemeListTypeEnum
.
RECOMMEND
.
getCode
().
equals
(
req
.
getType
()))
{
if
(
ThemeListTypeEnum
.
RECOMMEND
.
getCode
().
equals
(
req
.
getType
()))
{
...
@@ -122,6 +127,13 @@ public class ThemeManager {
...
@@ -122,6 +127,13 @@ public class ThemeManager {
return
convertEntityToQo
(
themeEntities
,
userId
);
return
convertEntityToQo
(
themeEntities
,
userId
);
}
}
public
List
<
ThemeQo
>
searchThemes
(
ThemeSearchReq
req
,
String
userId
)
{
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectExcludeUser
(
userId
,
req
.
getLastId
(),
req
.
getPageSize
());
return
convertEntityToQo
(
themeEntities
,
userId
);
}
// 返回用户发布、回复、收藏的主题列表
// 返回用户发布、回复、收藏的主题列表
public
List
<
ThemeQo
>
queryThemesByUser
(
QueryRecordThemeReq
req
,
String
userId
)
{
public
List
<
ThemeQo
>
queryThemesByUser
(
QueryRecordThemeReq
req
,
String
userId
)
{
...
...
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