12345678910111213141516171819202122232425262728293031323334 |
- 'use strict';
- const _ = require('lodash');
- const meta = require('./.managemoney.js');
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 理财产品
- class ManageMoneyController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.managemoney;
- }
- //修改前要请求的接口(判断是否是发布过的内容: 如果发布过 不可修改 ; 未发布 可修改)
- async orUpdate(){
- const res = await this.service.getOrUpdate(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
-
- //获取理财产品列表
- async mmoneyList(){
- const res = await this.service.getMoneyList(this.ctx.request.body);
- this.ctx.ok({ ...res });
- }
- //理财产品发布(0-未发布,1-发布)
- async publish(){
- const res = await this.service.makePublish(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- }
- module.exports = CrudController(ManageMoneyController, meta);
|