save-organazation.dto.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * @Author: 白雾茫茫丶<baiwumm.com>
  3. * @Date: 2024-07-10 13:39:42
  4. * @LastEditors: 白雾茫茫丶<baiwumm.com>
  5. * @LastEditTime: 2024-08-22 11:40:09
  6. * @Description: 保存组织数据 Dto
  7. */
  8. import { ApiProperty } from '@nestjs/swagger';
  9. import { IsNotEmpty, IsNumber, IsOptional, IsUUID } from 'class-validator';
  10. export class SaveOrganazationDto {
  11. @ApiProperty({
  12. type: String,
  13. description: '父级id',
  14. default: '0c01ef7d-2f6f-440a-b642-62564d41f473',
  15. required: false,
  16. })
  17. @IsOptional()
  18. @IsUUID('all', { message: 'parentId 参数不正确' })
  19. parentId?: string;
  20. @ApiProperty({
  21. type: String,
  22. description: '组织名称',
  23. default: '阿里巴巴',
  24. })
  25. @IsNotEmpty({ message: '组织名称必填' })
  26. name: string;
  27. @ApiProperty({
  28. type: String,
  29. description: '组织编码',
  30. default: 'Alibaba',
  31. })
  32. @IsNotEmpty({ message: '组织岗位必填' })
  33. code: string;
  34. @ApiProperty({
  35. type: Number,
  36. description: '排序',
  37. default: 1,
  38. })
  39. @IsNumber(
  40. {},
  41. {
  42. message: '排序必须为数字',
  43. },
  44. )
  45. sort: number;
  46. @ApiProperty({
  47. type: String,
  48. description: '组织描述',
  49. required: false,
  50. default: '阿里巴巴集团控股有限公司(简称:阿里巴巴集团)是马云带领下的18位创始人于1999年在浙江省杭州市创立的公司。',
  51. })
  52. description?: string;
  53. }