'use strict'; const _ = require('lodash'); const meta = require('./.doctor.js'); const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose/lib/controller'); // 医生管理 class DoctorController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.doctor; } async update() { await this.service.update(this.ctx.params, this.ctx.request.body); this.ctx.ok({ msg: 'accepted' }); } // 根据openid 取得医生信息 async findopenid() { return await this.service.findByOpenid(this.ctx.query); } // 更新openid async updateopenid() { await this.service.updateopenid(this.ctx.params, this.ctx.request.body); this.ctx.ok({ msg: 'accepted' }); } } module.exports = CrudController(DoctorController, meta);