phoneMessage.js 704 B

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.intelligentDocking.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. class PhoneMessageController extends Controller {
  7. constructor(ctx) {
  8. super(ctx);
  9. this.service = this.ctx.service.phoneMessage;
  10. }
  11. // 验证码
  12. async sendMessage() {
  13. const res = await this.service.sendMessage(this.ctx.request.body);
  14. this.ctx.ok({ data: res });
  15. }
  16. // OCR
  17. async getMessage() {
  18. const res = await this.service.getMessage(this.ctx.request.body);
  19. this.ctx.ok(res);
  20. }
  21. }
  22. module.exports = CrudController(PhoneMessageController, meta);