Commit 14a1cb5b authored by 刘基明's avatar 刘基明

关注更新条数

parent de422190
...@@ -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;
} }
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;
}
...@@ -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")
......
...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment