|
@@ -92,24 +92,24 @@ public class DynamicContentServiceImpl implements DynamicContentService, com.che
|
|
|
|
|
|
@Override
|
|
|
public IPage<DynamicContentDTO> queryPageList(QueryDynamicContentParam param, Integer pageNum,
|
|
|
- Integer pageSize) {
|
|
|
+ Integer pageSize, Long userId) {
|
|
|
String keyWord = param.getKeyWord();
|
|
|
Integer type = param.getType().getValue();
|
|
|
Page<DynamicContentDTO> page = new Page<>(pageNum, pageSize);
|
|
|
IPage<DynamicContentDTO> result = null;
|
|
|
if (Objects.equals(DynamicType.HOTTEST.getValue(), type)) {
|
|
|
- result = baseMapper.queryHot(page, queryHotWrapper(keyWord, param.getUserId()));
|
|
|
+ result = baseMapper.queryHot(page, queryHotWrapper(keyWord, userId));
|
|
|
} /*else if (Objects.equals(DynamicType.ATTENTION.getValue(), type)) {
|
|
|
result = baseMapper
|
|
|
.selectAttention(page, queryAttentionWrapper(keyWord), userId);
|
|
|
} */else if (Objects.equals(DynamicType.LATEST.getValue(), type)) {
|
|
|
result = baseMapper
|
|
|
- .queryAll(page, queryAllWrapper(keyWord, param.getUserId()));
|
|
|
+ .queryAll(page, queryAllWrapper(keyWord, userId));
|
|
|
} else if (Objects.equals(DynamicType.DISCOVER.getValue(), type)) {
|
|
|
result = baseMapper
|
|
|
- .queryRandom(page, queryRandomWrapper(keyWord, param.getUserId()));
|
|
|
+ .queryRandom(page, queryRandomWrapper(keyWord, userId));
|
|
|
}
|
|
|
- return getResult(result, true, param.getUserId());
|
|
|
+ return getResult(result, true, userId);
|
|
|
}
|
|
|
|
|
|
public IPage<DynamicContentDTO> getResult(IPage<DynamicContentDTO> result, boolean b, Long selfUserId) {
|
|
@@ -274,12 +274,11 @@ public class DynamicContentServiceImpl implements DynamicContentService, com.che
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void insertByBo(AddDynamicContentParam param) {
|
|
|
+ public void insertByBo(AddDynamicContentParam param, Long userId) {
|
|
|
addValidEntityBeforeSave(param);
|
|
|
String textContent = param.getTextContent();
|
|
|
DynamicContentType type = param.getType();
|
|
|
DynamicContent contentDynamic = new DynamicContent();
|
|
|
- Long userId = param.getUserId();
|
|
|
contentDynamic.setUserId(userId);
|
|
|
contentDynamic.setTextContent(textContent);
|
|
|
contentDynamic.setType(type.getValue());
|