diff --git a/api/app/lib/controllers/departmentTrain/index.js b/api/app/lib/controllers/departmentTrain/index.js new file mode 100644 index 0000000..8750087 --- /dev/null +++ b/api/app/lib/controllers/departmentTrain/index.js @@ -0,0 +1,18 @@ +'use strict'; +async function getDepartmentTrainRecordList(ctx) { + try { + ctx.status = 200; + ctx.body = {}; + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + message: '查询部门培训记录列表失败' + } + } + +} + +module.exports = { + getDepartmentTrainRecordList +} diff --git a/api/app/lib/models/dept_training.js b/api/app/lib/models/dept_training.js new file mode 100644 index 0000000..302b399 --- /dev/null +++ b/api/app/lib/models/dept_training.js @@ -0,0 +1,124 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const DeptTraining = sequelize.define("deptTraining", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true + }, + departmentName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "departmentname", + autoIncrement: false + }, + trainingType: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "trainingtype", + autoIncrement: false + }, + trainDate: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "traindate", + autoIncrement: false + }, + trainContent: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "traincontent", + autoIncrement: false + }, + trainWho: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "trainwho", + autoIncrement: false + }, + trainer: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "trainer", + autoIncrement: false + }, + trainMethod: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "trainmethod", + autoIncrement: false + }, + appraisalMethod: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "appraisalmethod", + autoIncrement: false + }, + trainTime: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "traintime", + autoIncrement: false + }, + attachPath: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "attachpath", + autoIncrement: false + }, + origin: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "origin", + autoIncrement: false + } + }, { + tableName: "dept_training", + comment: "", + indexes: [] + }); + dc.models.DeptTraining = DeptTraining; + return DeptTraining; +}; \ No newline at end of file diff --git a/api/app/lib/routes/departmentTrain/index.js b/api/app/lib/routes/departmentTrain/index.js new file mode 100644 index 0000000..d8458e5 --- /dev/null +++ b/api/app/lib/routes/departmentTrain/index.js @@ -0,0 +1,9 @@ +'use strict'; + +const departmentTrain = require('../../controllers/departmentTrain'); + +module.exports = function (app, router, opts) { + + app.fs.api.logAttr['GET/department/train/record/list'] = { content: '查询部门培训记录列表', visible: true }; + router.get('/department/train/record/list', departmentTrain.getDepartmentTrainRecordList); +}; \ No newline at end of file