nsgm-cli 2.0.12 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +12 -12
- package/LICENSE +201 -201
- package/README.md +161 -161
- package/client/layout/index.tsx +248 -248
- package/client/redux/reducers.ts +4 -4
- package/client/redux/store.ts +50 -50
- package/client/redux/template/manage/actions.ts +190 -190
- package/client/redux/template/manage/reducers.ts +118 -118
- package/client/redux/template/manage/types.ts +24 -24
- package/client/service/template/manage.ts +96 -96
- package/client/styled/common.ts +60 -60
- package/client/styled/layout/index.ts +25 -25
- package/client/styled/template/manage.ts +51 -51
- package/client/utils/common.ts +89 -89
- package/client/utils/cookie.ts +51 -51
- package/client/utils/fetch.ts +25 -25
- package/client/utils/menu.tsx +27 -27
- package/client/utils/sso.ts +205 -205
- package/generation/.babelrc +10 -10
- package/generation/README.md +19 -19
- package/generation/app.js +2 -2
- package/generation/client/redux/reducers.ts +4 -4
- package/generation/client/utils/menu.tsx +27 -27
- package/generation/gitignore +4 -4
- package/generation/mysql.config.js +12 -12
- package/generation/next.config.js +6 -6
- package/generation/package.json +24 -24
- package/generation/project.config.js +13 -13
- package/generation/server/rest.js +23 -23
- package/generation/server/utils/common.js +6 -6
- package/generation/tsconfig.json +30 -30
- package/index.js +10 -10
- package/lib/args.d.ts +6 -6
- package/lib/args.js +53 -53
- package/lib/generate.d.ts +3 -3
- package/lib/generate.js +751 -751
- package/lib/index.d.ts +2 -2
- package/lib/index.js +272 -272
- package/lib/server/db.d.ts +5 -5
- package/lib/server/db.js +110 -110
- package/lib/server/graphql.d.ts +7 -7
- package/lib/server/graphql.js +119 -119
- package/lib/server/plugins/date.d.ts +5 -5
- package/lib/server/plugins/date.js +16 -16
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/mysql.config.js +14 -14
- package/next-env.d.ts +5 -5
- package/next.config.js +231 -231
- package/package.json +127 -126
- package/pages/_app.tsx +54 -54
- package/pages/_document.tsx +55 -55
- package/pages/index.tsx +68 -68
- package/pages/login.tsx +78 -78
- package/pages/template/manage.tsx +299 -278
- package/project.config.js +16 -16
- package/public/slbhealthcheck.html +9 -9
- package/scripts/shutdown.sh +9 -9
- package/scripts/startup.sh +34 -34
- package/server/apis/sso.js +43 -43
- package/server/apis/template.js +37 -17
- package/server/modules/template/resolver.js +225 -225
- package/server/modules/template/schema.js +33 -33
- package/server/rest.js +24 -24
- package/server/sql/template.sql +8 -8
- package/server/utils/common.js +6 -6
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
query: `
|
|
3
|
-
template(page: Int, pageSize: Int): Templates
|
|
4
|
-
templateGet(id: Int): Template
|
|
5
|
-
templateSearch(page: Int, pageSize: Int, data: TemplateSearchInput): Templates
|
|
6
|
-
`,
|
|
7
|
-
mutation: `
|
|
8
|
-
templateAdd(data: TemplateAddInput): Int
|
|
9
|
-
templateBatchAdd(datas: [TemplateAddInput]): Int
|
|
10
|
-
templateUpdate(id: Int, data: TemplateAddInput): Boolean
|
|
11
|
-
templateDelete(id: Int): Boolean
|
|
12
|
-
templateBatchDelete(ids: [Int]): Boolean
|
|
13
|
-
`,
|
|
14
|
-
subscription: ``,
|
|
15
|
-
type: `
|
|
16
|
-
type Template {
|
|
17
|
-
id: Int
|
|
18
|
-
name: String
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type Templates {
|
|
22
|
-
totalCounts: Int
|
|
23
|
-
items: [Template]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
input TemplateAddInput {
|
|
27
|
-
name: String
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
input TemplateSearchInput {
|
|
31
|
-
name: String
|
|
32
|
-
}
|
|
33
|
-
`
|
|
1
|
+
module.exports = {
|
|
2
|
+
query: `
|
|
3
|
+
template(page: Int, pageSize: Int): Templates
|
|
4
|
+
templateGet(id: Int): Template
|
|
5
|
+
templateSearch(page: Int, pageSize: Int, data: TemplateSearchInput): Templates
|
|
6
|
+
`,
|
|
7
|
+
mutation: `
|
|
8
|
+
templateAdd(data: TemplateAddInput): Int
|
|
9
|
+
templateBatchAdd(datas: [TemplateAddInput]): Int
|
|
10
|
+
templateUpdate(id: Int, data: TemplateAddInput): Boolean
|
|
11
|
+
templateDelete(id: Int): Boolean
|
|
12
|
+
templateBatchDelete(ids: [Int]): Boolean
|
|
13
|
+
`,
|
|
14
|
+
subscription: ``,
|
|
15
|
+
type: `
|
|
16
|
+
type Template {
|
|
17
|
+
id: Int
|
|
18
|
+
name: String
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type Templates {
|
|
22
|
+
totalCounts: Int
|
|
23
|
+
items: [Template]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
input TemplateAddInput {
|
|
27
|
+
name: String
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
input TemplateSearchInput {
|
|
31
|
+
name: String
|
|
32
|
+
}
|
|
33
|
+
`
|
|
34
34
|
}
|
package/server/rest.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const express = require('express')
|
|
2
|
-
const moment = require('moment')
|
|
3
|
-
const template = require('./apis/template')
|
|
4
|
-
|
|
5
|
-
const sso = require('./apis/sso')
|
|
6
|
-
|
|
7
|
-
const router = express.Router()
|
|
8
|
-
|
|
9
|
-
router.use((req, res, next) => {
|
|
10
|
-
const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl
|
|
11
|
-
console.log(moment().format('YYYY-MM-DD HH:mm:ss') + ' ' + fullUrl)
|
|
12
|
-
next()
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
router.use('/template', template)
|
|
16
|
-
|
|
17
|
-
router.use('/sso', sso)
|
|
18
|
-
|
|
19
|
-
router.get('/*', (req, res) => {
|
|
20
|
-
res.statusCode = 200
|
|
21
|
-
res.json({ name: 'REST' })
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
module.exports = router
|
|
1
|
+
const express = require('express')
|
|
2
|
+
const moment = require('moment')
|
|
3
|
+
const template = require('./apis/template')
|
|
4
|
+
|
|
5
|
+
const sso = require('./apis/sso')
|
|
6
|
+
|
|
7
|
+
const router = express.Router()
|
|
8
|
+
|
|
9
|
+
router.use((req, res, next) => {
|
|
10
|
+
const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl
|
|
11
|
+
console.log(moment().format('YYYY-MM-DD HH:mm:ss') + ' ' + fullUrl)
|
|
12
|
+
next()
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
router.use('/template', template)
|
|
16
|
+
|
|
17
|
+
router.use('/sso', sso)
|
|
18
|
+
|
|
19
|
+
router.get('/*', (req, res) => {
|
|
20
|
+
res.statusCode = 200
|
|
21
|
+
res.json({ name: 'REST' })
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
module.exports = router
|
package/server/sql/template.sql
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
use crm_demo;
|
|
2
|
-
|
|
3
|
-
CREATE TABLE `template` (
|
|
4
|
-
`id` integer NOT NULL AUTO_INCREMENT COMMENT '主键',
|
|
5
|
-
`name` varchar(100) DEFAULT '' COMMENT '名称',
|
|
6
|
-
`create_date` TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
|
7
|
-
`update_date` TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间',
|
|
8
|
-
PRIMARY KEY (`id`)
|
|
1
|
+
use crm_demo;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE `template` (
|
|
4
|
+
`id` integer NOT NULL AUTO_INCREMENT COMMENT '主键',
|
|
5
|
+
`name` varchar(100) DEFAULT '' COMMENT '名称',
|
|
6
|
+
`create_date` TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
|
7
|
+
`update_date` TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间',
|
|
8
|
+
PRIMARY KEY (`id`)
|
|
9
9
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
package/server/utils/common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const { serverDB } = require('../../index')
|
|
2
|
-
|
|
3
|
-
const { getConnection } = serverDB
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
getConnection
|
|
1
|
+
const { serverDB } = require('../../index')
|
|
2
|
+
|
|
3
|
+
const { getConnection } = serverDB
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
getConnection
|
|
7
7
|
}
|