| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import { z } from '@hono/zod-openapi';
- export const SystemConfigSchema = z.object({
- id: 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);
|