12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 'use strict';
- const _ = require('lodash');
- const meta = require('./.user.js');
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 管理
- class UserController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.user;
- }
- async create() {
- const res = await this.service.create(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 学校注册
- async register() {
- const res = await this.service.register(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 学生微信绑定
- async bind() {
- const res = await this.service.bind(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 其他用户微信绑定
- async userbind() {
- const res = await this.service.userbind(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 学校用户生成
- async schoolregister() {
- const res = await this.service.schoolregister();
- this.ctx.ok({ data: res });
- }
- }
- module.exports = CrudController(UserController, meta);
|