后台管理功能补充
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.emotion.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.emotion.dto.request.AiConfigCallStatsRequest;
|
||||
import com.emotion.dto.response.AiConfigCallStatsResponse;
|
||||
import com.emotion.dto.response.AiConfigCallStatsItem;
|
||||
import com.emotion.dto.response.DashboardStatsResponse;
|
||||
import com.emotion.entity.*;
|
||||
import com.emotion.mapper.AiConfigMapper;
|
||||
import com.emotion.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -56,6 +60,9 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
@Autowired
|
||||
private AdminService adminService;
|
||||
|
||||
@Autowired
|
||||
private AiConfigMapper aiConfigMapper;
|
||||
|
||||
@Autowired
|
||||
private AchievementService achievementService;
|
||||
|
||||
@@ -464,6 +471,26 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
return recentLogins;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AiConfigCallStatsResponse getAiConfigCallStats(AiConfigCallStatsRequest request) {
|
||||
Integer limit = request != null ? request.getLimit() : null;
|
||||
if (limit == null) {
|
||||
limit = 20;
|
||||
}
|
||||
// 防御性限制,避免过大查询
|
||||
if (limit > 200) {
|
||||
limit = 200;
|
||||
}
|
||||
if (limit < 1) {
|
||||
limit = 1;
|
||||
}
|
||||
|
||||
List<AiConfigCallStatsItem> items = aiConfigMapper.selectAiConfigCallStats(limit);
|
||||
return AiConfigCallStatsResponse.builder()
|
||||
.items(items)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化时间描述
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user