Files
competition-website/database/seeders/003-seed-news.js
WorkBuddy a303cf2d53 chore: 后端首次基线提交
运行必须源码:app/(controller/model/service/middleware/lib/utils/validate/router)、config/、database/(migrations/seeders/sql)、启动脚本、app/public/templates 模板。
已忽略运行非必须:node_modules/、logs/、run/、app/public 运行时上传数据、.env*、构建/缓存产物。
2026-08-17 12:25:42 +08:00

86 lines
3.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use strict';
module.exports = {
up: async (queryInterface) => {
const now = new Date();
const newsItems = [
{
title: '2026年通信与导航应用技术创新赛线上选拔赛通知',
content: '<p>为深入贯彻落实国家创新驱动发展战略,推动通信与导航技术领域的创新应用,现举办2026年通信与导航应用技术创新赛线上选拔赛。本次比赛面向全国职业院校和高等院校师生,欢迎广大师生踊跃报名参赛。</p>',
publish_time: new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000),
pinned: true,
group: 'all',
created_at: now,
updated_at: now,
},
{
title: '中职组比赛时间安排通知',
content: '<p>中职组线上选拔赛将于2026年7月15日上午9:00准时开始,请各位参赛选手提前做好准备。</p>',
publish_time: new Date(now.getTime() - 25 * 24 * 60 * 60 * 1000),
pinned: false,
group: 'zhongzhi',
created_at: now,
updated_at: now,
},
{
title: '高职组比赛时间安排通知',
content: '<p>高职组线上选拔赛将于2026年7月16日上午9:00准时开始,比赛时长3小时。</p>',
publish_time: new Date(now.getTime() - 25 * 24 * 60 * 60 * 1000),
pinned: false,
group: 'gaozhi',
created_at: now,
updated_at: now,
},
{
title: '本科组作品提交截止日期提醒',
content: '<p>本科组线上选拔赛作品提交截止日期为2026年7月20日23:59。</p>',
publish_time: new Date(now.getTime() - 20 * 24 * 60 * 60 * 1000),
pinned: false,
group: 'benke',
created_at: now,
updated_at: now,
},
{
title: '教师组作品提交截止日期提醒',
content: '<p>教师组线上选拔赛作品提交截止日期为2026年7月20日23:59。</p>',
publish_time: new Date(now.getTime() - 20 * 24 * 60 * 60 * 1000),
pinned: false,
group: 'jiaoshi',
created_at: now,
updated_at: now,
},
{
title: '关于账号激活说明',
content: '<p>各位参赛选手请使用身份证号进行账号激活。激活流程:输入身份证号验证,获取验证码,设置密码。</p>',
publish_time: new Date(now.getTime() - 15 * 24 * 60 * 60 * 1000),
pinned: true,
group: 'all',
created_at: now,
updated_at: now,
},
{
title: '比赛系统操作指南',
content: '<p>为帮助各位选手熟悉比赛系统,请仔细阅读操作指南。中职/高职组在线答题,本科/教师组上传作品。</p>',
publish_time: new Date(now.getTime() - 10 * 24 * 60 * 60 * 1000),
pinned: false,
group: 'all',
created_at: now,
updated_at: now,
},
{
title: '温馨提示:比赛期间注意事项',
content: '<p>为确保比赛顺利进行,请使用Chrome或Edge浏览器最新版本,保持网络稳定,比赛过程中请勿刷新页面。</p>',
publish_time: new Date(now.getTime() - 5 * 24 * 60 * 60 * 1000),
pinned: false,
group: 'all',
created_at: now,
updated_at: now,
},
];
await queryInterface.bulkInsert('news', newsItems, {});
},
down: async (queryInterface) => {
await queryInterface.bulkDelete('news', null, {});
},
};