-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
160 changed files
with
1,333 additions
and
1,172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
import { ArgsType } from '@nestjs/graphql'; | ||
|
||
@ArgsType() | ||
export class ItemArgs {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
import { ArgsType, Field, Int } from '@nestjs/graphql'; | ||
|
||
export type IOrderSort = 'ASC' | 'DESC' | undefined; | ||
|
||
@ArgsType() | ||
export class ItemsArgs { | ||
@Field(() => Int, { nullable: true, defaultValue: 1 }) | ||
page?: number = 1; | ||
|
||
@Field(() => Int, { nullable: true, defaultValue: 30 }) | ||
pageSize?: number = 30; | ||
|
||
@Field(() => String, { nullable: true, defaultValue: 'id' }) | ||
orderBy?: string = 'id'; | ||
|
||
@Field(() => String, { nullable: true, defaultValue: 'DESC' }) | ||
orderSort?: IOrderSort = 'DESC'; | ||
|
||
// q -> query -> keyword | ||
@Field(() => String, { nullable: true }) | ||
|
||
q?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
import { ObjectType, Field, Int } from '@nestjs/graphql'; | ||
|
||
@ObjectType() | ||
export class PaginationObject { | ||
@Field(() => Int, { nullable: true }) | ||
readonly page!: number; | ||
|
||
@Field(() => Int) | ||
readonly pageSize!: number; | ||
|
||
@Field(() => Int, { nullable: true }) | ||
readonly nextPage?: number | null; | ||
|
||
@Field(() => Int) | ||
readonly itemsCount?: number; | ||
|
||
@Field(() => Int) | ||
readonly total!: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { ArgsType } from '@nestjs/graphql'; | ||
|
||
import { ItemArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class ActionArgs extends ItemArgs {} |
4 changes: 0 additions & 4 deletions
4
packages/_leaa-common/src/dtos/action/actions-with-pagination.object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import { ObjectType, Field } from '@nestjs/graphql'; | ||
|
||
import { Action } from '@leaa/common/src/entrys'; | ||
import { PaginationObject } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ObjectType() | ||
export class ActionsWithPaginationObject extends PaginationObject { | ||
@Field(() => [Action]) | ||
readonly items: Action[] = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import { ArgsType, Field } from '@nestjs/graphql'; | ||
|
||
import { ItemsArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class ActionsArgs extends ItemsArgs { | ||
@Field(() => String, { nullable: true }) | ||
tagName?: string; | ||
|
||
@Field(() => String, { nullable: true }) | ||
categoryName?: string; | ||
|
||
@Field(() => String, { nullable: true }) | ||
categoryId?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
import { IsNotEmpty, IsOptional } from 'class-validator'; | ||
import { Field, InputType } from '@nestjs/graphql'; | ||
|
||
@InputType() | ||
export class CreateActionInput { | ||
@IsNotEmpty() | ||
@Field(() => String, { nullable: true }) | ||
ip?: string; | ||
|
||
@IsNotEmpty() | ||
@Field(() => String) | ||
module!: string; | ||
|
||
@IsOptional() | ||
@Field(() => String) | ||
action?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
account?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
token?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
user_id?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
diff?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
import { IsOptional } from 'class-validator'; | ||
import { Field, InputType } from '@nestjs/graphql'; | ||
|
||
@InputType() | ||
export class UpdateActionInput { | ||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
account?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
user_id?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
diff?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { ArgsType } from '@nestjs/graphql'; | ||
|
||
import { ItemArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class AddressArgs extends ItemArgs {} |
4 changes: 0 additions & 4 deletions
4
packages/_leaa-common/src/dtos/address/addresses-with-pagination.object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import { ObjectType, Field } from '@nestjs/graphql'; | ||
|
||
import { Address } from '@leaa/common/src/entrys'; | ||
import { PaginationObject } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ObjectType() | ||
export class AddressesWithPaginationObject extends PaginationObject { | ||
@Field(() => [Address]) | ||
readonly items: Address[] = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { ArgsType } from '@nestjs/graphql'; | ||
|
||
import { ItemsArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class AddressesArgs extends ItemsArgs {} |
10 changes: 0 additions & 10 deletions
10
packages/_leaa-common/src/dtos/address/create-address.input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,27 @@ | ||
import { IsNotEmpty, IsOptional } from 'class-validator'; | ||
import { Field, InputType, Int } from '@nestjs/graphql'; | ||
|
||
@InputType() | ||
export class CreateAddressInput { | ||
@IsNotEmpty() | ||
@Field(() => String) | ||
address!: string; | ||
|
||
@IsNotEmpty() | ||
@Field(() => String) | ||
province!: string; | ||
|
||
@IsNotEmpty() | ||
@Field(() => String) | ||
city!: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
area?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
consignee!: string; | ||
|
||
@IsOptional() | ||
@Field(() => Int, { nullable: true }) | ||
zip?: number; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
phone?: string; | ||
|
||
@IsOptional() | ||
@Field(() => Int, { nullable: true }) | ||
status?: number; | ||
} |
10 changes: 0 additions & 10 deletions
10
packages/_leaa-common/src/dtos/address/update-address.input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,27 @@ | ||
import { IsOptional } from 'class-validator'; | ||
import { Field, InputType, Int } from '@nestjs/graphql'; | ||
|
||
@InputType() | ||
export class UpdateAddressInput { | ||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
address?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
province?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
city?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
area?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
consignee?: string; | ||
|
||
@IsOptional() | ||
@Field(() => Int, { nullable: true }) | ||
zip?: number; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
phone?: string; | ||
|
||
@IsOptional() | ||
@Field(() => Int, { nullable: true }) | ||
status?: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { ArgsType } from '@nestjs/graphql'; | ||
|
||
import { ItemArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class ArticleArgs extends ItemArgs {} |
4 changes: 0 additions & 4 deletions
4
packages/_leaa-common/src/dtos/article/articles-with-pagination.object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import { ObjectType, Field } from '@nestjs/graphql'; | ||
|
||
import { Article } from '@leaa/common/src/entrys'; | ||
import { PaginationObject } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ObjectType() | ||
export class ArticlesWithPaginationObject extends PaginationObject { | ||
@Field(() => [Article]) | ||
readonly items: Article[] = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import { ArgsType, Field, Int } from '@nestjs/graphql'; | ||
|
||
import { ItemsArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class ArticlesArgs extends ItemsArgs { | ||
@Field(() => String, { nullable: true }) | ||
tagName?: string; | ||
|
||
@Field(() => String, { nullable: true }) | ||
categoryName?: string; | ||
|
||
@Field(() => String, { nullable: true }) | ||
categoryId?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { ArgsType } from '@nestjs/graphql'; | ||
|
||
import { ItemArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class AttachmentArgs extends ItemArgs {} |
4 changes: 0 additions & 4 deletions
4
packages/_leaa-common/src/dtos/attachment/attachments-with-pagination.object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import { ObjectType, Field } from '@nestjs/graphql'; | ||
|
||
import { Attachment } from '@leaa/common/src/entrys'; | ||
import { PaginationObject } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ObjectType() | ||
export class AttachmentsWithPaginationObject extends PaginationObject { | ||
@Field(() => [Attachment]) | ||
readonly items: Attachment[] = []; | ||
} |
10 changes: 0 additions & 10 deletions
10
packages/_leaa-common/src/dtos/attachment/attachments.args.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,29 @@ | ||
import { IsOptional } from 'class-validator'; | ||
import { ArgsType, Field, Int } from '@nestjs/graphql'; | ||
|
||
import { ItemsArgs } from '@leaa/common/src/dtos/_common'; | ||
|
||
@ArgsType() | ||
export class AttachmentsArgs extends ItemsArgs { | ||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
type?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
moduleName?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
moduleId?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
typeName?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
typePlatform?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
categoryId?: string; | ||
|
||
@IsOptional() | ||
@Field(() => String, { nullable: true }) | ||
userId?: string; | ||
|
||
@IsOptional() | ||
@Field(() => Int, { nullable: true }) | ||
refreshHash?: number; | ||
} |
4 changes: 0 additions & 4 deletions
4
packages/_leaa-common/src/dtos/attachment/attachments.object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import { ObjectType, Field } from '@nestjs/graphql'; | ||
|
||
import { Attachment } from '@leaa/common/src/entrys'; | ||
|
||
@ObjectType() | ||
export class AttachmentsObject { | ||
@Field(() => [Attachment]) | ||
readonly items: Attachment[] = []; | ||
} |
Oops, something went wrong.