wangzhibo
6 天以前 3f249e399659dcd09d3fe58071b146e50e45c17f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Inject, Provide } from '@midwayjs/core';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { AppFeedbackEntity } from '../entity/feedback';
 
/**
 * 意见反馈
 */
@Provide()
export class AppFeedbackService extends BaseService {
  @InjectEntityModel(AppFeedbackEntity)
  appFeedbackEntity: Repository<AppFeedbackEntity>;
 
  @Inject()
  ctx;
 
  /**
   * 提交
   * @param info
   */
  async submit(info: AppFeedbackEntity) {
    await this.appFeedbackEntity.insert(info);
  }
 
  /**
   * 更新
   * @param param
   */
  async update(param: AppFeedbackEntity) {
    if (param.status == 1) {
      param.handlerId = this.ctx.admin.userId;
    }
    await super.update(param);
  }
}