123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 'use strict';
- /**
- *
- * 附件
- * @author Ellisran
- * @date 2019/1/11
- * @version
- */
- module.exports = app => {
- class ChangeAtt extends app.BaseService {
- /**
- * 构造函数
- *
- * @param {Object} ctx - egg全局变量
- * @return {void}
- */
- constructor(ctx) {
- super(ctx);
- this.tableName = 'change_attachment';
- }
- /**
- * 添加附件
- * @param data
- * @param fileData
- */
- async save(postData, fileData, uid) {
- const data = {
- tid: postData.tid,
- cid: postData.cid,
- uid: uid,
- };
- Object.assign(data, fileData);
- const result = await this.db.insert(this.tableName, data);
- return result;
- }
- }
- return ChangeAtt;
- };
|