| 12345678910111213141516171819202122232425262728293031323334 |
- 'use strict';
- /**
- *
- *
- * @author Mai
- * @date 2018/4/23
- * @version
- */
- module.exports = app => {
- class TemplateParam extends app.BaseService {
- /**
- * 构造函数
- *
- * @param {Object} ctx - egg全局context
- * @return {void}
- */
- constructor(ctx) {
- super(ctx);
- this.tableName = 'template_param';
- }
- async importData(datas, transaction) {
- await transaction.delete(this.tableName, {template_id: 1});
- const insertResult = await transaction.insert(this.tableName, datas);
- if (insertResult.affectedRows !== datas.length) {
- throw '导入指标参数错误';
- }
- }
- };
- return TemplateParam;
- };
|