|
|
@ -1,7 +1,7 @@ |
|
|
|
'use strict'; |
|
|
|
const roadKeyMap = require('./road.json') |
|
|
|
|
|
|
|
async function importIn (ctx) { |
|
|
|
async function importIn(ctx) { |
|
|
|
// 数据导入
|
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
@ -32,7 +32,7 @@ async function importIn (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function get (ctx) { |
|
|
|
async function get(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { codePrefix, level, road, sectionStart, sectionEnd, alterId } = ctx.query; |
|
|
@ -86,14 +86,14 @@ async function get (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function getRoadSection (ctx) { |
|
|
|
async function getRoadSection(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { level, road, sectionStart, sectionEnd } = ctx.query; |
|
|
|
let findOption = { |
|
|
|
where: {}, |
|
|
|
order: [['id', 'DESC']], |
|
|
|
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName', 'routeCode', 'sectionNo'] |
|
|
|
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName', 'routeCode', 'sectionNo', 'level'] |
|
|
|
} |
|
|
|
|
|
|
|
if (level) { |
|
|
@ -129,7 +129,7 @@ async function getRoadSection (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function edit (ctx) { |
|
|
|
async function edit(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const data = ctx.request.body; |
|
|
@ -155,7 +155,7 @@ async function edit (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function del (ctx) { |
|
|
|
async function del(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { roadId } = ctx.params; |
|
|
@ -176,7 +176,7 @@ async function del (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function getVillageList (ctx) { |
|
|
|
async function getVillageList(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { } = ctx.query; |
|
|
|