Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
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
srvpro
Commits
2a7af07f
Commit
2a7af07f
authored
Oct 28, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
js
parent
dda03180
Pipeline
#6513
failed with stages
in 4 minutes and 55 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
data-manager/DataManager.js
data-manager/DataManager.js
+4
-4
data-manager/entities/User.js
data-manager/entities/User.js
+7
-7
data-manager/entities/UserDialog.js
data-manager/entities/UserDialog.js
+6
-6
data-manager/entities/VipKey.js
data-manager/entities/VipKey.js
+8
-8
No files found.
data-manager/DataManager.js
View file @
2a7af07f
...
...
@@ -623,11 +623,11 @@ class DataManager {
}
const
keyType
=
vipKey
.
type
;
const
previousDate
=
user
.
vipExpireDate
;
if
(
previousDate
&&
moment_1
.
default
().
isBefore
(
previousDate
))
{
user
.
vipExpireDate
=
moment_1
.
default
(
previousDate
).
add
(
keyType
,
"
d
"
).
toDate
();
if
(
previousDate
&&
(
0
,
moment_1
.
default
)
().
isBefore
(
previousDate
))
{
user
.
vipExpireDate
=
(
0
,
moment_1
.
default
)
(
previousDate
).
add
(
keyType
,
"
d
"
).
toDate
();
}
else
{
user
.
vipExpireDate
=
moment_1
.
default
().
add
(
keyType
,
"
d
"
).
toDate
();
user
.
vipExpireDate
=
(
0
,
moment_1
.
default
)
().
add
(
keyType
,
"
d
"
).
toDate
();
}
user
=
await
mdb
.
save
(
user
);
vipKey
.
isUsed
=
1
;
...
...
@@ -671,7 +671,7 @@ class DataManager {
user
=
new
User_1
.
User
();
user
.
key
=
userKey
;
}
user
.
vipExpireDate
=
moment_1
.
default
(
oldVipUserInfo
.
expire_date
).
toDate
();
user
.
vipExpireDate
=
(
0
,
moment_1
.
default
)
(
oldVipUserInfo
.
expire_date
).
toDate
();
user
.
victory
=
oldVipUserInfo
.
victory
||
null
;
user
.
words
=
oldVipUserInfo
.
words
||
null
;
user
=
await
mdb
.
save
(
user
);
...
...
data-manager/entities/User.js
View file @
2a7af07f
...
...
@@ -23,7 +23,7 @@ let User = class User extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase
chatColor
;
vipExpireDate
;
isVip
()
{
return
this
.
vipExpireDate
&&
moment_1
.
default
().
isBefore
(
this
.
vipExpireDate
);
return
this
.
vipExpireDate
&&
(
0
,
moment_1
.
default
)
().
isBefore
(
this
.
vipExpireDate
);
}
victory
;
words
;
...
...
@@ -39,24 +39,24 @@ __decorate([
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
chatColor
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
datetime
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
datetime
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
Date
)
],
User
.
prototype
,
"
vipExpireDate
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
victory
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
,
{
nullable
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
,
{
nullable
:
true
}),
__metadata
(
"
design:type
"
,
String
)
],
User
.
prototype
,
"
words
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
UserDialog_1
.
UserDialog
,
dialog
=>
dialog
.
user
),
(
0
,
typeorm_1
.
OneToMany
)
(()
=>
UserDialog_1
.
UserDialog
,
dialog
=>
dialog
.
user
),
__metadata
(
"
design:type
"
,
Array
)
],
User
.
prototype
,
"
dialogues
"
,
void
0
);
__decorate
([
typeorm_1
.
OneToMany
(()
=>
VipKey_1
.
VipKey
,
vipKey
=>
vipKey
.
usedBy
),
(
0
,
typeorm_1
.
OneToMany
)
(()
=>
VipKey_1
.
VipKey
,
vipKey
=>
vipKey
.
usedBy
),
__metadata
(
"
design:type
"
,
Array
)
],
User
.
prototype
,
"
usedKeys
"
,
void
0
);
User
=
__decorate
([
...
...
data-manager/entities/UserDialog.js
View file @
2a7af07f
...
...
@@ -19,24 +19,24 @@ let UserDialog = class UserDialog {
user
;
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
UserDialog
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
UserDialog
.
prototype
,
"
cardCode
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
text
"
),
(
0
,
typeorm_1
.
Column
)
(
"
text
"
),
__metadata
(
"
design:type
"
,
String
)
],
UserDialog
.
prototype
,
"
text
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
User_1
.
User
,
user
=>
user
.
dialogues
),
(
0
,
typeorm_1
.
ManyToOne
)
(()
=>
User_1
.
User
,
user
=>
user
.
dialogues
),
__metadata
(
"
design:type
"
,
User_1
.
User
)
],
UserDialog
.
prototype
,
"
user
"
,
void
0
);
UserDialog
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
UserDialog
);
exports
.
UserDialog
=
UserDialog
;
//# sourceMappingURL=UserDialog.js.map
\ No newline at end of file
data-manager/entities/VipKey.js
View file @
2a7af07f
...
...
@@ -24,29 +24,29 @@ let VipKey = class VipKey extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeB
}
};
__decorate
([
typeorm_1
.
PrimaryGeneratedColumn
({
unsigned
:
true
,
type
:
"
bigint
"
}),
(
0
,
typeorm_1
.
PrimaryGeneratedColumn
)
({
unsigned
:
true
,
type
:
"
bigint
"
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
id
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
({
unique
:
true
}),
typeorm_1
.
Column
(
"
varchar
"
,
{
length
:
30
}),
(
0
,
typeorm_1
.
Index
)
({
unique
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
varchar
"
,
{
length
:
30
}),
__metadata
(
"
design:type
"
,
String
)
],
VipKey
.
prototype
,
"
key
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
}),
(
0
,
typeorm_1
.
Column
)
(
"
int
"
,
{
unsigned
:
true
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
type
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
tinyint
"
,
{
unsigned
:
true
,
default
:
0
}),
(
0
,
typeorm_1
.
Index
)
(),
(
0
,
typeorm_1
.
Column
)
(
"
tinyint
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
VipKey
.
prototype
,
"
isUsed
"
,
void
0
);
__decorate
([
typeorm_1
.
ManyToOne
(()
=>
User_1
.
User
,
user
=>
user
.
usedKeys
),
(
0
,
typeorm_1
.
ManyToOne
)
(()
=>
User_1
.
User
,
user
=>
user
.
usedKeys
),
__metadata
(
"
design:type
"
,
User_1
.
User
)
],
VipKey
.
prototype
,
"
usedBy
"
,
void
0
);
VipKey
=
__decorate
([
typeorm_1
.
Entity
()
(
0
,
typeorm_1
.
Entity
)
()
],
VipKey
);
exports
.
VipKey
=
VipKey
;
//# sourceMappingURL=VipKey.js.map
\ No newline at end of file
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