Skip to content

Commit

Permalink
fix(route): hpoi params and descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu committed Sep 23, 2024
1 parent 78cf9b3 commit a1ebb67
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/routes/hpoi/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const route: Route = {
example: '/hpoi/items/all',
parameters: {
order: {
description: '排序, 见下表,默认为 add',
description: '排序',
options: [
{ value: 'release', label: '发售' },
{ value: 'add', label: '入库' },
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/hpoi/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const route: Route = {
parameters: {
id: '角色 ID',
order: {
description: '排序, 见下表,默认为 add',
description: '排序',
options: [
{ value: 'release', label: '发售' },
{ value: 'add', label: '入库' },
Expand Down
17 changes: 11 additions & 6 deletions lib/routes/hpoi/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ export const route: Route = {
path: '/info/:type?',
categories: ['anime'],
example: '/hpoi/info/all',
parameters: { type: '分类, 见下表, 默认为`all`' },
parameters: {
type: {
description: '分类',
options: [
{ value: 'all', label: '全部' },
{ value: 'hobby', label: '手办' },
{ value: 'model', label: '模型' },
],
default: 'all',
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
Expand All @@ -19,11 +29,6 @@ export const route: Route = {
name: '情报',
maintainers: ['sanmmm DIYgod'],
handler,
description: `分类
| 全部 | 手办 | 模型 |
| ---- | ----- | ----- |
| all | hobby | model |`,
};

async function handler(ctx) {
Expand Down
20 changes: 16 additions & 4 deletions lib/routes/hpoi/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@ export const route: Route = {
path: '/user/:user_id/:caty',
categories: ['anime'],
example: '/hpoi/user/116297/buy',
parameters: { user_id: '用户ID', caty: '类别, 见下表' },
parameters: {
user_id: {
description: '用户ID',
},
caty: {
description: '类别',
options: [
{ value: 'want', label: '想买' },
{ value: 'preorder', label: '预定' },
{ value: 'buy', label: '已入' },
{ value: 'care', label: '关注' },
{ value: 'resell', label: '有过' },
],
default: 'buy',
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
Expand All @@ -28,9 +43,6 @@ export const route: Route = {
name: '用户动态',
maintainers: ['DIYgod', 'luyuhuang'],
handler,
description: `| 想买 | 预定 | 已入 | 关注 | 有过 |
| ---- | -------- | ---- | ---- | ------ |
| want | preorder | buy | care | resell |`,
};

async function handler(ctx) {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/hpoi/work.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const route: Route = {
parameters: {
id: '作品 ID',
order: {
description: '排序, 见下表,默认为 add',
description: '排序',
options: [
{ value: 'release', label: '发售' },
{ value: 'add', label: '入库' },
Expand Down

0 comments on commit a1ebb67

Please sign in to comment.