-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode-gear.mysql.js
44 lines (44 loc) · 1.5 KB
/
code-gear.mysql.js
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
37
38
39
40
41
42
43
44
module.exports = {
type: 'mysql',
database: {
host: '127.0.0.1',
port: 3306,
database: 'sampledb',
user: 'root',
password: '123456',
},
template: {
imports: './templates/imports.js',
target: './.generate',
templates: [
{
splitType: 1, // 1= table split每个table 一个文件 0 =所有的table 一个文件
path: './templates/vulcanEntity.art', //相对的模板路劲
targetFile: function (t) {
var arrParts = t.tableName.split('_');
var resArr = [];
resArr.push('./');
arrParts.forEach((a) => {
if (!a) {
return '';
}
var s = a.replace(
/\b(\w)(\w*)/g,
function ($0, $1, $2) {
return $1.toUpperCase() + $2.toLowerCase();
}
);
resArr.push(s);
});
resArr.push('.cs');
return resArr.join('');
},
extend: {
//额外的变量
nameSpace: 'Sample.Impl.Model',
baseModel: 'Sample.Impl.Model.BaseModel',
},
},
],
},
};