|
|
@ -1,10 +1,8 @@
|
|
|
|
package com.luoo.music.controller;
|
|
|
|
package com.luoo.music.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
@ -29,8 +27,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
import com.luoo.music.pojo.Journal;
|
|
|
|
import com.luoo.music.pojo.Journal;
|
|
|
|
import com.luoo.music.pojo.Tag;
|
|
|
|
import com.luoo.music.pojo.Tag;
|
|
|
|
import com.luoo.music.service.JournalService;
|
|
|
|
import com.luoo.music.service.JournalService;
|
|
|
|
import com.luoo.music.service.SongInfoService;
|
|
|
|
|
|
|
|
import com.luoo.music.service.TagService;
|
|
|
|
|
|
|
|
import com.luoo.music.service.UserCollectInfoService;
|
|
|
|
import com.luoo.music.service.UserCollectInfoService;
|
|
|
|
import annotation.GlobalInterceptor;
|
|
|
|
import annotation.GlobalInterceptor;
|
|
|
|
import annotation.VerifyParam;
|
|
|
|
import annotation.VerifyParam;
|
|
|
@ -41,7 +37,6 @@ import constants.Constants;
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
import enums.CollectTypeEnum;
|
|
|
|
import enums.CollectTypeEnum;
|
|
|
|
import util.JwtUtil;
|
|
|
|
import util.JwtUtil;
|
|
|
|
import util.StringTools;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 控制器层
|
|
|
|
* 控制器层
|
|
|
@ -63,9 +58,6 @@ public class JournalController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SongController songController;
|
|
|
|
private SongController songController;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private TagService tagService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private JwtUtil jwtUtil;
|
|
|
|
private JwtUtil jwtUtil;
|
|
|
|
|
|
|
|
|
|
|
@ -78,9 +70,6 @@ public class JournalController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private RedisTemplate redisTemplate;
|
|
|
|
private RedisTemplate redisTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
private static final int JOURNAL_FILTER_NUMBER_RANGE=100;
|
|
|
|
|
|
|
|
private static final Map<String,JournalRespDTO> journalRespDTOMap=new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "1.查询期刊信息", notes = "若authorization为空或authorization校验失败,默认返回最新的10期,期刊筛选条件对游客不可用")
|
|
|
|
@ApiOperation(value = "1.查询期刊信息", notes = "若authorization为空或authorization校验失败,默认返回最新的10期,期刊筛选条件对游客不可用")
|
|
|
|
@GetMapping("/list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
@GlobalInterceptor
|
|
|
|
@GlobalInterceptor
|
|
|
@ -230,12 +219,7 @@ public class JournalController {
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
public Result<JournalFilterDTO> getFilterList(
|
|
|
|
public Result<JournalFilterDTO> getFilterList(
|
|
|
|
@RequestHeader(value = "Authorization", required = false) String authorization) {
|
|
|
|
@RequestHeader(value = "Authorization", required = false) String authorization) {
|
|
|
|
JournalFilterDTO journalFilterDTO=new JournalFilterDTO();
|
|
|
|
return Result.success(journalService.getJournalFilterDTO());
|
|
|
|
journalFilterDTO.setJournalNoList(journalService.getJournalNoList(JOURNAL_FILTER_NUMBER_RANGE));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
journalFilterDTO.setLanguageList(tagService.getLanguageList().stream().map(this::getTagDTO).collect(Collectors.toList()));
|
|
|
|
|
|
|
|
journalFilterDTO.setStyleList(tagService.getStyleList().stream().map(this::getTagDTO).collect(Collectors.toList()));
|
|
|
|
|
|
|
|
return Result.success(journalFilterDTO);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "5.根据当前期刊的标签推荐6期类似期刊")
|
|
|
|
@ApiOperation(value = "5.根据当前期刊的标签推荐6期类似期刊")
|
|
|
@ -259,12 +243,7 @@ public class JournalController {
|
|
|
|
return Result.success(list);
|
|
|
|
return Result.success(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private TagDTO getTagDTO(Tag tag) {
|
|
|
|
|
|
|
|
TagDTO tagDTO=new TagDTO();
|
|
|
|
|
|
|
|
tagDTO.setName(tag.getNameCh());
|
|
|
|
|
|
|
|
tagDTO.setId(tag.getId());
|
|
|
|
|
|
|
|
return tagDTO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "统计期刊的浏览数", notes = "APP端打开期刊调用一次统计接口")
|
|
|
|
@ApiOperation(value = "统计期刊的浏览数", notes = "APP端打开期刊调用一次统计接口")
|
|
|
|
@RequestMapping(value="/stat/visits/{id}", method= RequestMethod.PUT)
|
|
|
|
@RequestMapping(value="/stat/visits/{id}", method= RequestMethod.PUT)
|
|
|
|
public Result statVisitsCount(@ApiParam(value = "期刊ID", required = true) @PathVariable String id) {
|
|
|
|
public Result statVisitsCount(@ApiParam(value = "期刊ID", required = true) @PathVariable String id) {
|
|
|
|