返回 AiToEarn
mockData.ts
1 import { ObjectId } from 'mongodb';
2 import { PlatformAccountGroupStatus } from '../src/db/schema/platform-account-group.schema';
3 import { PlatformStatus, PlatformType } from '../src/db/schema/platform.schema';
4 import { RankingStatus, RankingType } from '../src/db/schema/ranking.schema';
5 import { TaskType } from '../src/db/schema/task.schema';
6
7 export const user = {
8 _id: new ObjectId('6788f154c40f87952b9ed3bf'),
9 name: '测试用户',
10 phone: '13800138000',
11 status: 1,
12 createTime: new Date(),
13 updateTime: new Date(),
14 };
15
16 export const platform = {
17 _id: new ObjectId(),
18 name: 'Mock Platform',
19 type: PlatformType.DOUYIN,
20 description: 'Mock Platform Description',
21 status: PlatformStatus.OPEN,
22 createdAt: new Date(),
23 updatedAt: new Date(),
24 };
25
26 export const platform2 = {
27 _id: new ObjectId(),
28 name: 'Mock Platform 2',
29 type: PlatformType.WECHAT,
30 description: 'Mock Platform 2 Description',
31 status: PlatformStatus.OPEN,
32 createdAt: new Date(),
33 updatedAt: new Date(),
34 };
35
36 export const hotTopics = [
37 {
38 _id: new ObjectId(),
39 platformId: platform._id,
40 platform: PlatformType.DOUYIN,
41 title: 'Hot Topic 1',
42 hotValue: 100,
43 rank: 1,
44 url: 'http://example.com/1',
45 rankChange: 0,
46 isRising: true,
47 hotValueHistory: [],
48 fetchTime: new Date(),
49 },
50 {
51 _id: new ObjectId(),
52 platformId: platform._id,
53 platform: PlatformType.DOUYIN,
54 title: 'Hot Topic 2',
55 hotValue: 90,
56 rank: 2,
57 url: 'http://example.com/2',
58 rankChange: 1,
59 isRising: true,
60 hotValueHistory: [],
61 fetchTime: new Date(),
62 },
63 {
64 _id: new ObjectId(),
65 platformId: platform2._id,
66 platform: PlatformType.WECHAT,
67 title: 'Hot Topic 3',
68 hotValue: 95,
69 rank: 1,
70 url: 'http://example.com/3',
71 rankChange: 0,
72 isRising: false,
73 hotValueHistory: [],
74 fetchTime: new Date(),
75 },
76 ];
77
78 export const ranking = {
79 _id: new ObjectId(),
80 name: 'Mock Ranking',
81 platformId: platform._id,
82 type: RankingType.DAILY,
83 description: 'Mock Ranking Description',
84 status: RankingStatus.OPEN,
85 updateFrequency: '每日12点',
86 createdAt: new Date(),
87 updatedAt: new Date(),
88 };
89
90 export const platformAccountGroup = {
91 _id: new ObjectId(),
92 name: '自有账号',
93 description: '自有账号分组',
94 status: PlatformAccountGroupStatus.OPEN,
95 sort: 1,
96 createTime: new Date(),
97 updateTime: new Date(),
98 };
99
100 export const viralTitles = [
101 {
102 _id: new ObjectId(),
103 platformId: platform._id,
104 category: '美食',
105 title: '这家藏在巷子里的面馆,凌晨三点都在排队',
106 url: 'https://example.com/title1',
107 rank: 1,
108 engagement: 156800,
109 publishTime: new Date('2025-02-15T06:30:00Z'),
110 },
111 {
112 _id: new ObjectId(),
113 platformId: platform._id,
114 category: '美食',
115 title: '自制冰淇淋只需要这3种材料,简单到哭',
116 url: 'https://example.com/title2',
117 rank: 2,
118 engagement: 143200,
119 publishTime: new Date('2025-02-15T07:00:00Z'),
120 },
121 {
122 _id: new ObjectId(),
123 platformId: platform._id,
124 category: '旅游',
125 title: '云南这个小众景点太惊艳了,门票只要10块',
126 url: 'https://example.com/title3',
127 rank: 1,
128 engagement: 198000,
129 publishTime: new Date('2025-02-15T05:45:00Z'),
130 },
131 {
132 _id: new ObjectId(),
133 platformId: platform._id,
134 category: '生活',
135 title: '一个人住也要好好生活,这些家居好物推荐给你',
136 url: 'https://example.com/title4',
137 rank: 1,
138 engagement: 134500,
139 publishTime: new Date('2025-02-15T07:45:00Z'),
140 },
141 ];
142 export const task = {
143 title: '测试任务',
144 type: TaskType.PRODUCT,
145 price: 100,
146 commission: 10,
147 maxRecruits: 5,
148 currentRecruits: 0,
149 deadline: new Date('2025-12-31'),
150 firstTimeBonus: 50,
151 reward: 1000,
152 requiresShoppingCart: true,
153 description: '这是一个测试任务',
154 cooperationRequirements: {
155 batchMaterialPublishing: true,
156 requiresShoppingCart: true,
157 },
158 };
159
159 lines TYPESCRIPT