diff --git a/lib/routes/ainvest/news.ts b/lib/routes/ainvest/news.ts index cc23dc3b9..ed384c9e0 100644 --- a/lib/routes/ainvest/news.ts +++ b/lib/routes/ainvest/news.ts @@ -1,13 +1,14 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { getHeaders, randomString, decryptAES } from './utils'; export const route: Route = { path: '/news', - categories: ['finance'], + categories: ['finance', 'popular'], example: '/ainvest/news', parameters: {}, + view: ViewType.Articles, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/baidu/gushitong/index.ts b/lib/routes/baidu/gushitong/index.ts index c8bcd175e..452131d24 100644 --- a/lib/routes/baidu/gushitong/index.ts +++ b/lib/routes/baidu/gushitong/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -13,7 +13,8 @@ const STATUS_MAP = { export const route: Route = { path: '/gushitong/index', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Notifications, example: '/baidu/gushitong/index', parameters: {}, features: { diff --git a/lib/routes/bigquant/collections.ts b/lib/routes/bigquant/collections.ts index 2dc716dec..f0a009959 100644 --- a/lib/routes/bigquant/collections.ts +++ b/lib/routes/bigquant/collections.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import MarkdownIt from 'markdown-it'; @@ -8,7 +8,8 @@ const md = MarkdownIt({ export const route: Route = { path: '/collections', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/bigquant/collections', parameters: {}, features: { diff --git a/lib/routes/binance/announcement.ts b/lib/routes/binance/announcement.ts index 5d91c04bf..cf641f760 100644 --- a/lib/routes/binance/announcement.ts +++ b/lib/routes/binance/announcement.ts @@ -1,4 +1,4 @@ -import { DataItem, Route } from '@/types'; +import { DataItem, Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -132,7 +132,8 @@ const handler: Route['handler'] = async (ctx) => { export const route: Route = { path: '/announcement/:type', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/binance/announcement/new-cryptocurrency-listing', parameters: { type: { @@ -154,14 +155,14 @@ export const route: Route = { description: ` Type category - - new-cryptocurrency-listing => New Cryptocurrency Listing - - latest-binance-news => Latest Binance News - - latest-activities => Latest Activities - - new-fiat-listings => New Fiat Listings - - api-updates => API Updates - - crypto-airdrop => Crypto Airdrop - - wallet-maintenance-updates => Wallet Maintenance Updates - - delisting => Delisting + - new-cryptocurrency-listing => New Cryptocurrency Listing + - latest-binance-news => Latest Binance News + - latest-activities => Latest Activities + - new-fiat-listings => New Fiat Listings + - api-updates => API Updates + - crypto-airdrop => Crypto Airdrop + - wallet-maintenance-updates => Wallet Maintenance Updates + - delisting => Delisting `, maintainers: ['enpitsulin'], handler, diff --git a/lib/routes/bitget/announcement.ts b/lib/routes/bitget/announcement.ts index 0ea809b2a..499816a48 100644 --- a/lib/routes/bitget/announcement.ts +++ b/lib/routes/bitget/announcement.ts @@ -1,4 +1,4 @@ -import { DataItem, Route } from '@/types'; +import { DataItem, Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import cache from '@/utils/cache'; @@ -139,7 +139,8 @@ const findTypeLabel = (type: string) => { export const route: Route = { path: '/announcement/:type/:lang?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/bitget/announcement/all/zh-CN', parameters: { type: { diff --git a/lib/routes/bloomberg/authors.ts b/lib/routes/bloomberg/authors.ts index 154f9e02e..6ce5d2689 100644 --- a/lib/routes/bloomberg/authors.ts +++ b/lib/routes/bloomberg/authors.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { load } from 'cheerio'; import got from '@/utils/got'; import rssParser from '@/utils/rss-parser'; @@ -30,7 +30,8 @@ const parseAuthorNewsList = async (slug) => { export const route: Route = { path: '/authors/:id/:slug/:source?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/bloomberg/authors/ARbTQlRLRjE/matthew-s-levine', parameters: { id: 'Author ID, can be found in URL', slug: 'Author Slug, can be found in URL', source: 'Data source, either `api` or `rss`,`api` by default' }, features: { diff --git a/lib/routes/bloomberg/index.ts b/lib/routes/bloomberg/index.ts index 9a0b8d43a..f2d53fb33 100644 --- a/lib/routes/bloomberg/index.ts +++ b/lib/routes/bloomberg/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { rootUrl, asyncPoolAll, parseNewsList, parseArticle } from './utils'; const site_title_mapping = { '/': 'News', @@ -17,10 +17,14 @@ const site_title_mapping = { export const route: Route = { path: '/:site?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/bloomberg/bbiz', parameters: { - site: 'Site ID, can be found below', + site: { + description: 'Site ID, can be found below', + options: Object.keys(site_title_mapping).map((key) => ({ value: key, label: site_title_mapping[key] })), + }, }, features: { requireConfig: false, diff --git a/lib/routes/eastmoney/report/index.ts b/lib/routes/eastmoney/report/index.ts index 2c33e0f7f..3dedde7ef 100644 --- a/lib/routes/eastmoney/report/index.ts +++ b/lib/routes/eastmoney/report/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; import cache from '@/utils/cache'; import got from '@/utils/got'; @@ -12,9 +12,21 @@ const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/report/:category', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/eastmoney/report/strategyreport', - parameters: { category: '研报类型' }, + parameters: { + category: { + description: '研报类型', + options: [ + { value: 'strategyreport', label: '策略报告' }, + { value: 'macresearch', label: '宏观研究' }, + { value: 'brokerreport', label: '券商晨报' }, + { value: 'industry', label: '行业研报' }, + { value: 'stock', label: '个股研报' }, + ], + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/eastmoney/search/index.ts b/lib/routes/eastmoney/search/index.ts index 0ac7f5400..c49c1281d 100644 --- a/lib/routes/eastmoney/search/index.ts +++ b/lib/routes/eastmoney/search/index.ts @@ -1,11 +1,12 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; export const route: Route = { path: '/search/:keyword', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/eastmoney/search/web3', parameters: { keyword: '关键词,可以设置为自己需要检索的关键词' }, features: { diff --git a/lib/routes/eastmoney/ttjj/user.ts b/lib/routes/eastmoney/ttjj/user.ts index 7f11f8857..4f3460f45 100644 --- a/lib/routes/eastmoney/ttjj/user.ts +++ b/lib/routes/eastmoney/ttjj/user.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -6,7 +6,8 @@ import timezone from '@/utils/timezone'; export const route: Route = { path: '/ttjj/user/:uid', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.SocialMedia, example: '/eastmoney/ttjj/user/6551094298949188', parameters: { uid: '用户id, 可以通过天天基金App分享用户主页到浏览器,在相应的URL中找到' }, features: { diff --git a/lib/routes/fastbull/express-news.ts b/lib/routes/fastbull/express-news.ts index 5c1753762..732105595 100644 --- a/lib/routes/fastbull/express-news.ts +++ b/lib/routes/fastbull/express-news.ts @@ -1,11 +1,12 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; export const route: Route = { path: '/express-news', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/fastbull/express-news', parameters: {}, features: { diff --git a/lib/routes/fastbull/news.ts b/lib/routes/fastbull/news.ts index b01082056..1711b3bfb 100644 --- a/lib/routes/fastbull/news.ts +++ b/lib/routes/fastbull/news.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -11,7 +11,8 @@ import path from 'node:path'; export const route: Route = { path: ['/news', '/'], - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/fastbull/news', parameters: {}, features: { diff --git a/lib/routes/finviz/news.ts b/lib/routes/finviz/news.ts index a6068a58b..1599e6eb6 100644 --- a/lib/routes/finviz/news.ts +++ b/lib/routes/finviz/news.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; @@ -12,9 +12,15 @@ const categories = { export const route: Route = { path: '/:category?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/finviz', - parameters: { category: 'Category, see below, News by default' }, + parameters: { + category: { + description: 'Category, see below, News by default', + options: Object.keys(categories).map((key) => ({ value: key, label: key })), + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/followin/index.ts b/lib/routes/followin/index.ts index c2a8fab14..6c47b8bb8 100644 --- a/lib/routes/followin/index.ts +++ b/lib/routes/followin/index.ts @@ -1,13 +1,40 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { apiUrl, favicon, getBParam, getBuildId, getGToken, parseList, parseItem } from './utils'; export const route: Route = { path: '/:categoryId?/:lang?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/followin', - parameters: { categoryId: 'Category ID, see table below, `1` by default', lang: 'Language, see table below, `en` by default' }, + parameters: { + categoryId: { + description: 'Category ID', + options: [ + { value: '1', label: 'For You' }, + { value: '9', label: 'Market' }, + { value: '13', label: 'Meme' }, + { value: '14', label: 'BRC20' }, + { value: '3', label: 'NFT' }, + { value: '5', label: 'Thread' }, + { value: '6', label: 'In-depth' }, + { value: '8', label: 'Tutorials' }, + { value: '11', label: 'Videos' }, + ], + default: '1', + }, + lang: { + description: 'Language', + options: [ + { value: 'en', label: 'English' }, + { value: 'zh-Hans', label: '简体中文' }, + { value: 'zh-Hant', label: '繁體中文' }, + { value: 'vi', label: 'Tiếng Việt' }, + ], + default: 'en', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/followin/news.ts b/lib/routes/followin/news.ts index 76c89b35e..b2905eedf 100644 --- a/lib/routes/followin/news.ts +++ b/lib/routes/followin/news.ts @@ -1,13 +1,25 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { baseUrl, favicon, getBuildId, parseList, parseItem } from './utils'; export const route: Route = { path: '/news/:lang?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/followin/news', - parameters: { lang: 'Language, see table above, `en` by default' }, + parameters: { + lang: { + description: 'Language', + options: [ + { value: 'en', label: 'English' }, + { value: 'zh-Hans', label: '简体中文' }, + { value: 'zh-Hant', label: '繁體中文' }, + { value: 'vi', label: 'Tiếng Việt' }, + ], + default: 'en', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/fx678/kx.ts b/lib/routes/fx678/kx.ts index 55b9bda76..46a957722 100644 --- a/lib/routes/fx678/kx.ts +++ b/lib/routes/fx678/kx.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; @@ -7,7 +7,8 @@ import timezone from '@/utils/timezone'; export const route: Route = { path: '/kx', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Notifications, example: '/fx678/kx', parameters: {}, features: { diff --git a/lib/routes/gelonghui/home.ts b/lib/routes/gelonghui/home.ts index 09066f93a..3b9be27c1 100644 --- a/lib/routes/gelonghui/home.ts +++ b/lib/routes/gelonghui/home.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -6,9 +6,21 @@ import { parseItem } from './utils'; export const route: Route = { path: '/home/:tag?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/gelonghui/home', - parameters: { tag: '分类标签,见下表,默认为 `web_home_page`' }, + parameters: { + tag: { + description: '分类标签,见下表,默认为 `web_home_page`', + options: [ + { value: 'web_home_page', label: '推荐' }, + { value: 'stock', label: '股票' }, + { value: 'fund', label: '基金' }, + { value: 'new_stock', label: '新股' }, + { value: 'research', label: '研报' }, + ], + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/gelonghui/hot-article.ts b/lib/routes/gelonghui/hot-article.ts index a4c4802ad..0abdae684 100644 --- a/lib/routes/gelonghui/hot-article.ts +++ b/lib/routes/gelonghui/hot-article.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -6,9 +6,18 @@ import { parseItem } from './utils'; export const route: Route = { path: '/hot-article/:type?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/gelonghui/hot-article', - parameters: { type: '`day` 为日排行,`week` 为周排行,默认为 `day`' }, + parameters: { + type: { + description: '`day` 为日排行,`week` 为周排行,默认为 `day`', + options: [ + { value: 'day', label: '日排行' }, + { value: 'week', label: '周排行' }, + ], + }, + }, features: { requireConfig: false, requirePuppeteer: false, @@ -24,7 +33,7 @@ export const route: Route = { }, ], name: '最热文章', - maintainers: [], + maintainers: ['nczitzk'], handler, url: 'gelonghui.com/', }; diff --git a/lib/routes/gelonghui/keyword.ts b/lib/routes/gelonghui/keyword.ts index 81fc717da..2016d50ca 100644 --- a/lib/routes/gelonghui/keyword.ts +++ b/lib/routes/gelonghui/keyword.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -6,7 +6,8 @@ import { parseItem } from './utils'; export const route: Route = { path: '/keyword/:keyword', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/gelonghui/keyword/早报', parameters: { keyword: '搜索关键字' }, features: { diff --git a/lib/routes/gelonghui/live.ts b/lib/routes/gelonghui/live.ts index f6f456788..a22c7cdad 100644 --- a/lib/routes/gelonghui/live.ts +++ b/lib/routes/gelonghui/live.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -11,7 +11,8 @@ const baseUrl = 'https://www.gelonghui.com'; export const route: Route = { path: '/live', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/gelonghui/live', parameters: {}, features: { diff --git a/lib/routes/gelonghui/subject.ts b/lib/routes/gelonghui/subject.ts index 0e6cbb814..d47c96b95 100644 --- a/lib/routes/gelonghui/subject.ts +++ b/lib/routes/gelonghui/subject.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -7,7 +7,8 @@ import { parseItem } from './utils'; export const route: Route = { path: '/subject/:id', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/gelonghui/subject/4', parameters: { id: '主题编号,可在主题页 URL 中找到' }, features: { diff --git a/lib/routes/gelonghui/user.ts b/lib/routes/gelonghui/user.ts index 9f1df5660..16473e702 100644 --- a/lib/routes/gelonghui/user.ts +++ b/lib/routes/gelonghui/user.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -6,7 +6,8 @@ import { parseItem } from './utils'; export const route: Route = { path: '/user/:id', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/gelonghui/user/5273', parameters: { id: '用户编号,可在用户页 URL 中找到' }, features: { diff --git a/lib/routes/jin10/index.ts b/lib/routes/jin10/index.ts index 939ddb98f..ff4d02af6 100644 --- a/lib/routes/jin10/index.ts +++ b/lib/routes/jin10/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -12,7 +12,8 @@ import { config } from '@/config'; export const route: Route = { path: '/:important?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Notifications, example: '/jin10', parameters: { important: '只看重要,任意值开启,留空关闭' }, features: { diff --git a/lib/routes/jin10/topic.ts b/lib/routes/jin10/topic.ts index 8d69d9744..73f2b538e 100644 --- a/lib/routes/jin10/topic.ts +++ b/lib/routes/jin10/topic.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -7,7 +7,8 @@ import { config } from '@/config'; export const route: Route = { path: '/topic/:id', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/jin10/topic/396', parameters: { id: 'N' }, features: { diff --git a/lib/routes/jinse/lives.ts b/lib/routes/jinse/lives.ts index ed2cb67a4..11b256a37 100644 --- a/lib/routes/jinse/lives.ts +++ b/lib/routes/jinse/lives.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -19,9 +19,16 @@ const categories = { export const route: Route = { path: '/lives/:category?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Notifications, example: '/jinse/lives', - parameters: { category: '分类,见下表,默认为全部' }, + parameters: { + category: { + description: '分类', + options: Object.entries(categories).map(([value, label]) => ({ value, label })), + default: '0', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/jinse/timeline.ts b/lib/routes/jinse/timeline.ts index ff7532a33..fb48384e0 100644 --- a/lib/routes/jinse/timeline.ts +++ b/lib/routes/jinse/timeline.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -11,9 +11,31 @@ import path from 'node:path'; export const route: Route = { path: '/timeline/:category?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/jinse/timeline', - parameters: { category: '分类,见下表,默认为头条' }, + parameters: { + category: { + description: '分类', + options: [ + { value: '头条', label: '头条' }, + { value: '独家', label: '独家' }, + { value: '铭文', label: '铭文' }, + { value: '产业', label: '产业' }, + { value: '项目', label: '项目' }, + { value: '政策', label: '政策' }, + { value: 'AI', label: 'AI' }, + { value: 'Web 3.0', label: 'Web 3.0' }, + { value: '以太坊 2.0', label: '以太坊 2.0' }, + { value: 'DeFi', label: 'DeFi' }, + { value: 'Layer2', label: 'Layer2' }, + { value: 'NFT', label: 'NFT' }, + { value: 'DAO', label: 'DAO' }, + { value: '百科', label: '百科' }, + ], + default: '头条', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/jiuyangongshe/community.ts b/lib/routes/jiuyangongshe/community.ts index cbbfa1c85..05138854f 100644 --- a/lib/routes/jiuyangongshe/community.ts +++ b/lib/routes/jiuyangongshe/community.ts @@ -1,4 +1,4 @@ -import type { Data, Route } from '@/types'; +import { Data, Route, ViewType } from '@/types'; import type { Context } from 'hono'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -97,6 +97,8 @@ const render = (data) => art(path.join(__dirname, 'templates', 'community-descri export const route: Route = { path: '/community', + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/jiuyangongshe/community', maintainers: ['TonyRL'], name: '社群', diff --git a/lib/routes/laohu8/personal.ts b/lib/routes/laohu8/personal.ts index 697a8a0c3..ad00e46ef 100644 --- a/lib/routes/laohu8/personal.ts +++ b/lib/routes/laohu8/personal.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -8,7 +8,8 @@ const rootUrl = 'https://www.laohu8.com'; export const route: Route = { path: '/personal/:id', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/laohu8/personal/3527667596890271', parameters: { id: '用户 ID,见网址链接' }, features: { diff --git a/lib/routes/mckinsey/cn/index.ts b/lib/routes/mckinsey/cn/index.ts index 2ca561540..a9770fb5c 100644 --- a/lib/routes/mckinsey/cn/index.ts +++ b/lib/routes/mckinsey/cn/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { categories } from './category-map'; @@ -8,9 +8,16 @@ const endpoint = `${baseUrl}/wp-json`; export const route: Route = { path: '/cn/:category?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/mckinsey/cn', - parameters: { category: '分类,见下表,默认为全部' }, + parameters: { + category: { + description: '分类', + options: Object.entries(categories).map(([value, label]) => ({ value, label: label.name })), + default: '25', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/stcn/index.ts b/lib/routes/stcn/index.ts index 162282876..9afab1df5 100644 --- a/lib/routes/stcn/index.ts +++ b/lib/routes/stcn/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -7,9 +7,49 @@ import { parseDate } from '@/utils/parse-date'; export const route: Route = { path: '/:id?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/stcn/yw', - parameters: { id: '栏目 id,见下表,默认为要闻' }, + parameters: { + id: { + description: '栏目 id', + options: [ + { value: 'kx', label: '快讯' }, + { value: 'yw', label: '要闻' }, + { value: 'gs', label: '股市' }, + { value: 'company', label: '公司' }, + { value: 'data', label: '数据' }, + { value: 'fund', label: '基金' }, + { value: 'finance', label: '金融' }, + { value: 'comment', label: '评论' }, + { value: 'cj', label: '产经' }, + { value: 'ct', label: '创投' }, + { value: 'kcb', label: '科创板' }, + { value: 'xsb', label: '新三板' }, + { value: 'tj', label: '投教' }, + { value: 'zk', label: 'ESG' }, + { value: 'gd', label: '滚动' }, + { value: 'gsyl', label: '股市一览' }, + { value: 'djjd', label: '独家解读' }, + { value: 'gsxw', label: '公司新闻' }, + { value: 'gsdt', label: '公司动态' }, + { value: 'djsj', label: '独家数据' }, + { value: 'kd', label: '看点数据' }, + { value: 'zj', label: '资金流向' }, + { value: 'sj_kcb', label: '科创板' }, + { value: 'hq', label: '行情总貌' }, + { value: 'zl', label: '专栏' }, + { value: 'author', label: '作者' }, + { value: 'cjhy', label: '行业' }, + { value: 'cjqc', label: '汽车' }, + { value: 'tjkt', label: '投教课堂' }, + { value: 'zczs', label: '政策知识' }, + { value: 'tjdt', label: '投教动态' }, + { value: 'zthd', label: '专题活动' }, + ], + default: 'yw', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/stockedge/daily-news.ts b/lib/routes/stockedge/daily-news.ts index 9664a566f..e7c88fad5 100644 --- a/lib/routes/stockedge/daily-news.ts +++ b/lib/routes/stockedge/daily-news.ts @@ -1,10 +1,11 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import { getData, getList } from './utils'; export const route: Route = { path: '/daily-updates/news', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Notifications, example: '/stockedge/daily-updates/news', parameters: {}, features: { diff --git a/lib/routes/techflowpost/express.ts b/lib/routes/techflowpost/express.ts index ae5245fd0..9842c94e9 100644 --- a/lib/routes/techflowpost/express.ts +++ b/lib/routes/techflowpost/express.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; @@ -6,7 +6,8 @@ import dayjs from 'dayjs'; export const route: Route = { path: '/express', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/techflowpost/express', radar: [ { diff --git a/lib/routes/techflowpost/index.ts b/lib/routes/techflowpost/index.ts index d98ffa6c1..f9ce49c0b 100644 --- a/lib/routes/techflowpost/index.ts +++ b/lib/routes/techflowpost/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; @@ -12,6 +12,8 @@ export const route: Route = { }, ], name: '首页', + categories: ['finance', 'popular'], + view: ViewType.Articles, maintainers: ['nczitzk'], handler, url: 'techflowpost.com/', diff --git a/lib/routes/theblockbeats/index.ts b/lib/routes/theblockbeats/index.ts index 1fced055b..4fc1112c7 100644 --- a/lib/routes/theblockbeats/index.ts +++ b/lib/routes/theblockbeats/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; @@ -41,9 +41,29 @@ const channelMap = { export const route: Route = { path: '/:channel?/:original?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/theblockbeats/newsflash', - parameters: { channel: '类型,见下表,默认为快讯', original: '文章类型,仅 `channel` 为 `article` 时有效,见下表,留空为全部' }, + parameters: { + channel: { + description: '类型', + options: [ + { value: 'newsflash', label: '快讯' }, + { value: 'article', label: '文章' }, + ], + default: 'newsflash', + }, + original: { + description: '文章类型,仅 `channel` 为 `article` 时有效', + options: [ + { value: '0', label: '全部' }, + { value: '1', label: '深度' }, + { value: '2', label: '精选' }, + { value: '3', label: '热点追踪' }, + ], + default: '0', + }, + }, name: '新闻快讯', maintainers: ['Fatpandac', 'jameshih'], handler, diff --git a/lib/routes/youzhiyouxing/materials.ts b/lib/routes/youzhiyouxing/materials.ts index e71c9abac..879714186 100644 --- a/lib/routes/youzhiyouxing/materials.ts +++ b/lib/routes/youzhiyouxing/materials.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -6,9 +6,24 @@ import { parseDate } from '@/utils/parse-date'; export const route: Route = { path: '/materials/:id?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/youzhiyouxing/materials', - parameters: { id: '分类,见下表,默认为全部' }, + parameters: { + id: { + description: '分类', + options: [ + { value: '0', label: '全部' }, + { value: '4', label: '知行小酒馆' }, + { value: '2', label: '知行黑板报' }, + { value: '10', label: '无人知晓' }, + { value: '1', label: '孟岩专栏' }, + { value: '3', label: '知行读书会' }, + { value: '11', label: '你好,同路人' }, + ], + default: '0', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/zhitongcaijing/index.ts b/lib/routes/zhitongcaijing/index.ts index 9d574bc26..576698c04 100644 --- a/lib/routes/zhitongcaijing/index.ts +++ b/lib/routes/zhitongcaijing/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -70,7 +70,8 @@ const ids = { export const route: Route = { path: '/:id?/:category?', - categories: ['finance'], + categories: ['finance', 'popular'], + view: ViewType.Articles, example: '/zhitongcaijing', parameters: { id: '栏目 id,可在对应栏目页 URL 中找到,默认为 recommend,即推荐', category: '分类 id,可在对应栏目子分类页 URL 中找到,默认为全部' }, features: {