1.add tag order by condition 2.add thanks interface

main
Gary 9 months ago
parent 848490215e
commit 8748029aeb

@ -22,10 +22,10 @@ public interface TagDao extends JpaRepository<Tag, String>, JpaSpecificationExec
@Query(value = "select * from tb_tag_info where state=1 and parent_id=(select id from tb_tag_info where name_ch='语言' and level=1 limit 1) ", nativeQuery = true)
List<Tag> getLanguageList();
@Query(value = "select * from tb_tag_info where state=1 and is_show=1 and not name_ch='语言' ", nativeQuery = true)
@Query(value = "select * from tb_tag_info where state=1 and is_show=1 and not name_ch='语言' order by create_time", nativeQuery = true)
List<Tag> getStyleList();
@Query(value = "select * from tb_tag_info where state=1 and is_show=1", nativeQuery = true)
@Query(value = "select * from tb_tag_info where state=1 and is_show=1 order by create_time", nativeQuery = true)
List<Tag> getCategoryTags();
@Query(value = "select journal_id,name_ch from tb_journal_tag,tb_tag_info where journal_id in ?1 and tb_journal_tag.tag_id =tb_tag_info.id ;", nativeQuery = true)

@ -346,5 +346,12 @@ public class MyController extends BaseController {
return Result.success(new PageResult<CommentHis>(pageList.getTotalElements(),pageList.getContent()));
}
// 查询我收到的评论
@ApiOperation(value = "11.感谢", notes = "贡献者列表")
@GetMapping("/thanks")
public Result<List<UserRespDTO>> getThanks() {
List<UserRespDTO> list=userInfoService.getThanks().stream().map(user->getUserRespDTO(user, false, Collections.emptySet())).collect(Collectors.toList());
return Result.success(list);
}
}

@ -35,4 +35,7 @@ public interface UserInfoDao extends JpaRepository<UserInfo, String>, JpaSpecifi
@Query(value = "select * from tb_user_info where id = ?1", nativeQuery = true)
public UserInfo getById(String id);
@Query(value = "select * from tb_user_info where badges like '%1%' ", nativeQuery = true)
public List<UserInfo> getThanks();
}

@ -289,4 +289,8 @@ public class UserInfoService {
return updateAvatarPath(userInfoDao.getById(id));
}
public List<UserInfo> getThanks() {
return userInfoDao.getThanks();
}
}

Loading…
Cancel
Save