返回 AiToEarn
short-link.vo.ts
1 import { z } from 'zod'
2
3 // ---------------------------------------------------------------------------
4 // CreateShortLinkOptions
5 // ---------------------------------------------------------------------------
6
7 export const CreateShortLinkOptionsSchema = z.object({
8 originalUrl: z.string().describe('原始 URL'),
9 expiresInSeconds: z.number().optional().describe('过期时间(秒)'),
10 })
11 export interface CreateShortLinkOptions extends z.infer<typeof CreateShortLinkOptionsSchema> {}
12
13 // ---------------------------------------------------------------------------
14 // CreateShortLinkResponse
15 // ---------------------------------------------------------------------------
16
17 export const CreateShortLinkResponseSchema = z.object({
18 shortLink: z.string().describe('短链接'),
19 })
20 export interface CreateShortLinkResponse extends z.infer<typeof CreateShortLinkResponseSchema> {}
21
21 lines TYPESCRIPT