Commit 327bde65 by lixinming

路由优化

parent 903b4863
/**
* 管理后台端 企业相关
* 包括 在孵企业页面
* 包括 企业融资页面
*/
import * as asyncHandler from 'express-async-handler';
import * as enterpriseBiz from '../../biz/enterprise/enterprise';
import * as financingBiz from '../../biz/enterprise/financing';
import { checkParamaterType, getTimeKey } from '../../util/tools';
import { checkGuanWeiHuiToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/admin/enterprise/list',checkGuanWeiHuiToken, asyncHandler(getEnterpriseList));
httpServer.post('/admin/enterprise/financinglist',checkGuanWeiHuiToken, asyncHandler(getFinancingList));
httpServer.post('/admin/enterprise/affiliationfuhuaqi',checkGuanWeiHuiToken,asyncHandler(affiliationFuHuaQi));
httpServer.post('/admin/data/output/enterprise',checkGuanWeiHuiToken, asyncHandler(outPutEnterpriseData));
httpServer.post('/admin/data/output/financing',checkGuanWeiHuiToken, asyncHandler(outPutFinancingData));
}
/**
* 后台管理 获取在孵企业信息列表
* @param req
* @param res
*/
async function getEnterpriseList(req, res) {
let reqConf = {createType: 'Number', fuHuaQiUscc: 'String', industry: '[Number]', isNaturalPersonHolding: 'Number', page: 'Number' };
let { createType, fuHuaQiUscc, industry, isNaturalPersonHolding, page } = checkParamaterType(reqConf, req.body);
let result = await enterpriseBiz.enterpriseList(createType, fuHuaQiUscc, industry, isNaturalPersonHolding, page);
res.success(result);
}
/**
* 后台管理 获取融资企业信息列表
* @param req
* @param res
*/
async function getFinancingList(req, res) {
let reqConf = {monthData: 'String', fuHuaQiName: 'String', fuHuaQiInvestment: 'Number', industry: '[Number]', page: 'Number' };
let {monthData, fuHuaQiName, industry, fuHuaQiInvestment, page} = checkParamaterType(reqConf, req.body);
let result = await financingBiz.financingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment, page);
res.success(result);
}
/**
* 所属孵化器
* 下拉框
* @param req
* @param res
*/
async function affiliationFuHuaQi(req, res) {
let result = await enterpriseBiz.getAffiliationFuHuaQi();
res.success(result);
}
/**
* 导出在孵企业数据
* @param req
* @param res
*/
async function outPutEnterpriseData(req, res) {
let reqConf = {createType: 'Number', fuHuaQiUscc: 'String', industry: '[Number]', isNaturalPersonHolding: 'Number', type:'Number' };
let { createType, fuHuaQiUscc, industry, isNaturalPersonHolding, page, type } = checkParamaterType(reqConf, req.body);
let dataList = await enterpriseBiz.outPutEnterpriseData(createType, fuHuaQiUscc, industry, isNaturalPersonHolding, type);
let keyList = [
"name", "createTime", "fuhuaqiUscc", "uscc", "industry", "logonTime",
"firstIncubationTime", "timeOfImmigration", "isNaturalPersonHolding", "oldLogonAdd",
"logonAdd", "operatingAdd", "leasedArea"
];
let titleList = [
"企业名称", "入库时间", "所属孵化器", "统一信用代码", "行业领域",
"注册时间", "首次入孵时间", "迁入时间", "是否自然人控股", "迁入前注册地址",
"注册地址", "经营地址", "租赁面积(平方米)"
];
let result = [titleList];
dataList.forEach(info => {
let subList = [];
keyList.forEach(subInfo => {
subList.push(info[subInfo] || '');
});
result.push(subList);
});
let name = `在孵企业${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
/**
* 导出企业融资数据
* @param req
* @param res
*/
async function outPutFinancingData(req, res) {
let reqConf = {monthData: 'String', fuHuaQiName: 'String', fuHuaQiInvestment: 'Number', industry: '[Number]', type:'Number' };
let {monthData, fuHuaQiName, industry, fuHuaQiInvestment, type} = checkParamaterType(reqConf, req.body);
let dataList = await financingBiz.outPutFinancingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment, type);
let keyList = [
"name", "logonAdd", "operatingAdd", "financingAmount","investmentInstitutionsName",
"timeToObtainInvestment", "fuHuaQiInvestment", "fuHuaQiInvestmentAmount", "fuHuaQiInvestmentStyle", "createTime"
];
let titleList = [
"企业名称","注册地址","经营地址","融资金额(万元)","投资机构名称","获得投资时间",
"孵化器是否投资","孵化器投资金额(万元)","孵化器投资方式","录入时间",
];
let result = [titleList];
dataList.forEach(info => {
let subList = [];
keyList.forEach(subInfo => {
subList.push(info[subInfo] || '');
});
result.push(subList);
});
let name = `融资企业${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
/**
* 管理后台端 孵化器信息
*/
import * as asyncHandler from 'express-async-handler';
import * as userBiz from '../biz/fuHuqQi/user';
import * as baseBiz from '../biz/fuHuqQi/base';
import * as enterpriseBiz from '../biz/enterprise/enterprise';
import * as financingBiz from '../biz/enterprise/financing';
import * as guanWeiHuiBiz from '../biz/guanWeiHui/user';
import { checkParamaterType, checkReqParam, getTimeKey } from '../util/tools';
import { BizError } from '../util/bizError';
import { ERRORENUM } from '../config/errorEnum';
import { monthTableList, outPutMonthTableList } from '../biz/fuHuqQi/month';
import { OUTPUTDATATYPE, OUTPUTTYPE } from '../config/enum';
import { checkGuanWeiHuiToken } from '../middleware/user';
import * as userBiz from '../../biz/fuHuqQi/user';
import * as baseBiz from '../../biz/fuHuqQi/base';
import { checkParamaterType, checkReqParam, getTimeKey } from '../../util/tools';
import { monthTableList } from '../../biz/fuHuqQi/month';
import { checkGuanWeiHuiToken } from '../../middleware/user';
import * as monthBiz from '../../biz/fuHuqQi/month';
export function setRouter(httpServer) {
// /**登录 */
httpServer.post('/admin/login', asyncHandler(login));
// /** 孵化器*/
httpServer.post('/admin/fuhuaqi/baselist',checkGuanWeiHuiToken, asyncHandler(fuHuaQiBaseList));
httpServer.post('/admin/fuhuaqi/monthoccupancyrate',checkGuanWeiHuiToken, asyncHandler(getMonthList));
httpServer.post('/admin/fuhuaqi/userlist',checkGuanWeiHuiToken, asyncHandler(getFuHuaQiUserList));
httpServer.post('/admin/fuhuaqi/updatestate',checkGuanWeiHuiToken, asyncHandler(updateState));
httpServer.post('/admin/fuhuaqi/adduser',checkGuanWeiHuiToken,asyncHandler(addUser));
/**企业 */
httpServer.post('/admin/enterprise/list',checkGuanWeiHuiToken, asyncHandler(getEnterpriseList));
httpServer.post('/admin/enterprise/financinglist',checkGuanWeiHuiToken, asyncHandler(getFinancingList));
httpServer.post('/admin/enterprise/affiliationfuhuaqi',checkGuanWeiHuiToken,asyncHandler(affiliationFuHuaQi));
/**导出数据 */
httpServer.post('/admin/data/output/fuhuaqi',checkGuanWeiHuiToken, asyncHandler(outPutFuHuaQiData));
httpServer.post('/admin/data/output/enterprise',checkGuanWeiHuiToken, asyncHandler(outPutEnterpriseData));
httpServer.post('/admin/data/output/financing',checkGuanWeiHuiToken, asyncHandler(outPutFinancingData));
httpServer.post('/admin/data/output/month',checkGuanWeiHuiToken, asyncHandler(outPutMonthData));
}
/**
* 管理后台登录
* @param req
* @param res
*/
async function login(req, res) {
let reqConf = {loginId:'String', pwd:'String'};
let {loginId, pwd} = checkReqParam(reqConf, req.body);
let userInfo = await guanWeiHuiBiz.login(loginId, pwd);
res.success(userInfo);
}
/**
* 孵化器基本信息列表
* @param req
* @param res
......@@ -98,34 +73,6 @@ async function getMonthList(req, res) {
/**
* 后台管理 获取融资企业信息列表
* @param req
* @param res
*/
async function getFinancingList(req, res) {
let reqConf = {monthData: 'String', fuHuaQiName: 'String', fuHuaQiInvestment: 'Number', industry: '[Number]', page: 'Number' };
let {monthData, fuHuaQiName, industry, fuHuaQiInvestment, page} = checkParamaterType(reqConf, req.body);
let result = await financingBiz.financingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment, page);
res.success(result);
}
/**
* 后台管理 获取在孵企业信息列表
* @param req
* @param res
*/
async function getEnterpriseList(req, res) {
let reqConf = {createType: 'Number', fuHuaQiUscc: 'String', industry: '[Number]', isNaturalPersonHolding: 'Number', page: 'Number' };
let { createType, fuHuaQiUscc, industry, isNaturalPersonHolding, page } = checkParamaterType(reqConf, req.body);
let result = await enterpriseBiz.enterpriseList(createType, fuHuaQiUscc, industry, isNaturalPersonHolding, page);
res.success(result);
}
/**
* 后台管理 修改孵化器账号状态
* @param req
* @param res
......@@ -138,6 +85,7 @@ async function getMonthList(req, res) {
res.success(result);
}
/**
* 后台管理 新增孵化器账号
* @param req
......@@ -152,16 +100,6 @@ async function addUser(req, res) {
}
/**
* 所属孵化器
* @param req
* @param res
*/
async function affiliationFuHuaQi(req, res) {
let result = await enterpriseBiz.getAffiliationFuHuaQi();
res.success(result);
}
async function outPutFuHuaQiData(req, res) {
let reqConf = {lv: 'Number', institutionalNature: 'Number', industry: 'Number', dataType:'Number', type:'Number'};
......@@ -196,70 +134,12 @@ async function outPutFuHuaQiData(req, res) {
}
async function outPutEnterpriseData(req, res) {
let reqConf = {createType: 'Number', fuHuaQiUscc: 'String', industry: '[Number]', isNaturalPersonHolding: 'Number', type:'Number' };
let { createType, fuHuaQiUscc, industry, isNaturalPersonHolding, page, type } = checkParamaterType(reqConf, req.body);
let dataList = await enterpriseBiz.outPutEnterpriseData(createType, fuHuaQiUscc, industry, isNaturalPersonHolding, type);
let keyList = [
"name", "createTime", "fuhuaqiUscc", "uscc", "industry", "logonTime",
"firstIncubationTime", "timeOfImmigration", "isNaturalPersonHolding", "oldLogonAdd",
"logonAdd", "operatingAdd", "leasedArea"
];
let titleList = [
"企业名称", "入库时间", "所属孵化器", "统一信用代码", "行业领域",
"注册时间", "首次入孵时间", "迁入时间", "是否自然人控股", "迁入前注册地址",
"注册地址", "经营地址", "租赁面积(平方米)"
];
let result = [titleList];
dataList.forEach(info => {
let subList = [];
keyList.forEach(subInfo => {
subList.push(info[subInfo] || '');
});
result.push(subList);
});
let name = `在孵企业${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
async function outPutFinancingData(req, res) {
let reqConf = {monthData: 'String', fuHuaQiName: 'String', fuHuaQiInvestment: 'Number', industry: '[Number]', type:'Number' };
let {monthData, fuHuaQiName, industry, fuHuaQiInvestment, type} = checkParamaterType(reqConf, req.body);
let dataList = await financingBiz.outPutFinancingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment, type);
let keyList = [
"name", "logonAdd", "operatingAdd", "financingAmount","investmentInstitutionsName",
"timeToObtainInvestment", "fuHuaQiInvestment", "fuHuaQiInvestmentAmount", "fuHuaQiInvestmentStyle", "createTime"
];
let titleList = [
"企业名称","注册地址","经营地址","融资金额(万元)","投资机构名称","获得投资时间",
"孵化器是否投资","孵化器投资金额(万元)","孵化器投资方式","录入时间",
];
let result = [titleList];
dataList.forEach(info => {
let subList = [];
keyList.forEach(subInfo => {
subList.push(info[subInfo] || '');
});
result.push(subList);
});
let name = `融资企业${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
async function outPutMonthData(req, res) {
let reqConf = {state: 'Number', year: 'Number', month: 'Number', type:'Number'};
let { state, year, month, type } = checkParamaterType(reqConf, req.body);
let dataList = await outPutMonthTableList(state, year, month, type);
let dataList = await monthBiz.outPutMonthTableList(state, year, month, type);
let keyList = [
"operationName",
......
import * as guanWeiHuiBiz from '../../biz/guanWeiHui/user';
import { checkReqParam } from '../../util/tools';
import * as asyncHandler from 'express-async-handler';
export function setRouter(httpServer) {
httpServer.post('/admin/login', asyncHandler(login));
}
/**
* 管理后台登录
* @param req
* @param res
*/
async function login(req, res) {
let reqConf = {loginId:'String', pwd:'String'};
let {loginId, pwd} = checkReqParam(reqConf, req.body);
let userInfo = await guanWeiHuiBiz.login(loginId, pwd);
res.success(userInfo);
}
/**
* 小程序端 孵化器入口 融资相关路由
*/
import * as asyncHandler from 'express-async-handler';
import * as enterpriseBiz from '../../biz/enterprise/enterprise';
import { checkReqParam } from '../../util/tools';
import { checkFuHuaQiToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/enterprise/register', checkFuHuaQiToken, asyncHandler(registerEnterprise));
httpServer.post('/fuhuaqi/enterprise/updateregister', checkFuHuaQiToken, asyncHandler(updateRegisterEnterprise));
httpServer.post('/fuhuaqi/enterprise/move', checkFuHuaQiToken, asyncHandler(moveInEnterprise));
httpServer.post('/fuhuaqi/enterprise/updatemove', checkFuHuaQiToken, asyncHandler(updateMoveInEnterprise));
httpServer.post('/fuhuaqi/enterprise/select', checkFuHuaQiToken, asyncHandler(selectEnterpriseInfo));
httpServer.post('/fuhuaqi/enterprise/delete', checkFuHuaQiToken, asyncHandler(delEnterpriseInfo));
}
/**
* 添加新注册的企业信息
* @param req
* @param res
*/
async function registerEnterprise(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await enterpriseBiz.registerEnterprise(Uscc, form);
res.success(result);
}
/**
* 修改新注册的企业信息
* @param req
* @param res
*/
async function updateRegisterEnterprise(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await enterpriseBiz.updateRegisterEnterprise(Uscc, form);
res.success(result);
}
/**
* 添加迁入的企业信息
* @param req
* @param res
*/
async function moveInEnterprise(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await enterpriseBiz.moveInEnterprise(Uscc, form);
res.success(result);
}
/**
* 修改迁入企业登记信息
* @param req
* @param res
*/
async function updateMoveInEnterprise(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await enterpriseBiz.updateMoveInEnterprise(Uscc, form);
res.success(result);
}
/**
* 查询迁入企业登记信息或新建企业登录信息
* 回显
* @param req
* @param res
*/
async function selectEnterpriseInfo(req, res) {
/*这里改成了用DraftId,为了不改前端 依然使用uscc这个参数*/
let reqConf = {uscc: 'String' };
let { uscc } = checkReqParam(reqConf, req.body);
let result = await enterpriseBiz.getEnterpriseByDraftId(uscc);
res.success(result);
}
/**
* 删除迁入企业登记信息或新建企业登录信息
* @param req
* @param res
*/
async function delEnterpriseInfo(req, res) {
/*这里改成了用DraftId,为了不改前端 依然使用uscc这个参数*/
let reqConf = {uscc: 'String' };
let { uscc } = checkReqParam(reqConf, req.body);
let result = await enterpriseBiz.deleteEnterpriseByDraftId(uscc);
res.success(result);
}
\ No newline at end of file
/**
* 小程序端 孵化器入口 融资相关路由
*/
import * as asyncHandler from 'express-async-handler';
import * as financingBiz from '../../biz/enterprise/financing';
import { checkReqParam } from '../../util/tools';
import { checkFuHuaQiToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/financing/create', checkFuHuaQiToken, asyncHandler(createFinancingInfo));
httpServer.post('/fuhuaqi/financing/update', checkFuHuaQiToken, asyncHandler(updateFinancingInfo));
httpServer.post('/fuhuaqi/financing/select', checkFuHuaQiToken, asyncHandler(selectEnterpriseFinancingInfo));
httpServer.post('/fuhuaqi/financing/delete', checkFuHuaQiToken, asyncHandler(delEnterpriseFinancingInfo));
httpServer.post('/admin/financing/namelist', checkFuHuaQiToken, asyncHandler(getFinancingInfoByName));
}
/**
* 新建企业融资信息
* @param req
* @param res
*/
async function createFinancingInfo(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await financingBiz.createFinancingInfo(Uscc, form);
res.success(result);
}
/**
* 修改企业融资信息
* @param req
* @param res
*/
async function updateFinancingInfo(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await financingBiz.updateFinancingInfo(Uscc, form);
res.success(result);
}
/**
* 查询企业融资信息
* 回显
* @param req
* @param res
*/
async function selectEnterpriseFinancingInfo(req, res) {
let reqConf = {uscc: 'String' };
let { uscc } = checkReqParam(reqConf, req.body);
const FHQUscc = req.headers.uscc;
let result = await financingBiz.getEnterpriseFinancingByUscc(FHQUscc, uscc);
res.success(result);
}
/**
* 删除企业融资草稿信息
* @param req
* @param res
*/
async function delEnterpriseFinancingInfo(req, res) {
let reqConf = {uscc: 'String' };
let { uscc } = checkReqParam(reqConf, req.body);
const FHQUscc = req.headers.uscc;
let result = await financingBiz.deleteEnterpriseFinancingByUscc(FHQUscc, uscc);
res.success(result);
}
/**
* 根据融资企业名称获取融资企业名称
* @param req
* @param res
*/
async function getFinancingInfoByName(req, res) {
const Uscc = req.headers.uscc;
let result = await financingBiz.getFuHuaQiEnterpriseForSelect(Uscc);
res.success(result);
}
/**
* 小程序端 孵化器入口 孵化器相关路由
* 包括 孵化器数据相关
* 包括 孵化器任务相关
*/
import * as asyncHandler from 'express-async-handler';
import * as baseBiz from '../../biz/fuHuqQi/base';
import * as taskBiz from '../../biz/fuHuqQi/task';
import { checkReqParam } from '../../util/tools';
import { checkFuHuaQiToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/base', checkFuHuaQiToken, asyncHandler(baseInfo));
httpServer.post('/fuhuaqi/mydata', checkFuHuaQiToken, asyncHandler(myDataInfo));
httpServer.post('/fuhuaqi/base/update', checkFuHuaQiToken, asyncHandler(updateMyDataInfo));
httpServer.post('/fuhuaqi/organization/info', checkFuHuaQiToken, asyncHandler(organizationInfo));
httpServer.post('/fuhuaqi/organization/update', checkFuHuaQiToken, asyncHandler(updateOrganizationInfo));
/** 任务 */
httpServer.post('/fuhuaqi/task/list', checkFuHuaQiToken, asyncHandler(taskList));
httpServer.post('/fuhuaqi/task/submit', checkFuHuaQiToken, asyncHandler(submitTask));
}
/**
* 主界面信息
* 包括首页的 我的数据 评分明细
* @param req
* @param res
*/
async function baseInfo(req, res) {
const Uscc = req.headers.uscc;
let userInfo = await baseBiz.homeData(Uscc);
res.success(userInfo);
}
/**
* 我的数据
* 小程序点击 详细数据
* @param req
* @param res
*/
async function myDataInfo(req, res) {
const Uscc = req.headers.uscc;
let userInfo = await baseBiz.selectFuHuaQiBaseData(Uscc);
res.success(userInfo);
}
/**
* 更新基础数据
* @param req
* @param res
*/
async function updateMyDataInfo(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await baseBiz.updateFuHuaQiBaseData(Uscc, form);
res.success(result);
}
/**
* 机构信息
*/
async function organizationInfo(req, res) {
const Uscc = req.headers.uscc;
let userInfo = await baseBiz.selectOrganizationInfo(Uscc);
res.success(userInfo);
}
/**
* 修改机构信息
*/
async function updateOrganizationInfo(req, res) {
let reqConf = {form: 'Object' };
let { form } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await baseBiz.updateOrganizationData(Uscc, form);
res.success(result);
}
/**
* 任务列表
* @param req
* @param res
*/
async function taskList(req, res) {
const Uscc = req.headers.uscc;
let result = await taskBiz.fuHuaQiTaskList(Uscc);
res.success(result);
}
/**
* 提交任务
* @param req
* @param res
*/
async function submitTask(req, res) {
let reqConf = {taskType:'Number'};
let { taskType } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await taskBiz.checkTask(Uscc, taskType);
res.success(result);
}
/**
* 小程序端 孵化器入口 月度报表功能路由
*/
import * as asyncHandler from 'express-async-handler';
import * as monthBiz from '../../biz/fuHuqQi/month';
import { checkReqParam } from '../../util/tools';
import { checkFuHuaQiToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/month/addreport', checkFuHuaQiToken, asyncHandler(addReport));
httpServer.post('/fuhuaqi/month/updatereport', checkFuHuaQiToken, asyncHandler(updateReport));
httpServer.post('/fuhuaqi/month/deletereport', checkFuHuaQiToken, asyncHandler(deleteReport));
httpServer.post('/fuhuaqi/month/select', checkFuHuaQiToken, asyncHandler(selectMonthInfo));
}
/**
* 孵化器月度填报 新增报表
* @param req
* @param res
*/
async function addReport(req, res) {
let reqConf = {occupancyRate: 'Number' };
let { occupancyRate } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let monthInfo = monthBiz.createReport(Uscc, occupancyRate);
res.success(monthInfo);
}
/**
* 孵化器月度填报 删除报表
* @param req
* @param res
*/
async function deleteReport(req, res) {
const Uscc = req.headers.uscc;
let monthInfo = monthBiz.deleteReport(Uscc);
res.success(monthInfo);
}
/**
* 查询月度报表信息
* @param req
* @param res
*/
async function selectMonthInfo(req, res) {
const Uscc = req.headers.uscc;
let result = await monthBiz.getMonthByUscc(Uscc);
res.success(result);
}
/**
* 孵化器月度填报 修改报表
* @param req
* @param res
*/
async function updateReport(req, res) {
let reqConf = {occupancyRate: 'Number' };
let { occupancyRate } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let monthInfo = monthBiz.updateReport(Uscc, occupancyRate);
res.success(monthInfo);
}
\ No newline at end of file
/**
* 小程序端 孵化器入口 用户基础功能路由
*/
import * as asyncHandler from 'express-async-handler';
import * as userBiz from '../../biz/fuHuqQi/user';
import { checkReqParam } from '../../util/tools';
import { checkFuHuaQiToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/login', asyncHandler(login));
httpServer.post('/fuhuaqi/logout', checkFuHuaQiToken, asyncHandler(logout));
httpServer.post('/fuhuaqi/login/firstupdate', checkFuHuaQiToken, asyncHandler(firstUpdatePwd));
}
/**
* 孵化器登录
* @param req
* @param res
*/
async function login(req, res) {
let reqConf = {uscc:'String', pwd:'String'};
let {uscc, pwd} = checkReqParam(reqConf, req.body);
let result = await userBiz.login(uscc, pwd);
res.success(result);
}
/**
* 孵化器退出登录
* @param req
* @param res
*/
async function logout(req, res) {
const Uscc = req.headers.uscc;
let result = await userBiz.logout(Uscc);
res.success(result);
}
/**
* 孵化器首次登录
* @param req
* @param res
*/
async function firstUpdatePwd(req, res) {
let reqConf = {confirmPwd:'String', pwd:'String', };
let {confirmPwd, pwd} = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await userBiz.firstLoginChangePwd(Uscc, pwd, confirmPwd);
res.success(result);
}
\ No newline at end of file
......@@ -2,13 +2,29 @@
* 总路由入口
*/
import * as adminRouters from './admin'
import * as fuhuaqiRouters from './fuhuaqi'
import * as publicRouters from './public'
import * as publicRouters from './public';
import * as mobileClientEnterpriseRouters from './mobileClient/enterprise';
import * as mobileClientFinancingRouters from './mobileClient/financing';
import * as mobileClientFuHuaQiRouters from './mobileClient/fuHuaQi';
import * as mobileClientMonthRouters from './mobileClient/month';
import * as mobileClientUserRouters from './mobileClient/user';
import * as adminEnterpriseRouters from './admin/enterprise';
import * as adminFuHuaQiRouters from './admin/fuHuaQi';
import * as adminUserRouters from './admin/user';
export function setRouter(httpServer){
adminRouters.setRouter(httpServer);
fuhuaqiRouters.setRouter(httpServer);
/**下拉框等公用 路由 */
publicRouters.setRouter(httpServer);
/**小程序端 孵化器入口路由 */
mobileClientEnterpriseRouters.setRouter(httpServer);
mobileClientFinancingRouters.setRouter(httpServer);
mobileClientFuHuaQiRouters.setRouter(httpServer);
mobileClientMonthRouters.setRouter(httpServer);
mobileClientUserRouters.setRouter(httpServer);
/**管理后台端 入口路由 */
adminEnterpriseRouters.setRouter(httpServer);
adminFuHuaQiRouters.setRouter(httpServer);
adminUserRouters.setRouter(httpServer);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment