import { Controller } from 'egg' ; export default class UserController extends Controller { public async index ( ) { const { ctx } = this ; ctx . body = { a : 1 } ; } async register ( ) { const { ctx } = this ; ctx . body = await ctx . service . user . register ( ctx ) ; } async login ( ) { const { ctx } = this ; ctx . body = await ctx . service . user . login ( ctx ) ; } async logout ( ) { const { ctx } = this ; ctx . body = await ctx . service . user . logout ( ctx ) ; } async setIsUse ( ) { const { ctx } = this ; ctx . body = await ctx . service . user . setIsUse ( ctx ) ; } async delete ( ) { const { ctx } = this ; ctx . body = await ctx . service . user . delete ( ctx ) ; } async currentUser ( ) { const { ctx } = this ; ctx . body = await ctx . service . user . currentUser ( ctx ) ; } }