- wechat-miniprogram: 原生小程序,品牌化拆约+玄龙logo,API 指向 https://xhermes.aibay.asia - yaoyue-sever: Express 单文件 server.js + better-sqlite3,GLM glm-5.3-flash(thinking disabled) - 排除 node_modules/.env/*.db
175 lines
2.7 KiB
JavaScript
175 lines
2.7 KiB
JavaScript
// types/index.js - 类型定义
|
|
|
|
// 用户相关类型
|
|
const UserProfile = {
|
|
id: '',
|
|
openid: '',
|
|
nickname: '',
|
|
avatarUrl: '',
|
|
phone: '',
|
|
companies: [],
|
|
position: '',
|
|
industry: '',
|
|
hometown: '',
|
|
email: '',
|
|
expertise: '',
|
|
createdAt: '',
|
|
updatedAt: '',
|
|
};
|
|
|
|
// 用户统计
|
|
const UserStats = {
|
|
createdCount: 0,
|
|
joinedCount: 0,
|
|
};
|
|
|
|
// 活动相关类型
|
|
const Activity = {
|
|
id: '',
|
|
creatorId: '',
|
|
creator: null,
|
|
title: '',
|
|
coverUrl: '',
|
|
description: '',
|
|
location: '',
|
|
startTime: '',
|
|
duration: 0,
|
|
maxParticipants: 0,
|
|
tags: [],
|
|
checkinEnabled: false,
|
|
status: 'active',
|
|
participantCount: 0,
|
|
isJoined: false,
|
|
isCreator: false,
|
|
createdAt: '',
|
|
updatedAt: '',
|
|
};
|
|
|
|
// 活动参与者
|
|
const ActivityParticipant = {
|
|
id: '',
|
|
activityId: '',
|
|
userId: '',
|
|
user: null,
|
|
status: 'joined',
|
|
joinedAt: '',
|
|
checkedInAt: '',
|
|
};
|
|
|
|
// 活动详情
|
|
const ActivityDetail = {
|
|
...Activity,
|
|
participants: [],
|
|
images: [],
|
|
};
|
|
|
|
// API 响应类型
|
|
const ApiResponse = (data) => ({
|
|
success: false,
|
|
data: data,
|
|
message: '',
|
|
});
|
|
|
|
// 分页响应
|
|
const PaginatedResponse = (list, total, page, pageSize) => ({
|
|
list,
|
|
total,
|
|
page,
|
|
pageSize,
|
|
});
|
|
|
|
// Tab 类型
|
|
const ActivityTab = ['latest', 'joined', 'created'];
|
|
|
|
// 签到状态类型
|
|
const CheckinStatusType = ['not_started', 'can_checkin', 'expired', 'already_checked_in'];
|
|
|
|
// 签到状态响应
|
|
const CheckinStatusResponse = {
|
|
activity: {
|
|
id: '',
|
|
title: '',
|
|
location: '',
|
|
startTime: '',
|
|
duration: 0,
|
|
endTime: '',
|
|
timeDisplay: '',
|
|
},
|
|
status: 'not_started',
|
|
checkinWindow: {
|
|
start: '',
|
|
end: '',
|
|
},
|
|
countdown: {
|
|
days: 0,
|
|
hours: 0,
|
|
minutes: 0,
|
|
},
|
|
participant: {
|
|
status: 'joined',
|
|
joinedAt: '',
|
|
checkedInAt: '',
|
|
},
|
|
};
|
|
|
|
// AI 推荐
|
|
const AIRecommendation = {
|
|
participants: [],
|
|
suggestions: '',
|
|
isLoading: false,
|
|
};
|
|
|
|
// 问卷配置
|
|
const SurveyConfig = {
|
|
id: '',
|
|
title: '',
|
|
subtitle: '',
|
|
description: '',
|
|
linkUrl: '',
|
|
bannerImage: '',
|
|
isActive: false,
|
|
};
|
|
|
|
// 表单类型
|
|
const ProfileForm = {
|
|
nickname: '',
|
|
avatarUrl: '',
|
|
phone: '',
|
|
companies: [],
|
|
position: '',
|
|
industry: '',
|
|
hometown: '',
|
|
email: '',
|
|
expertise: '',
|
|
};
|
|
|
|
const CreateActivityForm = {
|
|
title: '',
|
|
coverUrl: '',
|
|
description: '',
|
|
location: '',
|
|
date: '',
|
|
startTime: '',
|
|
duration: 0,
|
|
maxParticipants: 0,
|
|
tags: [],
|
|
checkinEnabled: false,
|
|
};
|
|
|
|
module.exports = {
|
|
UserProfile,
|
|
UserStats,
|
|
Activity,
|
|
ActivityParticipant,
|
|
ActivityDetail,
|
|
ApiResponse,
|
|
PaginatedResponse,
|
|
ActivityTab,
|
|
CheckinStatusType,
|
|
CheckinStatusResponse,
|
|
AIRecommendation,
|
|
SurveyConfig,
|
|
ProfileForm,
|
|
CreateActivityForm,
|
|
};
|