Commit 8e421fec by chenjinjing

no message

parent 568947e6
......@@ -74,3 +74,9 @@ export async function picList(picType) {
return {picList}
}
export async function getPicDetails(pId) {
let picList = await pictureData.selectPicById(pId);
return picList;
}
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();
import { paramatersConfig } from "../routers/router";
const configMap = {};
......
......@@ -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();
}
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment