refactor: 删除未使用的代码和注释

- 移除了 CollectionServiceImpl 中的 @Autowired 注解- 删除了 NoteController 中的未使用注释
- 注释掉了 QuestionListItemServiceImpl 中的未使用变量和方法调用
- 移除了 UserServiceImpl 中的未使用变量
This commit is contained in:
LingandRX 2025-05-14 21:18:30 +08:00
parent 5292366899
commit a3fa04596a
4 changed files with 4 additions and 7 deletions

View File

@ -89,7 +89,6 @@ public class NoteController {
/**
* 下载笔记
* @return
*/
@GetMapping("/notes/download")
public ApiResponse<DownloadNoteVO> downloadNote() {

View File

@ -18,7 +18,6 @@ import com.example.copykamanotes.service.CollectionService;
import com.example.copykamanotes.utils.ApiResponseUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

View File

@ -33,10 +33,10 @@ import java.util.Set;
public class QuestionListItemServiceImpl implements QuestionListItemService {
private final QuestionListItemMapper questionListItemMapper;
private final QuestionListMapper questionListMapper;
// private final QuestionListMapper questionListMapper;
private final RequestScopeData requestScopeData;
private final NoteMapper noteMapper;
private final UserMapper userMapper;
// private final UserMapper userMapper;
@Override
public ApiResponse<List<QuestionListItemUserVO>> userGetQuestionListItems(QuestionListItemQueryParams questionListItemQueryParams) {
@ -48,7 +48,7 @@ public class QuestionListItemServiceImpl implements QuestionListItemService {
Integer questionListId = questionListItemQueryParams.getQuestionListId();
QuestionList questionList = questionListMapper.findById(questionListId);
// QuestionList questionList = questionListMapper.findById(questionListId);
List<QuestionListItemVO> questionListItem = questionListItemMapper.findByQuestionListIdPage(questionListId, questionListItemQueryParams.getPageSize(), offset);
List<Integer> questionIds = questionListItem.stream().map(item -> item.getQuestion().getQuestionId()).toList();

View File

@ -43,7 +43,6 @@ public class UserServiceImpl implements UserService {
private final JwtUtil jwtUtil;
private final RequestScopeData requestScopeData;
private final FileService fileService;
private final EmailService emailService;
@Override
@Transactional(rollbackFor = Exception.class)
@ -90,7 +89,7 @@ public class UserServiceImpl implements UserService {
@Override
public ApiResponse<LoginUserVO> login(LoginRequest loginRequest) {
User user = null;
User user;
if (loginRequest.getAccount() != null && !loginRequest.getAccount().isEmpty()) {
user = userMapper.findByAccount(loginRequest.getAccount());