/**
|
* @author 韩天尊
|
* @time 2024-01-15
|
* @version 1.0.0
|
* @description 全局类型定义
|
*/
|
|
// API响应接口
|
export interface ApiResponse<T = any> {
|
code: number;
|
msg: string;
|
data: T;
|
}
|
|
// 用户信息接口
|
export interface User {
|
id?: number;
|
name: string;
|
phone?: string;
|
points: number;
|
redeemedPoints: number;
|
totalPoints: number;
|
isVolunteer: boolean;
|
isVerified?: boolean;
|
community?: string;
|
volunteerInfo: any;
|
isAdmin?: boolean; // 是否为管理员
|
}
|
|
// 参与人信息接口
|
export interface VolActivityUser {
|
checkinTime?: string; // 签到时间
|
checkinLocation?: string; // 签到地点
|
checkoutTime?: string; // 签退时间
|
checkoutLocation?: string; // 签退地点
|
earnedPoints?: number; // 获得积分
|
}
|
|
// 活动信息接口
|
export interface Activity {
|
id: number;
|
title: string;
|
time?: string;
|
startTime?: string;
|
endTime?: string;
|
location: string;
|
points: number;
|
status: 'ongoing' | 'upcoming' | 'completed' | string;
|
category: string;
|
categoryDesc?: string;
|
content: string;
|
deadline?: string;
|
maxParticipants: number;
|
currentParticipants: number;
|
img?: string;
|
communityName?: string;
|
subdistrictName?: string;
|
districtName?: string;
|
userStatus?: string; // 报名状态 0-未报名,1-已报名,2-已签到,3-已签退
|
volActivityUser?: VolActivityUser; // 参与人信息
|
fileList?: string[]; // 附件列表
|
}
|
|
// 签到记录接口
|
export interface CheckinRecord {
|
id: number;
|
activityId: number;
|
activityTitle: string;
|
checkinTime: string;
|
checkinLocation: string;
|
checkoutTime?: string;
|
checkoutLocation?: string;
|
status: string;
|
serviceHours?: number;
|
earnedPoints?: number;
|
}
|
|
// 申报记录接口
|
export interface DeclarationRecord {
|
id: number;
|
title?: string;
|
category?: string;
|
categoryDesc?: string;
|
secondary?: string;
|
activityName?: string;
|
time?: string;
|
startTime?: string;
|
endTime?: string;
|
content?: string;
|
points: number;
|
status: 'approved' | 'pending' | 'rejected' | string;
|
isPositive: boolean;
|
serviceHours?: number;
|
reviewComment?: string;
|
type?: string;
|
}
|
|
// 消息接口
|
export interface Message {
|
id: number;
|
title: string;
|
content: string;
|
type: string;
|
isRead: boolean;
|
relatedId?: number;
|
createTime: string;
|
readTime?: string;
|
time?: string;
|
}
|
|
// 积分概览接口
|
export interface PointsOverview {
|
available: number;
|
redeemed: number;
|
total: number;
|
}
|
|
// 社区积分接口
|
export interface CommunityPoints {
|
points: number; // 可用积分
|
redeemedPoints: number; // 已核销积分
|
totalPoints: number; // 总积分
|
communityName: string; // 社区名称
|
communityCode?: string; // 社区编码
|
}
|
|
// 社区积分概览接口
|
export interface CommunityPointsOverview {
|
communityList: CommunityPoints[];
|
}
|
|
// 二维码扫描结果接口
|
export interface QRCodeScanResult {
|
communityCode: string; // 社区编码
|
userId: number; // 用户ID
|
userName: string; // 用户姓名
|
points: number; // 可用积分
|
}
|
|
// 志愿者注册表单接口
|
export interface VolunteerRegisterForm {
|
name: string;
|
idCard: string;
|
phone: string;
|
}
|
|
// 核销记录接口
|
export interface RedemptionRecord {
|
id: number;
|
points: number;
|
description: string;
|
redemptionTime: string;
|
createTime?: string;
|
status: string;
|
productName?: string;
|
productNum?: number;
|
}
|
|
// 管理端统计数据接口
|
export interface AdminDashboardStats {
|
pendingReviews: number;
|
pendingVolunteerApplications: number;
|
ongoingActivities: number;
|
todayCheckins: number;
|
monthlyStats: {
|
newActivities: number;
|
completedActivities: number;
|
totalParticipants: number;
|
totalServiceHours: number;
|
};
|
}
|
|
// 管理端活动统计接口
|
export interface AdminActivityStats {
|
totalActivities: number;
|
completedActivities: number;
|
ongoingActivities: number;
|
upcomingActivities: number;
|
totalParticipants: number;
|
totalServiceHours: number;
|
}
|
|
// 管理端积分统计接口
|
export interface AdminPointsStats {
|
totalAwarded: number;
|
totalRedeemed: number;
|
pendingReviews: number;
|
approvedToday: number;
|
rejectedToday: number;
|
}
|
|
// 管理端活动接口
|
export interface AdminActivity {
|
id: number;
|
title: string;
|
startTime: string;
|
endTime: string;
|
location: string;
|
participants: number;
|
status: string;
|
category: string;
|
categoryDesc: string;
|
img: string;
|
maxParticipants: number;
|
points: number;
|
fileList?: string[]; // 附件列表
|
}
|
|
// 管理端活动详情接口
|
export interface AdminActivityDetail {
|
id: number;
|
title: string;
|
startTime: string;
|
endTime: string;
|
location: string;
|
participants: Array<{
|
id: number;
|
userName: string;
|
userPhone: string;
|
status: string; // '报名状态 1-已报名,2-已签到,3-已签退'
|
checkinLocation: string;
|
checkoutLocation: string;
|
checkinTime?: string;
|
checkoutTime?: string;
|
serviceHours?: number;
|
}>;
|
status: string;
|
category: string;
|
categoryDesc: string;
|
img: string;
|
maxParticipants: number;
|
points: number;
|
content: string;
|
currentParticipants: number;
|
deadline: string;
|
fileList?: string[]; // 附件列表
|
}
|
|
// 管理端积分审核记录接口
|
export interface AdminPointsReviewRecord {
|
id: number;
|
userName: string;
|
activityTitle: string;
|
points: number;
|
secondary: string;
|
status: string;
|
createTime: string;
|
category: string;
|
categoryDesc: string;
|
serviceHours: number;
|
expectedPoints: number;
|
}
|
|
// 管理端积分审核详情接口
|
export interface AdminPointsReviewDetail extends AdminPointsReviewRecord {
|
phone: string;
|
fileList: string[];
|
reviewTime?: string;
|
reviewComment?: string;
|
}
|
|
// 管理端志愿者审核记录接口
|
export interface AdminVolunteerReviewRecord {
|
id: number;
|
name: string;
|
phone: string;
|
idCard: string;
|
community: string;
|
status: string;
|
submitTime: string;
|
createTime: string;
|
}
|
|
// 管理端志愿者审核详情接口
|
export interface AdminVolunteerReviewDetail extends AdminVolunteerReviewRecord {
|
fileList: string[];
|
reviewTime?: string;
|
reviewComment?: string;
|
}
|
|
// 管理端用户接口
|
export interface AdminUser {
|
id: number;
|
name: string;
|
phone: string;
|
community: string;
|
isVolunteer: boolean;
|
totalPoints: number;
|
availablePoints: number;
|
redeemedPoints: number;
|
totalServiceHours: number;
|
joinTime: string;
|
}
|
|
// 管理端用户详情接口
|
export interface AdminUserDetail extends AdminUser {
|
idCard: string;
|
activities: Array<{
|
id: number;
|
title: string;
|
joinTime: string;
|
serviceHours: number;
|
points: number;
|
}>;
|
}
|
|
// 管理端核销记录接口
|
export interface AdminRedemptionRecord {
|
id: number;
|
userName: string;
|
points: number;
|
productName: string;
|
productNum: number;
|
description: string;
|
redemptionTime: string;
|
operator: string;
|
}
|
|
// 文件上传响应接口
|
export interface FileUploadResponse {
|
id: string;
|
name: string;
|
trueName: string;
|
suffix: string;
|
type: string;
|
fileSize: number;
|
unit: string;
|
showUrl: string;
|
downUrl: string;
|
zipUrl: string;
|
ownerId: string;
|
ownerType: number;
|
ownerTypeName: string;
|
createTime: string;
|
}
|