Browse Source

获取路段api修改

dev
liujiangyong 1 year ago
parent
commit
5c49318d5b
  1. 14
      api/app/lib/controllers/data/road.js

14
api/app/lib/controllers/data/road.js

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

Loading…
Cancel
Save