import { Controller } from 'egg' ; export default class ProjectController extends Controller { async addNewProject ( ) { const { ctx } = this ; ctx . body = await ctx . service . project . saveProjectData ( ctx ) ; } async updateProject ( ) { const { ctx } = this ; return await ctx . service . project . updateProjectData ( ctx ) ; } async getProjectsForUserId ( ) { const { ctx } = this ; ctx . body = await ctx . service . project . getProjectsForUserId ( ctx ) ; } async getProjectsForId ( ) { const { ctx } = this ; const query = ctx . request . query ; const appId = query . appId ; ctx . body = await ctx . service . project . getProjectForDb ( appId ) ; } async getWebProjectList ( ) { const { ctx } = this ; ctx . body = await ctx . service . project . getWebProjectList ( ) ; } async deleteWebProjectUser ( ) { const { ctx } = this ; ctx . body = await ctx . service . project . deleteWebProjectUser ( ctx ) ; } async addWebProjectUser ( ) { const { ctx } = this ; ctx . body = await ctx . service . project . addWebProjectUser ( ctx ) ; } async deleteProject ( ) { const { ctx } = this ; ctx . body = await ctx . service . project . deleteProject ( ctx ) ; } async handleDaliyEmail ( ) { const { ctx } = this ; const query = ctx . request . body ; const appId = query . appId ; const email = query . email ; const type = query . type || 1 ; const item = query . item || 1 ; ctx . body = await ctx . service . project . handleDaliyEmail ( appId , email , type , true , item ) ; } }