1.fix fuzzy search

main
Gary 10 months ago
parent 2128ac25b8
commit 9ebc3e91e0

@ -178,6 +178,23 @@ public class JournalController {
return Result.success(journalRespDTO.getImage());
}
@ApiOperation(value = "2.3 获取用户收藏最新2期的期刊封面")
@GetMapping("/collectLatest2Image")
@GlobalInterceptor(checkAppUserLogin = true)
public Result<List<String>> collectLatest2Image(
@RequestHeader(value = "Authorization", required = true) String authorization) {
UserLoginDto user = jwtUtil.getUserLoginDto(authorization);
List<String> objectIds=getCollectLatest2(user.getUserId());
if (CollectionUtils.isEmpty(objectIds)) {
return Result.success(null);
}
return Result.success(journalService.findImageByIds(objectIds));
}
private List<String> getCollectLatest2(String userId) {
return userCollectInfoService.getCollectLatest2(userId, CollectTypeEnum.JOURNAL);
}
private String getCollectLatest(String userId) {
return userCollectInfoService.getCollectLatest(userId, CollectTypeEnum.JOURNAL);
}

@ -288,8 +288,8 @@ public class JournalService {
public List<Journal> fuzzySearch(String keyword, PageRequest pageRequest) {
if(isNumeric(keyword)) {
Journal journal=journalDao.findValidJournalByJournalNo(keyword);
if(isNumeric(keyword)||isNumeric(keyword.replaceFirst("^0*", ""))) {
Journal journal=journalDao.findValidJournalByJournalNo(keyword.replaceFirst("^0*", ""));
if(null!=journal) {
return Arrays.asList(journal);
}

Loading…
Cancel
Save