egg.js 相关
egg-swagger-doc
1. 安装
npm i egg-swagger-doc --save
// {app_root}/config/plugin.js exports.swaggerdoc = { enable: true, package: 'egg-swagger-doc', };
// {app_root}/config/config.default.js exports.swaggerdoc = { dirScanner: './app/controller', apiInfo: { title: 'egg-swagger', description: 'swagger-ui for egg', version: '1.0.0', }, schemes: ['http', 'https'], consumes: ['application/json'], produces: ['application/json'], securityDefinitions: { // apikey: { // type: 'apiKey', // name: 'clientkey', // in: 'header', // }, // oauth2: { // type: 'oauth2', // tokenUrl: 'http://petstore.swagger.io/oauth/dialog', // flow: 'password', // scopes: { // 'write:access_token': 'write access_token', // 'read:access_token': 'read access_token', // }, // }, }, enableSecurity: false, // enableValidate: true, routerMap: false, enable: true, };
地址:https://github.com/Yanshijie-EL/egg-swagger-doc#readme
egg sequelize 建表规范
CREATE TABLE `wx_member` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', `openid` varchar(30) DEFAULT NULL COMMENT 'openid', `session_key` varchar(30) DEFAULT NULL COMMENT 'session_key', `status` int(1) DEFAULT 1 COMMENT 'status', `createdAt` datetime DEFAULT NULL COMMENT 'created time', `updatedAt` datetime DEFAULT NULL COMMENT 'updated time', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='wx_member';
sequelize 常用API
https://blog.csdn.net/lvyuan1234/article/details/87010463
https://blog.csdn.net/lvyuan1234/article/details/84939186
egg项目部署及PM2
https://blog.csdn.net/clearlxj/article/details/88708709
.