You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
220 lines
9.8 KiB
220 lines
9.8 KiB
'use strict';
|
|
|
|
const vehicle = require('../../controllers/data/vehicle');
|
|
const road = require('../../controllers/data/road');
|
|
const bridge = require('../../controllers/data/bridge');
|
|
const project = require('../../controllers/data/project');
|
|
const overspeed = require('../../controllers/data/overspeed');
|
|
const bus = require('../../controllers/data/bus');
|
|
const publicity = require('../../controllers/data/publicity');
|
|
const dataIndex = require('../../controllers/data/index');
|
|
const task = require('../../controllers/data/task')
|
|
const assess = require('../../controllers/data/assess')
|
|
const videoCenter = require('../../controllers/data/videoCenter')
|
|
const appointTask = require('../../controllers/data/appointed')
|
|
const anspectionNotificationPhone = require('../../controllers/data/anspectionNotificationPhone')
|
|
module.exports = function (app, router, opts) {
|
|
|
|
// 数据导出
|
|
app.fs.api.logAttr['GET/data/export'] = { content: '导出数据', visible: true };
|
|
router.get('/data/export', dataIndex.dataExport);
|
|
|
|
// god 交通
|
|
app.fs.api.logAttr['GET/data/god_trans'] = { content: '获取高德交通数据', visible: true };
|
|
router.get('/data/god_trans', dataIndex.godTrans);
|
|
|
|
// 运政
|
|
//货运
|
|
async function setFreightType(ctx, next) {
|
|
ctx.request.body = {
|
|
...(ctx.request.body || {}),
|
|
type: 'freight'
|
|
}
|
|
await next()
|
|
}
|
|
app.fs.api.logAttr['GET/vehicle/freight'] = { content: '获取运政列表', visible: true };
|
|
router.get('/vehicle/freight', setFreightType, vehicle.get);
|
|
|
|
app.fs.api.logAttr['PUT/vehicle/freight'] = { content: '编辑运政数据', visible: true };
|
|
router.put('/vehicle/freight', setFreightType, vehicle.edit);
|
|
|
|
app.fs.api.logAttr['DEL/vehicle/freight/:id'] = { content: '删除运政数据', visible: false };
|
|
router.del('/vehicle/freight/:id', setFreightType, vehicle.del);
|
|
|
|
//客运车
|
|
async function setVehicleType(ctx, next) {
|
|
ctx.request.body = {
|
|
...(ctx.request.body || {}),
|
|
type: 'vehicle'
|
|
}
|
|
await next()
|
|
}
|
|
app.fs.api.logAttr['GET/vehicle'] = { content: '获取运政列表', visible: true };
|
|
router.get('/vehicle', setVehicleType, vehicle.get);
|
|
|
|
app.fs.api.logAttr['PUT/vehicle'] = { content: '编辑运政数据', visible: true };
|
|
router.put('/vehicle', setVehicleType, vehicle.edit);
|
|
|
|
app.fs.api.logAttr['DEL/vehicle/:id'] = { content: '删除运政数据', visible: false };
|
|
router.del('/vehicle/:id', setVehicleType, vehicle.del);
|
|
|
|
// 路政
|
|
async function setRoadManageType(ctx, next) {
|
|
ctx.request.body = {
|
|
...(ctx.request.body || {}),
|
|
type: 'road_manage'
|
|
}
|
|
await next()
|
|
}
|
|
app.fs.api.logAttr['GET/road_manage'] = { content: '获取路政列表', visible: true };
|
|
router.get('/road_manage', setRoadManageType, vehicle.get);
|
|
|
|
app.fs.api.logAttr['PUT/road_manage'] = { content: '编辑路政数据', visible: true };
|
|
router.put('/road_manage', setRoadManageType, vehicle.edit);
|
|
|
|
app.fs.api.logAttr['DEL/road_manage/:id'] = { content: '删除路政数据', visible: false };
|
|
router.del('/road_manage/:id', setRoadManageType, vehicle.del);
|
|
|
|
// 出租/危货
|
|
app.fs.api.logAttr['GET/vehicle/specific'] = { content: '获取具体车辆列表', visible: true };
|
|
router.get('/vehicle/specific', vehicle.specificGet);
|
|
|
|
app.fs.api.logAttr['PUT/vehicle/specific'] = { content: '编辑具体车辆数据', visible: true };
|
|
router.put('/vehicle/specific', vehicle.specificEdit);
|
|
|
|
app.fs.api.logAttr['DEL/vehicle/:vehicleId/specific'] = { content: '删除具体车辆数据', visible: false };
|
|
router.del('/vehicle/:vehicleId/specific', vehicle.specificDel);
|
|
|
|
// 业户
|
|
app.fs.api.logAttr['GET/vehicle/business'] = { content: '获取业户列表', visible: true };
|
|
router.get('/vehicle/business', vehicle.businessGet);
|
|
|
|
app.fs.api.logAttr['PUT/vehicle/business'] = { content: '编辑业户数据', visible: true };
|
|
router.put('/vehicle/business', vehicle.businessEdit);
|
|
|
|
app.fs.api.logAttr['DEL/vehicle/business/:businessId'] = { content: '删除业户数据', visible: false };
|
|
router.del('/vehicle/business/:businessId', vehicle.businessDel);
|
|
// 运政 END
|
|
|
|
// 道路
|
|
app.fs.api.logAttr['POST/road/import'] = { content: '导入道路数据', visible: true };
|
|
router.post('/road/import', road.importIn);
|
|
|
|
app.fs.api.logAttr['GET/road'] = { content: '获取道路数据', visible: true };
|
|
router.get('/road', road.get);
|
|
|
|
app.fs.api.logAttr['GET/road/section'] = { content: '获取道路路段数据', visible: true };
|
|
router.get('/road/section', road.getRoadSection);
|
|
|
|
app.fs.api.logAttr['put/road'] = { content: '编辑道路数据', visible: true };
|
|
router.put('/road', road.edit);
|
|
|
|
app.fs.api.logAttr['DEL/road/:roadId'] = { content: '删除道路数据', visible: false };
|
|
router.del('/road/:roadId', road.del);
|
|
// 道路 END
|
|
|
|
// 桥梁
|
|
app.fs.api.logAttr['GET/bridge'] = { content: '获取桥梁数据', visible: true };
|
|
router.get('/bridge', bridge.bridgeGet);
|
|
|
|
app.fs.api.logAttr['PUT/bridge'] = { content: '编辑桥梁数据', visible: true };
|
|
router.put('/bridge', bridge.bridgeEdit);
|
|
|
|
app.fs.api.logAttr['DEL/bridge/:bridgeId'] = { content: '删除桥梁数据', visible: false };
|
|
router.del('/bridge/:bridgeId', bridge.bridgeDel);
|
|
// 桥梁 END
|
|
|
|
// project
|
|
app.fs.api.logAttr['GET/project'] = { content: '获取工程数据', visible: true };
|
|
router.get('/project', project.projectGet);
|
|
|
|
app.fs.api.logAttr['PUT/project'] = { content: '编辑工程数据', visible: true };
|
|
router.put('/project', project.projectEdit);
|
|
|
|
app.fs.api.logAttr['DEL/project/:projectId'] = { content: '删除工程数据', visible: false };
|
|
router.del('/project/:projectId', project.projectDel);
|
|
// project END
|
|
|
|
//overspeed
|
|
app.fs.api.logAttr['GET/overspeed'] = { content: '获取治超数据', visible: true };
|
|
router.get('/overspeed', overspeed.overspeedGet);
|
|
|
|
app.fs.api.logAttr['PUT/overspeed'] = { content: '编辑治超数据', visible: true };
|
|
router.put('/overspeed', overspeed.overspeedEdit);
|
|
|
|
app.fs.api.logAttr['DEL/overspeed/:overspeedId'] = { content: '删除治超数据', visible: false };
|
|
router.del('/overspeed/:overspeedId', overspeed.overspeedDel);
|
|
//overspeed END
|
|
|
|
//bus
|
|
app.fs.api.logAttr['GET/bus/line'] = { content: '获取公交路线数据', visible: true };
|
|
router.get('/bus/line', bus.lineGet);
|
|
|
|
app.fs.api.logAttr['PUT/bus/line'] = { content: '编辑公交路线数据', visible: true };
|
|
router.put('/bus/line', bus.lineEdit);
|
|
|
|
app.fs.api.logAttr['DEL/bus/line/:lineId'] = { content: '删除公交路线数据', visible: false };
|
|
router.del('/bus/line/:lineId', bus.lineDel);
|
|
|
|
app.fs.api.logAttr['GET/bus/car'] = { content: '获取公交车辆数据', visible: true };
|
|
router.get('/bus/car', bus.carGet);
|
|
|
|
app.fs.api.logAttr['PUT/bus/car'] = { content: '编辑公交车辆数据', visible: true };
|
|
router.put('/bus/car', bus.carEdit);
|
|
|
|
app.fs.api.logAttr['DEL/bus/car/:carId'] = { content: '删除公交车辆数据', visible: false };
|
|
router.del('/bus/car/:carId', bus.carDel);
|
|
//bus END
|
|
|
|
//publicity
|
|
app.fs.api.logAttr['GET/publicity'] = { content: '获取宣传数据', visible: true };
|
|
router.get('/publicity', publicity.publicityGet);
|
|
|
|
app.fs.api.logAttr['PUT/publicity'] = { content: '编辑宣传数据', visible: true };
|
|
router.put('/publicity', publicity.publicityEdit);
|
|
|
|
app.fs.api.logAttr['DEL/publicity/:publicityId'] = { content: '删除宣传数据', visible: false };
|
|
router.del('/publicity/:publicityId', publicity.publicityDel);
|
|
//publicity END
|
|
// task
|
|
app.fs.api.logAttr['GET/task'] = { content: '获取任务列表', visible: false };
|
|
router.get('/task', task.getTask);
|
|
app.fs.api.logAttr['DEL/task/:id'] = { content: '删除任务', visible: false };
|
|
router.del('/task/:id', task.delTask);
|
|
app.fs.api.logAttr['PUT/task'] = { content: '编辑任务', visible: false };
|
|
router.put('/task', task.editTask);
|
|
//task END
|
|
|
|
// 评分考核
|
|
app.fs.api.logAttr['GET/assess'] = { content: '获取评分考核数据', visible: true };
|
|
router.get('/assess', assess.assessGet);
|
|
|
|
app.fs.api.logAttr['PUT/assess'] = { content: '编辑评分考核数据', visible: true };
|
|
router.put('/assess', assess.assessEdit);
|
|
|
|
app.fs.api.logAttr['DEL/assess/:assessId'] = { content: '删除评分考核数据', visible: false };
|
|
router.del('/assess/:assessId', assess.assessDel);
|
|
|
|
app.fs.api.logAttr['GET/assess/nearest'] = { content: '获取评分考核最近的月份的所有考核单位的数据', visible: true };
|
|
router.get('/assess/nearest', assess.nearestSourceData);
|
|
// 评分考核 END
|
|
|
|
// 视频中心
|
|
app.fs.api.logAttr['GET/videoCenter/list'] = { content: '获取萤石设备列表', visible: true };
|
|
router.get('/videoCenter/list', videoCenter.videoList(opts));
|
|
// 视频中心 END
|
|
// 指派任务
|
|
app.fs.api.logAttr['PUT/appointTask'] = { content: '指派任务', visible: true };
|
|
router.put('/appointTask', appointTask.appoint);
|
|
// 指派任务 END
|
|
|
|
//查询短信电话
|
|
app.fs.api.logAttr['GET/anspection/notification/phone'] = { content: '获取短信提醒电话', visible: true };
|
|
router.get('/anspection/notification/phone', anspectionNotificationPhone.getAnspectionNotificationPhone);
|
|
//添加
|
|
app.fs.api.logAttr['POST/anspection/notification/phone'] = { content: '导入道路数据', visible: true };
|
|
router.post('/anspection/notification/phone', anspectionNotificationPhone.addAnspectionNotificationPhone);
|
|
|
|
app.fs.api.logAttr['POST/pushAppointSMS'] = { content: '推送指派短信', visible: true };
|
|
router.post('/pushAppointSMS', anspectionNotificationPhone.pushAppointSMS(opts));
|
|
};
|
|
|