claimneed.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.claimneed.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 债权需求
  7. class ClaimNeedController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.claimneed;
  11. }
  12. //根据金融机构查询债权需求(列表)--分为指向(传金融机构ID)和非指向(不用传)
  13. async fclaim() {
  14. const res = await this.service.getFclaim(this.ctx.request.body);
  15. this.ctx.ok({...res });
  16. }
  17. //根据企业用户查询
  18. async qyclaim() {
  19. const res = await this.service.getQyclaim(this.ctx.request.body);
  20. this.ctx.ok({ ...res });
  21. }
  22. //金融机构关注债权需求
  23. async followclaim() {
  24. const res = await this.service.getFollowClaim(this.ctx.request.body);
  25. this.ctx.ok({ data: res });
  26. }
  27. //债权需求详情
  28. async one() {
  29. const res = await this.service.getOne(this.ctx.request.body);
  30. this.ctx.ok({ data: res });
  31. }
  32. //关注前请求的接口
  33. async beforFollow() {
  34. const res = await this.service.getBeforFollow(this.ctx.request.body);
  35. this.ctx.ok({ data: res });
  36. }
  37. //小程序企业需求查询
  38. async littleqyclaim() {
  39. const res = await this.service.getLittleqyclaim(this.ctx.request.body);
  40. this.ctx.ok({ ...res });
  41. }
  42. }
  43. module.exports = CrudController(ClaimNeedController, meta);