'use strict'; const Controller = require('egg').Controller; class UserController extends Controller { //用户登陆 async login() { let { ctx } = this; let res = await ctx.service.users.login(ctx.request.body); ctx.body = res ctx.status = 200 } //新增用户 async addUser() { let { ctx } = this; let res = await ctx.service.users.addUser(ctx.request.body); ctx.body = res } // //修改用户 // async updateUser() { // let { ctx } = this; // let id = await ctx.service.users.updateUser(ctx.request.body); // ctx.body = { // topic_id: id, // }; // } // //删除用户 // async delUser() { // let { ctx } = this; // let id = await ctx.service.users.delUser(ctx.request.body); // ctx.body = { // topic_id: id, // }; // } //获取用户列表 async getUserList() { let { ctx } = this; let res = await ctx.service.users.getUserList(ctx.request.body); ctx.body = res } //获取用户登录列表 async getUserLoginList() { let { ctx } = this; let res = await ctx.service.users.getUserLoginList(ctx.request.body); ctx.body = res } } module.exports = UserController;