feat(route): 添加 上海交通大学教务处 面向学生的通知 路由 (#17823)

* feat(route): add `sjtu/jwc/students`

* feat(route/sjtu/jwc): add description for /sjtu/jwc/students
This commit is contained in:
PangBo
2024-12-08 00:21:19 +08:00
committed by GitHub
parent 0d07768955
commit 5c3d6fa348
+18 -14
View File
@@ -4,7 +4,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const urlRoot = 'https://jwc.sjtu.edu.cn/xwtg';
const urlRoot = 'https://jwc.sjtu.edu.cn';
async function getFullArticle(link) {
const response = await got(link).catch(() => null);
@@ -46,9 +46,9 @@ export const route: Route = {
name: '教务处通知公告',
maintainers: ['SeanChao'],
handler,
description: `| 新闻中心 | 通知通告 | 教学运行 | 注册学务 | 研究办 | 教改办 | 综合办 | 语言文字 | 工会与支部 | 通识教育 |
description: `| 新闻中心 | 通知通告 | 教学运行 | 注册学务 | 研究办 | 教改办 | 综合办 | 语言文字 | 工会与支部 | 通识教育 | 面向学生的通知 |
| -------- | -------- | --------- | -------- | ------ | ------ | ------ | -------- | ---------- | -------- |
| news | notice | operation | affairs | yjb | jgb | zhb | language | party | ge |`,
| news | notice | operation | affairs | yjb | jgb | zhb | language | party | ge | students |`,
};
async function handler(ctx) {
@@ -56,48 +56,52 @@ async function handler(ctx) {
const config = {
all: {
section: '通知通告',
link: '/tztg.htm',
link: '/xwtg/tztg.htm',
},
news: {
link: '/xwzx.htm',
link: '/xwtg/xwzx.htm',
section: '新闻中心',
},
notice: {
link: '/tztg.htm',
link: '/xwtg/tztg.htm',
section: '通知通告',
},
operation: {
link: '/jxyx.htm',
link: '/xwtg/jxyx.htm',
section: '教学运行',
},
affairs: {
link: '/zcxw.htm',
link: '/xwtg/zcxw.htm',
section: '注册学务',
},
yjb: {
link: '/yjb.htm',
link: '/xwtg/yjb.htm',
section: '研究办',
},
jgb: {
link: '/jgb.htm',
link: '/xwtg/jgb.htm',
section: '教改办',
},
zhb: {
link: '/zhb.htm',
link: '/xwtg/zhb.htm',
section: '综合办',
},
language: {
link: '/yywz.htm',
link: '/xwtg/yywz.htm',
section: '语言文字',
},
party: {
link: '/ghyzb.htm',
link: '/xwtg/ghyzb.htm',
section: '工会与支部',
},
ge: {
link: '/tsjy.htm',
link: '/xwtg/tsjy.htm',
section: '通识教育',
},
students: {
link: '/index/mxxsdtz.htm',
section: '面向学生的通知',
},
};
const sectionLink = urlRoot + config[type].link;