doc(route): japanpost add multi-language docs (#16092)

This commit is contained in:
tuzi3040 2024-07-05 20:50:00 +08:00 committed by GitHub
parent 68c7430fbb
commit b2abeef5a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 48 additions and 24 deletions

View File

@ -1,6 +1,12 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: 'Japanpost 日本郵便',
name: 'Japanpost',
url: 'trackings.post.japanpost.jp',
zh: {
name: '日本邮政',
},
ja: {
name: '日本郵便',
},
};

View File

@ -0,0 +1,40 @@
import { Route } from '@/types';
import { track } from './track';
export const route: Route = {
name: 'Track & Trace Service',
path: '/track/:reqCode/:locale?',
example: '/japanpost/track/EJ123456789JP/en',
url: 'trackings.post.japanpost.jp/services/srv/search/',
handler: track,
categories: ['other'],
maintainers: ['tuzi3040'],
parameters: {
reqCode: 'Package Number',
locale: 'Language, default to japanese `ja`',
},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportRadar: false, // unsupported due to deprecation of `target` as a function in RSSHub-Radar 2.0.19
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
description: `| Japanese | English |
| -------- | ------- |
| ja | en |`,
zh: {
name: '邮件追踪查询',
description: `| 日语 | 英语 |
| ---- | ---- |
| ja | en |`,
},
ja: {
name: '郵便追跡サービス',
description: `| 日本語 | 英語 |
| ---- | ---- |
| ja | en |`,
},
};

View File

@ -1,4 +1,3 @@
import { Route } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);
@ -11,28 +10,7 @@ import utils from './utils';
let baseTitle = '日本郵便';
const baseUrl = 'https://trackings.post.japanpost.jp/services/srv/search/direct?';
export const route: Route = {
path: '/track/:reqCode/:locale?',
categories: ['other'],
example: '/japanpost/track/EJ123456789JP/en',
parameters: { reqCode: 'Package Number', locale: 'Language, default to japanese `ja`' },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
name: 'Track & Trace Service 郵便追跡サービス',
maintainers: ['tuzi3040'],
handler,
description: `| Japanese | English |
| -------- | ------- |
| ja | en |`,
};
async function handler(ctx) {
export async function track(ctx) {
const reqCode = ctx.req.param('reqCode');
const reqReqCode = 'reqCodeNo1=' + reqCode;