123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 'use strict';
- const auditConst = require('../const/audit');
- /**
- * 附件表 数据模型
- * @author LanJianRong
- * @date 2020/8/17
- * @version
- */
- module.exports = app => {
- class AdvanceFile extends app.BaseService {
- /**
- * 构造函数
- * @param {Object} ctx - egg全局变量
- * @return {void}
- */
- constructor(ctx) {
- super(ctx);
- this.tableName = 'advance_file';
- }
- /**
- * 获取文件
- * @param {*} payload 载荷|查询条件
- */
- async getAdvanceFiles(payload) {
- return this.db.select(this.tableName, payload);
- }
- /**
- * 存储上传的文件信息至数据库
- * @param {Array} payload 载荷
- * @return {Promise<void>} 数据库插入执行实例
- */
- async saveFileMsgToDb(payload) {
- return await this.db.insert(this.tableName, payload);
- }
- /**
- * 删除附件
- * @param {Number} id - 附件id
- * @return {void}
- */
- async delete(id) {
- return await this.deleteById(id);
- }
- }
- return AdvanceFile;
- };
|