yqb-cli
v1.0.8-beta
Published
```bash # Install deps $ npm install -g yqb-cli # # start $ yqbgen start # (1) ? 请输入配置文件地址:D:\workspace\Yqb\iData\src\init.config.ts # (2) ? 选择Server # dispService # > portalServer # switchCenter # dataQuality # (3) ? 选择生
Downloads
19
Readme
Services,Actions,Models 生成小工具
Getting Started
# Install deps
$ npm install -g yqb-cli
#
# start
$ yqbgen start
# (1) ? 请输入配置文件地址:D:\workspace\Yqb\iData\src\init.config.ts
# (2) ? 选择Server
# dispService
# > portalServer
# switchCenter
# dataQuality
# (3) ? 选择生成文件类型
# All(Actions, Services, Models)
# > Actions
# Services
# Models
# >>>>>>>>>>>>>>>>>>>> [ Select All 【需要输入项目地址】 ] >>>>>>>>>>>>>>>>>>>>
#
# (4-1) ? 请输入生成文件项目路径:eg:D:/workspace/mis2/src/: D:\workspace\Yqb\iData\src
# >>>> 将在 D:\workspace\Yqb\iData\src\actions\ 目录下生成actions文件
# >>>> 将在 D:\workspace\Yqb\iData\src\services\ 目录下生成services文件
# >>>> 将在 D:\workspace\Yqb\iData\src\models\ 目录下生成models文件
#
# >>>>>>> [ Select Acctions\Services\Models 【需要输入对应文件夹地址】 ] >>>>>>>
#
# (4-2) ? 请输入生成Actions的路径:eg:D:/workspace/mis2/src/actions: D:\workspace\Yqb\iData\src\actions
# >>>> 将在 D:\workspace\Yqb\iData\src\actions\ 目录下生成actions文件
#
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [ Success ] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#
# 即将在:D:\workspace\Yqb\iData\src\actions\portalServer 生成Actions文件
# D:\workspace\Yqb\iData\src\actions\portalServer\news.ts ,文件生成成功
# D:\workspace\Yqb\iData\src\actions\portalServer\user.ts ,文件生成成功
# D:\workspace\Yqb\iData\src\actions\portalServer\manager.ts ,文件生成成功
# D:\workspace\Yqb\iData\src\actions\portalServer\menu.ts ,文件生成成功
#
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [ Error ] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#
# D:\workspace\Yqb\iData\src\actions\portalServer, 已经存在
# 选择推出或者重新选择需要生成文件的Server
# 选择推出或重新从(2) 开始选择
配置文件说明
- 文件类型支持 .ts | .js
- 文件必须包含默认导出配置对象,即 export default config 或 export['default'] = config; // config 为配置对象
interface config {
[K: string]: any;
api: {
[serverName: string]: {
[controllerName: string]: {
[methodName: string]: string; // string 的格式为 'GET|POST /methodurl'
};
};
};
}
const config: config = {
name: "",
xxx: "",
api: {
dispService: {
qy: {
getHdAppUrl: `GET /api/disp-service/qy/getHdAppUrl`,
getThemeList: `GET /api/disp-service/qy/getThemeList`,
getDolList: `GET /api/disp-service/qy/getDolList`
},
op: {
rerun: `GET /api/disp-service/op/rerun`,
succeed: `GET /api/disp-service/op/succeed`,
fail: `GET /api/disp-service/op/fail`,
rerunBranch: `POST /api/disp-service/op/rerunBranch`,
modifyStart: `GET /api/disp-service/op/modifyStart`,
saveTaskConf: `POST /api/disp-service/op/saveTaskConf`,
rmTask: `GET /api/disp-service/op/rmTask`
}
}
}
};