Commit 8e421fec by chenjinjing

no message

parent 568947e6
...@@ -74,3 +74,9 @@ export async function picList(picType) { ...@@ -74,3 +74,9 @@ export async function picList(picType) {
return {picList} return {picList}
} }
export async function getPicDetails(pId) {
let picList = await pictureData.selectPicById(pId);
return picList;
}
import { now } from "mongoose"; import { now } from "mongoose";
import { testCheck } from "./config/paramaterConfig";
import { initDB } from "./db/mongo/db_init"; import { initDB } from "./db/mongo/db_init";
import { httpServer } from "./net/http_server"; import { httpServer } from "./net/http_server";
import { getPort } from "./serverConfig"; import { getPort } from "./serverConfig";
async function lanuch() { async function lanuch() {
httpServer.createServer(getPort()); httpServer.createServer(getPort());
testCheck();
} }
lanuch(); lanuch();
import { paramatersConfig } from "../routers/router";
const configMap = {}; const configMap = {};
......
...@@ -26,8 +26,7 @@ export async function selectAllPicture() { ...@@ -26,8 +26,7 @@ export async function selectAllPicture() {
} }
export async function selectPicById(pId) { export async function selectPicById(pId) {
let query = { pId }; return await pictureModel.find({pId}).exec();
return await pictureModel.find(query).exec();
} }
......
...@@ -3,9 +3,14 @@ import * as picBiz from '../biz/pic'; ...@@ -3,9 +3,14 @@ import * as picBiz from '../biz/pic';
export function setRouter(httpServer) { export function setRouter(httpServer) {
httpServer.post('/api/pic/up', asyncHandler(upFile)); httpServer.post('/api/pic/up', asyncHandler(upFile));
httpServer.post('/api/pic/list', asyncHandler(fileList)); httpServer.post('/api/pic/list', asyncHandler(fileList));
httpServer.post('/api/pic/details', asyncHandler(picDetails));
} }
async function upFile(req, res) { 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); let result = await picBiz.upPsdFile(req, userId, psdType, userName, desc);
res.send(result); res.send(result);
} }
...@@ -14,4 +19,10 @@ async function fileList(req, res) { ...@@ -14,4 +19,10 @@ async function fileList(req, res) {
let picType = req.picType; let picType = req.picType;
let result = await picBiz.picList(picType); let result = await picBiz.picList(picType);
res.send(result); 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