import BaseController from "../../baseController";
|
import { Post } from "egg-shell-decorators";
|
import { CmsContent } from "../../../entity/cms/module/cmsContent";
|
|
/**
|
* 客户端
|
*/
|
export default class ClientController extends BaseController {
|
//#region 获取新闻列表
|
/**
|
* 获取新闻列表
|
*/
|
@Post()
|
public async getNewsList() {
|
try {
|
var newsList = await this.dbRead.find(CmsContent, {
|
order: { createDate: "DESC" }
|
});
|
this.info.result = true;
|
this.info.data = newsList;
|
this.ctx.body = this.info;
|
return;
|
} catch (ex) {
|
let msg = "异常错误信息:" + ex.message;
|
this.info.result = false;
|
this.info.msg = msg;
|
this.ctx.body = this.info;
|
return;
|
}
|
}
|
//#endregion
|
|
//#region 获取新闻明细
|
/**
|
* 获取新闻明细
|
*/
|
@Post()
|
public async getNewsInfo() {
|
try {
|
var newInfo = await this.dbRead.findOne(CmsContent, {
|
content_Id: this.body.content_Id
|
});
|
this.info.result = true;
|
this.info.data = newInfo;
|
} catch (ex) {
|
this.info.msg = ex.message;
|
this.info.result = false;
|
}
|
this.ctx.body = this.info;
|
return;
|
}
|
//#endregion
|
|
//#region IdCardDistinguish_Inner 身份证识别
|
@Post()
|
public async idCardUpload() {
|
try {
|
this.info = await this.ctx.service.tms.idCard.idCardUpload();
|
} catch (ex) {
|
this.info.result = false;
|
this.info.msg = "错误信息:" + ex.message;
|
}
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region addIdCard 上传身份证
|
@Post()
|
public async addIdCard() {
|
try {
|
this.info = await this.ctx.service.tms.idCard.addIdCard();
|
} catch (ex) {
|
this.info.result = false;
|
this.info.msg = "错误信息:" + ex.message;
|
}
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region getRouterList
|
/**
|
* 获取路由
|
*/
|
@Post()
|
public async getRouterList() {
|
let { ctx } = this;
|
let body = ctx.request.body;
|
if (!body.wayBillCode) {
|
this.info.result = false;
|
this.info.msg = "传递数据不正确";
|
this.info.statusCode = 301;
|
|
ctx.body = this.info;
|
return;
|
}
|
|
let _info = await this.service.tms.wayBillHelper.getWayBillInfo(body.wayBillCode);
|
this.logger.info("PC物流轨迹查询接口 - data:", body.wayBillCode, _info.result, _info.msg);
|
|
// 将数据转完小写
|
let info = ctx.helper.objectToCase(_info);
|
|
ctx.body = info;
|
}
|
|
//#endregion
|
}
|