project.js 759 Bytes
/*
 * @Author: huyue 
 * @Date: 2021-09-02 14:42:42 
 * @Last Modified by: huyue
 * @Last Modified time: 2021-09-10 15:20:35
 */
// app/service/project.js

const Service = require('egg').Service
class ProjectService extends Service {
  constructor(ctx) {
    super(ctx);
    this.helper = ctx.helper;
    this._reg_models_alias_();
  }
  /**
   * 绑定model 在 this 上的 别名
   */
  _reg_models_alias_() {
    const {
      ProjectInfo
    } = this.app.model
    this.PI = ProjectInfo
  }

  async findAll({
    pager = {},
  }) {
    return await this.PI.findAll({
      attributes: ['id', 'project_title', 'project_description', 'developer_name', 'config_name', 'test_url', 'product_url', 'technology']
    });
  }
}

module.exports = ProjectService