Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
modulesServer
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
standardized
modulesServer
Commits
8e421fec
Commit
8e421fec
authored
Dec 17, 2021
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
568947e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
4 deletions
+20
-4
pic.ts
src/biz/pic.ts
+6
-0
main.ts
src/main.ts
+0
-2
paramaterCheck.ts
src/middleware/paramaterCheck.ts
+1
-0
picture.ts
src/model/picture.ts
+1
-2
pic.ts
src/routers/pic.ts
+12
-0
No files found.
src/biz/pic.ts
View file @
8e421fec
...
...
@@ -74,3 +74,9 @@ export async function picList(picType) {
return
{
picList
}
}
export
async
function
getPicDetails
(
pId
)
{
let
picList
=
await
pictureData
.
selectPicById
(
pId
);
return
picList
;
}
src/main.ts
View file @
8e421fec
import
{
now
}
from
"mongoose"
;
import
{
testCheck
}
from
"./config/paramaterConfig"
;
import
{
initDB
}
from
"./db/mongo/db_init"
;
import
{
httpServer
}
from
"./net/http_server"
;
import
{
getPort
}
from
"./serverConfig"
;
async
function
lanuch
()
{
httpServer
.
createServer
(
getPort
());
testCheck
();
}
lanuch
();
src/middleware/paramaterCheck.ts
View file @
8e421fec
import
{
paramatersConfig
}
from
"../routers/router"
;
const
configMap
=
{};
...
...
src/model/picture.ts
View file @
8e421fec
...
...
@@ -26,8 +26,7 @@ export async function selectAllPicture() {
}
export
async
function
selectPicById
(
pId
)
{
let
query
=
{
pId
};
return
await
pictureModel
.
find
(
query
).
exec
();
return
await
pictureModel
.
find
({
pId
}).
exec
();
}
...
...
src/routers/pic.ts
View file @
8e421fec
...
...
@@ -3,9 +3,14 @@ import * as picBiz from '../biz/pic';
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/api/pic/up'
,
asyncHandler
(
upFile
));
httpServer
.
post
(
'/api/pic/list'
,
asyncHandler
(
fileList
));
httpServer
.
post
(
'/api/pic/details'
,
asyncHandler
(
picDetails
));
}
async
function
upFile
(
req
,
res
)
{
let
userId
=
req
.
userId
;
let
psdType
=
req
.
psdType
;
let
userName
=
req
.
userName
;
let
desc
=
req
.
desc
;
let
result
=
await
picBiz
.
upPsdFile
(
req
,
userId
,
psdType
,
userName
,
desc
);
res
.
send
(
result
);
}
...
...
@@ -14,4 +19,10 @@ async function fileList(req, res) {
let
picType
=
req
.
picType
;
let
result
=
await
picBiz
.
picList
(
picType
);
res
.
send
(
result
);
}
async
function
picDetails
(
req
,
res
)
{
let
pId
=
req
.
pId
;
let
result
=
await
picBiz
.
getPicDetails
(
pId
);
res
.
send
(
result
);
}
\ 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