| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import { z } from '@hono/zod-openapi';
- export const SystemConfigSchema = z.object({
- id: z.number().int().positive().openapi({
- description: '系统配置ID',
- example: 1
- }),
- tenantId: z.number().int().positive().openapi({
- description: '租户ID',
- example: 1
- }),
- configKey: z.string().min(1).max(255).openapi({
- description: '配置键',
- example: 'app.login.enabled'
- }),
- configValue: z.string().openapi({
- description: '配置值',
- example: 'true'
- }),
- description: z.string().nullable().openapi({
- description: '配置描述',
- example: '控制小程序登录功能是否开启'
- }),
- createdBy: z.number().int().positive().nullable().openapi({
- description: '创建用户ID',
- example: 1
- }),
- updatedBy: z.number().int().positive().nullable().openapi({
- description: '更新用户ID',
- example: 1
- }),
- createdAt: z.coerce.date().openapi({
- description: '创建时间',
- example: '2023-01-15T10:30:00Z'
- }),
- updatedAt: z.coerce.date().openapi({
- description: '更新时间',
- example: '2023-01-16T14:20:00Z'
- })
- });
- export const CreateSystemConfigSchema = z.object({
- configKey: z.string().min(1).max(255).openapi({
- description: '配置键',
- example: 'app.login.enabled'
- }),
- configValue: z.string().openapi({
- description: '配置值',
- example: 'true'
- }),
- description: z.string().nullable().optional().openapi({
- description: '配置描述',
- example: '控制小程序登录功能是否开启'
- })
- });
- export const UpdateSystemConfigSchema = z.object({
- configKey: z.string().min(1).max(255).optional().openapi({
- description: '配置键',
- example: 'app.login.enabled'
- }),
- configValue: z.string().optional().openapi({
- description: '配置值',
- example: 'false'
- }),
- description: z.string().nullable().optional().openapi({
- description: '配置描述',
- example: '控制小程序登录功能是否开启'
- })
- });
- export const SystemConfigListSchema = z.array(SystemConfigSchema);
|