import { default as BaseController } from "../../baseController";
|
import { Post } from "egg-shell-decorators";
|
import { BaseProductType } from "../../../entity/basicInfo/base/baseProductType";
|
|
export default class ProductTypeController extends BaseController {
|
//#region 获得所有类别列表
|
/**
|
* 获得所有类别列表
|
*/
|
@Post()
|
public async getList() {
|
let { ctx } = this;
|
let userInfo = await this.userInfo;
|
try {
|
let dataList = await this.dbRead.find(BaseProductType, {
|
select: ["type_Id", "typeName"],
|
where: {
|
userProduct_Id: userInfo.userProduct_Id
|
}
|
});
|
|
this.info.result = true;
|
this.info.data = dataList;
|
} catch (error) {
|
this.info.result = false;
|
this.info.data = error.message;
|
}
|
ctx.body = this.info;
|
}
|
//#endregion
|
}
|