Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yuyiDataServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
yuyiDataServer
Commits
94bfcba3
Commit
94bfcba3
authored
Dec 12, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
f4b3613b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
mysqlTableConfig.ts
src/config/mysqlTableConfig.ts
+0
-0
sqlModelBind.ts
src/model/sqlModelBind.ts
+1
-1
mysqlRouter.ts
src/routers/mysqlRouter.ts
+10
-11
tsconfig.json
tsconfig.json
+2
-1
No files found.
src/config/mysqlTableConfig.ts
View file @
94bfcba3
This diff is collapsed.
Click to expand it.
src/model/sqlModelBind.ts
View file @
94bfcba3
...
...
@@ -15,7 +15,7 @@ export async function initMysqlModel() {
let
schemaConf
=
{
freezeTableName
:
true
,
//true表示使用给定的表名,false表示模型名后加s作为表名
timestamps
:
tru
e
//true表示给模型加上时间戳属性(createAt updateAt),false表示不带时间戳属性
timestamps
:
fals
e
//true表示给模型加上时间戳属性(createAt updateAt),false表示不带时间戳属性
};
let
model
=
mysqlDB
.
define
(
tableName
,
schema
,
schemaConf
);
...
...
src/routers/mysqlRouter.ts
View file @
94bfcba3
...
...
@@ -11,17 +11,16 @@ import { BizError } from '../util/bizError';
import
{
ERRORENUM
}
from
'../config/errorEnum'
;
export
function
setRouter
(
httpServer
){
httpServer
.
post
(
'/yfs/dataserver/mysql/table/add'
,
checkMySqlSign
,
asyncHandler
(
addTableData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/delete'
,
checkMySqlSign
,
asyncHandler
(
deleteData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/update'
,
checkMySqlSign
,
asyncHandler
(
updateManyData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/one'
,
checkMySqlSign
,
asyncHandler
(
findOneData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/many'
,
checkMySqlSign
,
asyncHandler
(
findManyData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/manytopage'
,
checkMySqlSign
,
asyncHandler
(
findManyToPageData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/count'
,
checkMySqlSign
,
asyncHandler
(
findCountData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/aggragate'
,
checkMySqlSign
,
asyncHandler
(
findAggragateData
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/aggragatetopage'
,
checkMySqlSign
,
asyncHandler
(
findAggragateDataToPage
));
httpServer
.
post
(
'/yfs/dataserver/mysql/table/find/aggragateone'
,
checkMySqlSign
,
asyncHandler
(
selectOneDataToTableAssociation
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/add'
,
checkMySqlSign
,
asyncHandler
(
addTableData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/delete'
,
checkMySqlSign
,
asyncHandler
(
deleteData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/update'
,
checkMySqlSign
,
asyncHandler
(
updateManyData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/one'
,
checkMySqlSign
,
asyncHandler
(
findOneData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/many'
,
checkMySqlSign
,
asyncHandler
(
findManyData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/manytopage'
,
checkMySqlSign
,
asyncHandler
(
findManyToPageData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/count'
,
checkMySqlSign
,
asyncHandler
(
findCountData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/aggragate'
,
checkMySqlSign
,
asyncHandler
(
findAggragateData
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/aggragatetopage'
,
checkMySqlSign
,
asyncHandler
(
findAggragateDataToPage
));
httpServer
.
post
(
'/yuyi/dataserver/mysql/table/find/aggragateone'
,
checkMySqlSign
,
asyncHandler
(
selectOneDataToTableAssociation
));
}
...
...
tsconfig.json
View file @
94bfcba3
...
...
@@ -7,6 +7,6 @@
"outDir"
:
"./out"
},
"exclude"
:
[
"node_modules"
"node_modules"
,
]
}
\ 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