1
0

dept.ts 890 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import {
  2. IsInt,
  3. IsNumberString,
  4. ArrayNotEmpty,
  5. IsString,
  6. Min,
  7. IsOptional,
  8. } from 'class-validator';
  9. import { Expose } from 'class-transformer';
  10. export class CreateDeptDto {
  11. @IsString()
  12. @Expose()
  13. departmentName: string;
  14. @IsInt()
  15. @Expose()
  16. parentDepartmentId: number;
  17. @IsOptional()
  18. @IsInt()
  19. @Min(0)
  20. @Expose()
  21. orderNum: number;
  22. }
  23. export class UpdateDeptDto {
  24. @IsInt()
  25. @Expose()
  26. id: number;
  27. @IsString()
  28. @Expose()
  29. name: string;
  30. @IsInt()
  31. @Expose()
  32. parentId: number;
  33. @IsOptional()
  34. @IsInt()
  35. @Min(0)
  36. @Expose()
  37. orderNum: number;
  38. }
  39. export class DeleteDeptDto {
  40. @IsInt()
  41. @Expose()
  42. departmentId: number;
  43. }
  44. export class InfoDeptDto {
  45. @IsNumberString()
  46. @Expose()
  47. departmentId: string;
  48. }
  49. export class TransferDeptDto {
  50. @ArrayNotEmpty()
  51. @Expose()
  52. userIds: number[];
  53. @IsInt()
  54. @Expose()
  55. departmentId: number;
  56. }