|
@@ -1,5 +1,5 @@
|
|
|
import { z } from '@hono/zod-openapi';
|
|
import { z } from '@hono/zod-openapi';
|
|
|
-import { DeleteStatus, DisabledStatus } from '@d8d/shared-types';
|
|
|
|
|
|
|
+import { DeleteStatus, DisabledStatus, UserType } from '@d8d/shared-types';
|
|
|
import { RoleSchemaMt } from './role.schema';
|
|
import { RoleSchemaMt } from './role.schema';
|
|
|
import { CompanySchema } from '@d8d/allin-company-module/schemas';
|
|
import { CompanySchema } from '@d8d/allin-company-module/schemas';
|
|
|
|
|
|
|
@@ -35,6 +35,10 @@ export const UserSchemaMt = z.object({
|
|
|
example: 1,
|
|
example: 1,
|
|
|
description: '头像文件ID'
|
|
description: '头像文件ID'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ userType: z.nativeEnum(UserType).default(UserType.ADMIN).openapi({
|
|
|
|
|
+ example: UserType.ADMIN,
|
|
|
|
|
+ description: '用户类型: admin(管理员), employer(企业用户), talent(人才用户)'
|
|
|
|
|
+ }),
|
|
|
avatarFile: z.object({
|
|
avatarFile: z.object({
|
|
|
id: z.number().int().positive().openapi({ description: '文件ID' }),
|
|
id: z.number().int().positive().openapi({ description: '文件ID' }),
|
|
|
name: z.string().max(255).openapi({ description: '文件名', example: 'avatar.jpg' }),
|
|
name: z.string().max(255).openapi({ description: '文件名', example: 'avatar.jpg' }),
|
|
@@ -51,6 +55,17 @@ export const UserSchemaMt = z.object({
|
|
|
company: CompanySchema.nullable().optional().openapi({
|
|
company: CompanySchema.nullable().optional().openapi({
|
|
|
description: '关联的公司信息'
|
|
description: '关联的公司信息'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ personId: z.number().int().positive().nullable().openapi({
|
|
|
|
|
+ example: 1,
|
|
|
|
|
+ description: '残疾人ID,引用disabled_person.person_id'
|
|
|
|
|
+ }),
|
|
|
|
|
+ person: z.object({
|
|
|
|
|
+ id: z.number().int().positive().openapi({ description: '残疾人ID' }),
|
|
|
|
|
+ name: z.string().openapi({ description: '姓名' }),
|
|
|
|
|
+ disabilityId: z.string().openapi({ description: '残疾证号' })
|
|
|
|
|
+ }).nullable().optional().openapi({
|
|
|
|
|
+ description: '关联的残疾人信息'
|
|
|
|
|
+ }),
|
|
|
openid: z.string().max(255).nullable().optional().openapi({
|
|
openid: z.string().max(255).nullable().optional().openapi({
|
|
|
example: 'oABCDEFGH123456789',
|
|
example: 'oABCDEFGH123456789',
|
|
|
description: '微信小程序openid'
|
|
description: '微信小程序openid'
|
|
@@ -119,10 +134,18 @@ export const CreateUserDtoMt = z.object({
|
|
|
example: 1,
|
|
example: 1,
|
|
|
description: '头像文件ID'
|
|
description: '头像文件ID'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ userType: z.nativeEnum(UserType).default(UserType.ADMIN).optional().openapi({
|
|
|
|
|
+ example: UserType.ADMIN,
|
|
|
|
|
+ description: '用户类型: admin(管理员), employer(企业用户), talent(人才用户)'
|
|
|
|
|
+ }),
|
|
|
companyId: z.number().int().positive().nullable().optional().openapi({
|
|
companyId: z.number().int().positive().nullable().optional().openapi({
|
|
|
example: 1,
|
|
example: 1,
|
|
|
description: '公司ID,引用employer_company.company_id'
|
|
description: '公司ID,引用employer_company.company_id'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ personId: z.number().int().positive().nullable().optional().openapi({
|
|
|
|
|
+ example: 1,
|
|
|
|
|
+ description: '残疾人ID,引用disabled_person.person_id'
|
|
|
|
|
+ }),
|
|
|
isDisabled: z.number().int().min(0, '状态值只能是0或1').max(1, '状态值只能是0或1').default(DisabledStatus.ENABLED).optional().openapi({
|
|
isDisabled: z.number().int().min(0, '状态值只能是0或1').max(1, '状态值只能是0或1').default(DisabledStatus.ENABLED).optional().openapi({
|
|
|
example: DisabledStatus.ENABLED,
|
|
example: DisabledStatus.ENABLED,
|
|
|
description: '是否禁用(0:启用,1:禁用)'
|
|
description: '是否禁用(0:启用,1:禁用)'
|
|
@@ -159,10 +182,18 @@ export const UpdateUserDtoMt = z.object({
|
|
|
example: 1,
|
|
example: 1,
|
|
|
description: '头像文件ID'
|
|
description: '头像文件ID'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ userType: z.nativeEnum(UserType).optional().openapi({
|
|
|
|
|
+ example: UserType.ADMIN,
|
|
|
|
|
+ description: '用户类型: admin(管理员), employer(企业用户), talent(人才用户)'
|
|
|
|
|
+ }),
|
|
|
companyId: z.number().int().positive().nullable().optional().openapi({
|
|
companyId: z.number().int().positive().nullable().optional().openapi({
|
|
|
example: 1,
|
|
example: 1,
|
|
|
description: '公司ID,引用employer_company.company_id'
|
|
description: '公司ID,引用employer_company.company_id'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ personId: z.number().int().positive().nullable().optional().openapi({
|
|
|
|
|
+ example: 1,
|
|
|
|
|
+ description: '残疾人ID,引用disabled_person.person_id'
|
|
|
|
|
+ }),
|
|
|
isDisabled: z.number().int().min(0, '状态值只能是0或1').max(1, '状态值只能是0或1').optional().openapi({
|
|
isDisabled: z.number().int().min(0, '状态值只能是0或1').max(1, '状态值只能是0或1').optional().openapi({
|
|
|
example: DisabledStatus.ENABLED,
|
|
example: DisabledStatus.ENABLED,
|
|
|
description: '是否禁用(0:启用,1:禁用)'
|
|
description: '是否禁用(0:启用,1:禁用)'
|