Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-arena-api
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
MyCard
ygopro-arena-api
Commits
d0ba2f73
Commit
d0ba2f73
authored
Apr 26, 2020
by
Joe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
0bd78a73
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1842 additions
and
24 deletions
+1842
-24
package-lock.json
package-lock.json
+1834
-0
routes/api.js
routes/api.js
+8
-24
No files found.
package-lock.json
0 → 100644
View file @
d0ba2f73
This diff is collapsed.
Click to expand it.
routes/api.js
View file @
d0ba2f73
...
@@ -739,8 +739,14 @@ router.get('/report', function (req, res) {
...
@@ -739,8 +739,14 @@ router.get('/report', function (req, res) {
async
.
parallel
({
async
.
parallel
({
entertainTotal
:
function
(
callback
)
{
entertainTotal
:
function
(
callback
)
{
var
sql
=
`SELECT count(*) from battle_history where type = 'entertain' and start_time >= $1 and start_time < $2;`
var
sql
=
{
text
:
`SELECT count(*) from battle_history where type = 'entertain' and start_time >= $1 and start_time < $2;`
,
values
:
time_args
}
console
.
log
(
sql
)
console
.
log
(
sql
)
client
.
query
(
sql
,
function
(
err
,
result
)
{
client
.
query
(
sql
,
function
(
err
,
result
)
{
done
()
done
()
if
(
err
)
{
if
(
err
)
{
...
@@ -1070,7 +1076,6 @@ router.post('/voteStatus', function (req, res) {
...
@@ -1070,7 +1076,6 @@ router.post('/voteStatus', function (req, res) {
});
});
});
});
router
.
post
(
'
/submitVote
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/submitVote
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -1344,7 +1349,6 @@ router.get('/votes', function (req, res) {
...
@@ -1344,7 +1349,6 @@ router.get('/votes', function (req, res) {
});
});
});
});
router
.
get
(
'
/vote
'
,
function
(
req
,
res
)
{
router
.
get
(
'
/vote
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -1420,7 +1424,6 @@ router.get('/vote', function (req, res) {
...
@@ -1420,7 +1424,6 @@ router.get('/vote', function (req, res) {
});
});
});
});
router
.
get
(
'
/deckinfo
'
,
function
(
req
,
res
)
{
router
.
get
(
'
/deckinfo
'
,
function
(
req
,
res
)
{
var
name
=
req
.
query
.
name
var
name
=
req
.
query
.
name
var
version
=
req
.
query
.
version
var
version
=
req
.
query
.
version
...
@@ -1491,8 +1494,6 @@ router.get('/deckinfo', function (req, res) {
...
@@ -1491,8 +1494,6 @@ router.get('/deckinfo', function (req, res) {
});
});
});
});
var
file
=
require
(
"
./file.js
"
);
var
file
=
require
(
"
./file.js
"
);
router
.
post
(
'
/upload
'
,
file
.
upload
);
router
.
post
(
'
/upload
'
,
file
.
upload
);
...
@@ -1697,7 +1698,6 @@ router.get('/deckdata/:id', function (req, res) {
...
@@ -1697,7 +1698,6 @@ router.get('/deckdata/:id', function (req, res) {
})
})
//卡组范例提交
//卡组范例提交
router
.
post
(
'
/deckdemo
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/deckdemo
'
,
function
(
req
,
res
)
{
let
author
=
req
.
body
.
user
;
let
author
=
req
.
body
.
user
;
...
@@ -2232,7 +2232,6 @@ router.get('/ads', function (req, res) {
...
@@ -2232,7 +2232,6 @@ router.get('/ads', function (req, res) {
});
});
});
});
router
.
post
(
'
/adSwitchChange
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/adSwitchChange
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2269,8 +2268,6 @@ router.post('/adSwitchChange', function (req, res) {
...
@@ -2269,8 +2268,6 @@ router.post('/adSwitchChange', function (req, res) {
});
});
});
});
router
.
get
(
'
/label
'
,
function
(
req
,
res
)
{
router
.
get
(
'
/label
'
,
function
(
req
,
res
)
{
pool
.
connect
(
function
(
err
,
client
,
done
)
{
pool
.
connect
(
function
(
err
,
client
,
done
)
{
...
@@ -2301,7 +2298,6 @@ router.get('/label', function (req, res) {
...
@@ -2301,7 +2298,6 @@ router.get('/label', function (req, res) {
});
});
router
.
post
(
'
/label
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/label
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2339,8 +2335,6 @@ router.post('/label', function (req, res) {
...
@@ -2339,8 +2335,6 @@ router.post('/label', function (req, res) {
});
});
});
});
router
.
post
(
'
/activity
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/activity
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2389,7 +2383,6 @@ router.post('/activity', function (req, res) {
...
@@ -2389,7 +2383,6 @@ router.post('/activity', function (req, res) {
});
});
});
});
router
.
post
(
'
/adsStatus
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/adsStatus
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2428,7 +2421,6 @@ router.post('/adsStatus', function (req, res) {
...
@@ -2428,7 +2421,6 @@ router.post('/adsStatus', function (req, res) {
});
});
});
});
router
.
get
(
'
/getAd
'
,
function
(
req
,
res
)
{
router
.
get
(
'
/getAd
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2514,7 +2506,6 @@ router.get('/getAd', function (req, res) {
...
@@ -2514,7 +2506,6 @@ router.get('/getAd', function (req, res) {
});
});
});
});
router
.
post
(
'
/adClick
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/adClick
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2557,7 +2548,6 @@ router.post('/adClick', function (req, res) {
...
@@ -2557,7 +2548,6 @@ router.post('/adClick', function (req, res) {
});
});
});
});
router
.
post
(
'
/adImpl
'
,
function
(
req
,
res
)
{
router
.
post
(
'
/adImpl
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2599,8 +2589,6 @@ router.post('/adImpl', function (req, res) {
...
@@ -2599,8 +2589,6 @@ router.post('/adImpl', function (req, res) {
});
});
});
});
router
.
get
(
'
/firstwin
'
,
function
(
req
,
res
)
{
router
.
get
(
'
/firstwin
'
,
function
(
req
,
res
)
{
// to run a query we can acquire a client from the pool,
// to run a query we can acquire a client from the pool,
// run a query on the client, and then return the client to the pool
// run a query on the client, and then return the client to the pool
...
@@ -2663,10 +2651,6 @@ router.get('/firstwin', function (req, res) {
...
@@ -2663,10 +2651,6 @@ router.get('/firstwin', function (req, res) {
});
});
});
});
createUser
=
function
(
username
,
ep
,
epEventName
)
{
createUser
=
function
(
username
,
ep
,
epEventName
)
{
pool
.
connect
(
function
(
err
,
client
,
done
)
{
pool
.
connect
(
function
(
err
,
client
,
done
)
{
let
sql
=
{
let
sql
=
{
...
@@ -2705,4 +2689,4 @@ var getStringValueByMysticalNumber = function (lang, offset, number) {
...
@@ -2705,4 +2689,4 @@ var getStringValueByMysticalNumber = function (lang, offset, number) {
return
""
return
""
}
}
module
.
exports
=
router
module
.
exports
=
router
\ 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