webstorm模板

vscode模板

image.png

egg controller

  1. 'use strict';
  2. const { Controller } = require("egg");
  3. class UserController extends Controller {
  4. async echo() {
  5. }
  6. }
  7. module.exports = UserController;

egg service

  1. 'use strict';
  2. const { Service } = require('egg');
  3. class UserService extends Service {
  4. async echo() {
  5. }
  6. }
  7. module.exports = UserService;

egg config

  1. 'use strict';
  2. module.exports = appInfo => {
  3. const config = {};
  4. /**
  5. * @member Config#
  6. * @property {String} KEY - description
  7. */
  8. config. = {
  9. };
  10. return config;
  11. };

egg plugin

  1. exports. = {
  2. enable: true,
  3. package: '',
  4. };