refactor: 回忆改用独立存储与请求响应 DTO,服务按域拆包
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.guo.learningprogresstracker.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.guo.learningprogresstracker.entity.ReviewRecallEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ReviewRecallMapper extends BaseMapper<ReviewRecallEntity> {
|
||||
@com.baomidou.mybatisplus.annotation.InterceptorIgnore(tenantLine = "true")
|
||||
@org.apache.ibatis.annotations.Insert("INSERT IGNORE INTO review_recall_owner_locks (owner_id) VALUES (#{userId})")
|
||||
int ensureOwnerLock(@org.apache.ibatis.annotations.Param("userId") String userId);
|
||||
|
||||
// Dedicated lock row, not a login/session mutation. Explicit owner id prevents cross-user locking.
|
||||
@com.baomidou.mybatisplus.annotation.InterceptorIgnore(tenantLine = "true")
|
||||
@org.apache.ibatis.annotations.Select(
|
||||
"SELECT owner_id FROM review_recall_owner_locks WHERE owner_id = #{userId} FOR UPDATE")
|
||||
String lockUser(@org.apache.ibatis.annotations.Param("userId") String userId);
|
||||
|
||||
@org.apache.ibatis.annotations.Select(
|
||||
"SELECT task_num, SUM(active_duration_ms) AS active_duration_ms FROM review_recalls WHERE deleted = 0 AND"
|
||||
+ " scope_type = 'TASK' GROUP BY task_num")
|
||||
@org.apache.ibatis.annotations.Results(
|
||||
id = "taskRecallDuration",
|
||||
value = {
|
||||
@org.apache.ibatis.annotations.Result(column = "task_num", property = "taskNum"),
|
||||
@org.apache.ibatis.annotations.Result(column = "active_duration_ms", property = "activeDurationMs")
|
||||
})
|
||||
java.util.List<com.guo.learningprogresstracker.dto.recall.TaskRecallDuration> sumTaskDuration();
|
||||
}
|
||||
Reference in New Issue
Block a user