对话接口bug修复及后台管理功能完善

This commit is contained in:
2025-10-31 13:37:15 +08:00
parent 96de58c071
commit e69e9920fe
7 changed files with 1057 additions and 75 deletions
@@ -0,0 +1,168 @@
package com.emotion.dto.response;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* 仪表盘统计数据响应
*
* @author system
* @date 2025-10-31
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "仪表盘统计数据响应")
public class DashboardStatsResponse {
@Schema(description = "用户统计")
private UserStats userStats;
@Schema(description = "内容统计")
private ContentStats contentStats;
@Schema(description = "AI服务统计")
private AiServiceStats aiServiceStats;
@Schema(description = "系统统计")
private SystemStats systemStats;
@Schema(description = "最近活动")
private List<RecentActivity> recentActivities;
@Schema(description = "数据更新时间")
private LocalDateTime updateTime;
/**
* 用户统计
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "用户统计")
public static class UserStats {
@Schema(description = "总用户数")
private Long totalUsers;
@Schema(description = "今日新增用户")
private Long todayNewUsers;
@Schema(description = "活跃用户数")
private Long activeUsers;
@Schema(description = "访客用户数")
private Long guestUsers;
}
/**
* 内容统计
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "内容统计")
public static class ContentStats {
@Schema(description = "总对话数")
private Long totalConversations;
@Schema(description = "总消息数")
private Long totalMessages;
@Schema(description = "日记帖子数")
private Long diaryPosts;
@Schema(description = "社区帖子数")
private Long communityPosts;
@Schema(description = "情绪记录数")
private Long emotionRecords;
}
/**
* AI服务统计
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "AI服务统计")
public static class AiServiceStats {
@Schema(description = "总API调用次数")
private Long totalApiCalls;
@Schema(description = "今日API调用次数")
private Long todayApiCalls;
@Schema(description = "成功调用次数")
private Long successfulCalls;
@Schema(description = "失败调用次数")
private Long failedCalls;
@Schema(description = "平均响应时间(ms)")
private Double avgResponseTime;
@Schema(description = "AI配置数量")
private Long aiConfigCount;
}
/**
* 系统统计
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "系统统计")
public static class SystemStats {
@Schema(description = "管理员数量")
private Long adminCount;
@Schema(description = "成就数量")
private Long achievementCount;
@Schema(description = "奖励数量")
private Long rewardCount;
@Schema(description = "系统运行时间")
private String uptime;
}
/**
* 最近活动
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "最近活动")
public static class RecentActivity {
@Schema(description = "活动类型")
private String type;
@Schema(description = "活动描述")
private String description;
@Schema(description = "用户ID")
private String userId;
@Schema(description = "用户名")
private String username;
@Schema(description = "活动时间")
private LocalDateTime activityTime;
@Schema(description = "额外数据")
private Map<String, Object> extraData;
}
}