|
@@ -1,3 +1,4 @@
|
|
|
|
+import { ApiProperty } from '@nestjs/swagger';
|
|
import {
|
|
import {
|
|
IsNotEmpty,
|
|
IsNotEmpty,
|
|
IsString,
|
|
IsString,
|
|
@@ -11,6 +12,7 @@ export enum ManageType {
|
|
CREATE = 'create',
|
|
CREATE = 'create',
|
|
}
|
|
}
|
|
export class GetPartitionsInfo {
|
|
export class GetPartitionsInfo {
|
|
|
|
+ @ApiProperty()
|
|
@IsString()
|
|
@IsString()
|
|
@IsNotEmpty({
|
|
@IsNotEmpty({
|
|
message: 'collection_name is empty',
|
|
message: 'collection_name is empty',
|
|
@@ -19,29 +21,34 @@ export class GetPartitionsInfo {
|
|
}
|
|
}
|
|
|
|
|
|
export class ManagePartition {
|
|
export class ManagePartition {
|
|
|
|
+ @ApiProperty()
|
|
@IsString()
|
|
@IsString()
|
|
@IsNotEmpty({
|
|
@IsNotEmpty({
|
|
message: 'collection_name is empty',
|
|
message: 'collection_name is empty',
|
|
})
|
|
})
|
|
readonly collection_name: string;
|
|
readonly collection_name: string;
|
|
|
|
|
|
|
|
+ @ApiProperty()
|
|
@IsString()
|
|
@IsString()
|
|
@IsNotEmpty({
|
|
@IsNotEmpty({
|
|
message: 'partition_name is empty',
|
|
message: 'partition_name is empty',
|
|
})
|
|
})
|
|
readonly partition_name: string;
|
|
readonly partition_name: string;
|
|
|
|
|
|
|
|
+ @ApiProperty({ enum: ManageType })
|
|
@IsEnum(ManageType, { message: 'Type allow delete and create' })
|
|
@IsEnum(ManageType, { message: 'Type allow delete and create' })
|
|
readonly type: ManageType;
|
|
readonly type: ManageType;
|
|
}
|
|
}
|
|
|
|
|
|
export class LoadPartitions {
|
|
export class LoadPartitions {
|
|
|
|
+ @ApiProperty()
|
|
@IsString()
|
|
@IsString()
|
|
@IsNotEmpty({
|
|
@IsNotEmpty({
|
|
message: 'collection_name is empty',
|
|
message: 'collection_name is empty',
|
|
})
|
|
})
|
|
readonly collection_name: string;
|
|
readonly collection_name: string;
|
|
|
|
|
|
|
|
+ @ApiProperty()
|
|
@IsArray()
|
|
@IsArray()
|
|
@ArrayNotEmpty()
|
|
@ArrayNotEmpty()
|
|
@IsNotEmpty({
|
|
@IsNotEmpty({
|