import { Post } from "egg-shell-decorators";
|
import BaseController from "../../baseController";
|
|
/**
|
* 微店 - 接口设置
|
*/
|
export default class BasicInfoController extends BaseController {
|
//#region 获取accessToken
|
@Post()
|
public async getAccessToken() {
|
let { ctx } = this;
|
|
try {
|
this.info = await ctx.service.interface.weidian.basicInfo.getaccessToken();
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = error.message;
|
}
|
ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region 获取物料信息
|
@Post()
|
public async getProduct() {
|
let { ctx } = this;
|
|
try {
|
this.info = await ctx.service.interface.weidian.basicInfo.getProduct();
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = error.message;
|
}
|
ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region 获取订单信息
|
@Post()
|
public async getOrder() {
|
let { ctx } = this;
|
|
try {
|
this.info = await ctx.service.interface.weidian.basicInfo.getOrder();
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = error.message;
|
}
|
ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region 获取订单信息
|
@Post()
|
public async getOrderQuery() {
|
let { ctx } = this;
|
|
try {
|
this.info = await ctx.service.interface.weidian.basicInfo.getOrderQuery();
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = error.message;
|
}
|
ctx.body = this.info;
|
}
|
//#endregion
|
}
|