import Base from './base' import { Context } from 'koa' import { App } from '../../types' import { TeambitionCommongroup } from '../../service/teambition-commongroup' export default class Commongroup extends Base { private clientCommongroup: TeambitionCommongroup constructor (app: App, ctx: Context) { super(app, ctx) this.clientCommongroup = new TeambitionCommongroup(this.app.token, this.ctx.header['cookie']) } /** * @author jiangwei * @desc 获取「需求分类」 列表 * * @param {*} _projectId * @returns * @memberof Commongroup */ async getCommongroupStoryList(_userId:string, _projectId: string) { const storySmartGroup = await this.app.db.smartgroup.findOne({ _projectId, type: 'story' }).select('_id').lean() const uniqueId = `_spaceId=${_projectId}&_appId=${storySmartGroup._id}` return this.clientCommongroup.getByUniqueId(_userId, uniqueId) } }