* 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
23 lines
628 B
JavaScript
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;
|
|
}
|
|
};
|