查询点赞数方法修改

This commit is contained in:
linfeng 2024-03-04 13:09:42 +08:00
parent 0aafc5bf89
commit c152686998
7 changed files with 7 additions and 15 deletions

View File

@ -55,7 +55,7 @@ public class SwaggerConfig implements WebMvcConfigurer {
private ApiInfo apiInfo(){ private ApiInfo apiInfo(){
return new ApiInfoBuilder() return new ApiInfoBuilder()
.title("林风社交论坛开源版接口文档") .title("林风社交论坛开源版接口文档")
.description("林风社交论坛项目开源版接口文档 官网 https://net.linfeng.tech") .description("林风社交论坛项目开源版接口文档 官网https://net.linfeng.tech")
.contact(new Contact("linfeng","http:localhost:8080/doc.html","linfengtech001@163.com")) .contact(new Contact("linfeng","http:localhost:8080/doc.html","linfengtech001@163.com"))
.version(version) .version(version)
.build(); .build();

View File

@ -80,7 +80,6 @@ public class CategoryController {
@ApiOperation("分类修改") @ApiOperation("分类修改")
public R update(@RequestBody CategoryEntity category){ public R update(@RequestBody CategoryEntity category){
categoryService.updateCategory(category); categoryService.updateCategory(category);
return R.ok(); return R.ok();
} }

View File

@ -31,8 +31,6 @@ public interface CommentService extends IService<CommentEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
Integer getCountByTopicId(Integer id);
void deleteByAdmin(List<Long> longs); void deleteByAdmin(List<Long> longs);
Integer getCountByPostId(Integer id); Integer getCountByPostId(Integer id);

View File

@ -64,12 +64,6 @@ public class CommentServiceImpl extends ServiceImpl<CommentDao, CommentEntity> i
return new PageUtils(page); return new PageUtils(page);
} }
@Override
public Integer getCountByTopicId(Integer id) {
return baseMapper.selectCount(new LambdaQueryWrapper<CommentEntity>()
.eq(CommentEntity::getStatus, Constant.COMMENT_NORMAL)
.eq(CommentEntity::getPostId, id));
}
/** /**
@ -94,7 +88,8 @@ public class CommentServiceImpl extends ServiceImpl<CommentDao, CommentEntity> i
public Integer getCountByPostId(Integer id) { public Integer getCountByPostId(Integer id) {
return this.lambdaQuery() return this.lambdaQuery()
.eq(CommentEntity::getStatus, Constant.COMMENT_NORMAL) .eq(CommentEntity::getStatus, Constant.COMMENT_NORMAL)
.eq(CommentEntity::getPostId, id).count(); .eq(CommentEntity::getPostId, id)
.count();
} }
@Override @Override

View File

@ -78,7 +78,7 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
PostListResponse response=new PostListResponse(); PostListResponse response=new PostListResponse();
BeanUtils.copyProperties(l,response); BeanUtils.copyProperties(l,response);
response.setCollectionCount(postCollectionService.collectCount(response.getId())); response.setCollectionCount(postCollectionService.collectCount(response.getId()));
response.setCommentCount(commentService.getCountByTopicId(response.getId())); response.setCommentCount(commentService.getCountByPostId(response.getId()));
response.setUserInfo(appUserService.getById(response.getUid())); response.setUserInfo(appUserService.getById(response.getUid()));
response.setMedia(JsonUtils.JsonToList(l.getMedia())); response.setMedia(JsonUtils.JsonToList(l.getMedia()));
responseList.add(response); responseList.add(response);
@ -286,7 +286,7 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
PostListResponse response=new PostListResponse(); PostListResponse response=new PostListResponse();
BeanUtils.copyProperties(l,response); BeanUtils.copyProperties(l,response);
response.setCollectionCount(postCollectionService.collectCount(response.getId())); response.setCollectionCount(postCollectionService.collectCount(response.getId()));
response.setCommentCount(commentService.getCountByTopicId(response.getId())); response.setCommentCount(commentService.getCountByPostId(response.getId()));
response.setUserInfo(appUserService.getById(response.getUid())); response.setUserInfo(appUserService.getById(response.getUid()));
if (uid==0){ if (uid==0){
response.setIsCollection(false); response.setIsCollection(false);

View File

@ -87,7 +87,7 @@ linfeng:
oss: oss:
# 文件大小用户端和后台管理端 单位M # 文件大小用户端和后台管理端 单位M
max-size: 30 max-size: 30
admin-max-size: 10 admin-max-size: 30
# 是否开启短信验证码 todo # 是否开启短信验证码 todo
sms: sms:

View File

@ -8,6 +8,6 @@
欢迎使用林风社交论坛项目开源版后端服务 欢迎使用林风社交论坛项目开源版后端服务
官网: https://net.linfeng.tech 官网: https://net.linfeng.tech
Copyright (c) 2021-2023 linfeng all rights reserved. Copyright (c) 2021-2024 linfeng all rights reserved.
============================================================================================================================================== ==============================================================================================================================================