Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init-things
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
init-things
Commits
822a50a5
Commit
822a50a5
authored
Nov 22, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
9c18d2d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
things/nest-typeorm/src/entities/bases/IdBase.entity.ts
things/nest-typeorm/src/entities/bases/IdBase.entity.ts
+8
-9
things/nest-typeorm/src/entities/decorators/relation.ts
things/nest-typeorm/src/entities/decorators/relation.ts
+2
-1
No files found.
things/nest-typeorm/src/entities/bases/IdBase.entity.ts
View file @
822a50a5
import
{
DeletionBase
}
from
'
./DeletionBase.entity
'
;
import
{
Column
,
Generated
,
PrimaryGeneratedColumn
,
SelectQueryBuilder
,
}
from
'
typeorm
'
;
import
{
Column
,
Generated
,
SelectQueryBuilder
}
from
'
typeorm
'
;
import
{
IdWise
}
from
'
../interfaces/wises
'
;
import
{
ApiProperty
}
from
'
@nestjs/swagger
'
;
import
{
applyQueryProperty
}
from
'
../utility/query
'
;
import
{
Not
Changeable
,
Not
Writable
}
from
'
../decorators/transform
'
;
import
{
IsInt
,
Is
Optional
,
Is
Positive
}
from
'
class-validator
'
;
import
{
NotWritable
}
from
'
../decorators/transform
'
;
import
{
IsInt
,
IsPositive
}
from
'
class-validator
'
;
import
{
BigintTransformer
}
from
'
../utility/bigint-transform
'
;
export
class
IdBase
extends
DeletionBase
implements
IdWise
{
@
Generated
(
'
increment
'
)
@
Column
(
'
int8
'
,
{
primary
:
true
,
transformer
:
new
BigintTransformer
()
})
@
Column
(
'
bigint
'
,
{
primary
:
true
,
unsigned
:
true
,
transformer
:
new
BigintTransformer
(),
})
@
ApiProperty
({
description
:
'
编号
'
,
required
:
false
})
@
NotWritable
()
@
IsInt
()
...
...
things/nest-typeorm/src/entities/decorators/relation.ts
View file @
822a50a5
...
...
@@ -6,8 +6,9 @@ import { BigintTransformer } from '../utility/bigint-transform';
export
const
RelationColumn
=
(
description
=
'
对应编号
'
,
notNull
=
false
)
=>
MergePropertyDecorators
([
Column
(
'
int8
'
,
{
Column
(
'
bigint
'
,
{
nullable
:
!
notNull
,
unsigned
:
true
,
transformer
:
new
BigintTransformer
(),
}),
ApiProperty
({
type
:
Number
,
description
}),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment