Files
RSSHub/lib/v2/showstart/params.js
T
lchtao26 bb589044a0 feat(route/秀动网): add '/params' route for route params look up, add more detail into '/event' feed item description (#13879)
* change '/search/:keyword' to optional

* feat: add more info to description

* feat: add '/params/city' and '/params/style' for params look up

reason for adding this route:

it's hard to find route params in url, expecially in mobile mode, the
wap.showstasrt.com website url doesn't match the shows city and style

* chore: implement sortBy and uniqBy

* chore: move sortBy, uniqBy to utils
2023-11-25 01:05:35 +08:00

23 lines
628 B
JavaScript

const { TITLE, HOST } = require('./const');
const { fetchCityList, fetchStyleList } = require('./service');
module.exports = async (ctx) => {
const type = ctx.params.type;
switch (type) {
case 'city':
ctx.state.data = {
title: `${TITLE} - 演出城市`,
link: `HOST`,
item: await fetchCityList(),
};
break;
case 'style':
ctx.state.data = {
title: `${TITLE} - 演出风格`,
link: HOST,
item: await fetchStyleList(),
};
break;
}
};