Browse Source

测试11111

master
wenlele 1 year ago
parent
commit
e42aba3d00
  1. 18
      api/app/lib/controllers/bigScreen/index .js
  2. 4
      api/app/lib/routes/organization/index.js

18
api/app/lib/controllers/bigScreen/index .js

@ -77,18 +77,18 @@ const pumpInformation = async function (ctx) {
const getPumpStation = async function (ctx) {
try {
console.log(ctx);
// const { key, methodType, field } = ctx.query;
const { key, methodType, field } = ctx.query;
// let res
// if (field) {
// res = await ctx.redis[methodType]("pumpStation_" + key, field) || []
// } else {
// res = await ctx.redis[methodType]("pumpStation_" + key) || []
// }
let res
if (field) {
res = await ctx.redis[methodType]("pumpStation_" + key, field) || []
} else {
res = await ctx.redis[methodType]("pumpStation_" + key) || []
}
ctx.status = 200;
// ctx.body = JSON.parse(res)
ctx.body = []
ctx.body = JSON.parse(res)
// ctx.body = []
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;

4
api/app/lib/routes/organization/index.js

@ -6,7 +6,7 @@ module.exports = function (app, router, opts) {
try {
app.fs.api.logAttr['get/pump/station'] = { content: '获取所有站点信息', visible: true };
app.fs.api.logAttr['GET/pump/station'] = { content: '获取所有站点信息', visible: true };
router.get('/pump1/station1', data.getPumpStation);
@ -16,7 +16,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/pumpInformation'] = { content: '获取泵站信息', visible: true };
router.get('/pumpInformation', data.pumpInformation);
app.fs.api.logAttr['get/videoUrl'] = { content: '获取视频监控url', visible: true };
app.fs.api.logAttr['GET/videoUrl'] = { content: '获取视频监控url', visible: true };
router.get('/videoUrl', data.getVideoUrl);

Loading…
Cancel
Save