parent
5e2956da8d
commit
81ed1db029
@ -0,0 +1,9 @@
|
||||
package com.learning.newdemo.service;
|
||||
|
||||
import com.learning.newdemo.entity.DebateHistory;
|
||||
import java.util.List;
|
||||
|
||||
public interface DebateHistoryService {
|
||||
void saveDebateHistory(DebateHistory history);
|
||||
List<DebateHistory> getHistoriesByUser(Integer userId);
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
// DebateHistoryServiceImpl.java
|
||||
package com.learning.newdemo.service.impl;
|
||||
|
||||
import com.learning.newdemo.entity.DebateHistory;
|
||||
import com.learning.newdemo.mapper.DebateHistoryMapper;
|
||||
import com.learning.newdemo.service.DebateHistoryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional
|
||||
public class DebateHistoryServiceImpl implements DebateHistoryService {
|
||||
|
||||
private final DebateHistoryMapper historyMapper;
|
||||
|
||||
@Override
|
||||
public void saveDebateHistory(DebateHistory history) {
|
||||
historyMapper.insert(history);
|
||||
// 清理超出10条的旧记录
|
||||
historyMapper.cleanOverflowHistories(history.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DebateHistory> getHistoriesByUser(Integer userId) {
|
||||
return historyMapper.selectLatestByUserId(userId, 10);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,31 @@
|
||||
#-------------------------------------------------------------------------------#
|
||||
# Qodana analysis is configured by qodana.yaml file #
|
||||
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
|
||||
#-------------------------------------------------------------------------------#
|
||||
version: "1.0"
|
||||
|
||||
#Specify inspection profile for code analysis
|
||||
profile:
|
||||
name: qodana.starter
|
||||
|
||||
#Enable inspections
|
||||
#include:
|
||||
# - name: <SomeEnabledInspectionId>
|
||||
|
||||
#Disable inspections
|
||||
#exclude:
|
||||
# - name: <SomeDisabledInspectionId>
|
||||
# paths:
|
||||
# - <path/where/not/run/inspection>
|
||||
|
||||
projectJDK: 17 #(Applied in CI/CD pipeline)
|
||||
|
||||
#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
|
||||
#bootstrap: sh ./prepare-qodana.sh
|
||||
|
||||
#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
|
||||
#plugins:
|
||||
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
|
||||
|
||||
#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
|
||||
linter: jetbrains/qodana-jvm-community:latest
|
Loading…
Reference in new issue