|
|
@ -76,16 +76,19 @@ const pumpInformation = async function (ctx) { |
|
|
|
|
|
|
|
const getPumpStation = async function (ctx) { |
|
|
|
try { |
|
|
|
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) || [] |
|
|
|
} |
|
|
|
console.log(ctx); |
|
|
|
// 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) || []
|
|
|
|
// }
|
|
|
|
|
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = JSON.parse(res) |
|
|
|
// ctx.body = JSON.parse(res)
|
|
|
|
ctx.body = [] |
|
|
|
} catch (error) { |
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|
|
|
ctx.status = 400; |
|
|
|