phoneMessage.js 851 B

12345678910111213141516171819202122232425262728293031323334353637
  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. // 短信提醒
  17. async smsRemind() {
  18. const res = await this.service.smsRemind(this.ctx.request.body);
  19. this.ctx.ok({ data: res });
  20. }
  21. // OCR
  22. async getMessage() {
  23. const res = await this.service.getMessage(this.ctx.request.body);
  24. this.ctx.ok(res);
  25. }
  26. }
  27. module.exports = CrudController(PhoneMessageController, meta);