Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
7fecf4df
Commit
7fecf4df
authored
Feb 25, 2018
by
xiandafu
Browse files
cod gen
parents
978bedb1
67bd0853
Changes
24
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
7fecf4df
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
*
admin-core ,核心包,包含了缓存,数据权限,公用的JS和HTML页面。
*
admin-core ,核心包,包含了缓存,数据权限,公用的JS和HTML页面。
*
admin-console, 系统管理功能,包含了用户,组织机构,角色,权限,数据权限,代码生成等管理功能
*
admin-console, 系统管理功能,包含了用户,组织机构,角色,权限,数据权限,代码生成等管理功能
com.ibeetl.admin.CosonleApplication 是系统启动类,在admin-console包下,在运行这个之前,还需要初始化数据库,位于doc/starter-mysql.sql,目前只提供mysql脚本。理论上支持所有数据库
com.ibeetl.admin.CosonleApplication 是系统启动类,在admin-console包下,在运行这个之前,还需要初始化数据库,位于doc/starter-mysql.sql,目前只提供mysql
和oracle
脚本。理论上支持所有数据库
还需要修改SpringBoot配置文件application.properties,修改你的数据库地址和访问用户
还需要修改SpringBoot配置文件application.properties,修改你的数据库地址和访问用户
...
@@ -32,14 +32,14 @@ com.ibeetl.admin.CosonleApplication 是系统启动类,在admin-console包下,
...
@@ -32,14 +32,14 @@ com.ibeetl.admin.CosonleApplication 是系统启动类,在admin-console包下,
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/starter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/starter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
123456
spring.datasource.password
=
123456
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
~~~
~~~
运行CosonleApplication,然后访问http://127.0.0.1:8080/ 输入admin/123456 则可以直接登录进入管理系统
运行CosonleApplication,然后访问http://127.0.0.1:8080/ 输入admin/123456 则可以直接登录进入管理系统
> 建议在彻底熟悉plus系统之前,先暂时不要修改其他配置选项,免得系统无法访问
> 建议在彻底熟悉plus系统之前,先暂时不要修改其他配置选项,免得系统无法访问
>
>
> 本系统基于Spring Boot 2 ,因此请务必使用JDK8,且打开编译选项[parameters](http
s
://www.
liaoxuefeng.com/article/00141999088629621039ee8c4614579bfedb78a5030bce3000
)
> 本系统基于Spring Boot 2 ,因此请务必使用JDK8,且打开编译选项[parameters](http://www.
mamicode.com/info-detail-2162647.html
)
## 1.2 创建子系统
## 1.2 创建子系统
...
@@ -173,5 +173,21 @@ public class CMSApplication extends SpringBootServletInitializer implements Web
...
@@ -173,5 +173,21 @@ public class CMSApplication extends SpringBootServletInitializer implements Web
在介绍如何利用Plus开发系统之前,先介绍代码生成功能,此功能可以生成前后端代码总计14个文件,你可以通过预览功能了解如何开发这个系统
在介绍如何利用Plus开发系统之前,先介绍代码生成功能,此功能可以生成前后端代码总计14个文件,你可以通过预览功能了解如何开发这个系统
待续....
> 如果你用eclipse直接在开发平台上代码生成,默认会生成到console工程下,如果你用IDEA,由于这个时候user.dir设置在了parent maven上,因此生成的目录不对 .建议你使用1.2 创建子系统方式来使用本开发平台而不要直接操作开发平台,或者直接修改MavenProjectTarget.getRootPath。开发平台定位是所你的所有系统的基础平台,不建议上面有你的业务代码

代码生成针对表进行代码生成,包括JS,JAVA,SQL和HTML,可以通过预览功能直接预览。在生成代码到本地前,有写参数需要修改,否则,代码生成后显示的都是英文
*
显示字段 : 当此实体显示在任何地方的时候,能代表此实体的名称,比如用户名,组织机构名
*
变量名:可以自己设定一个较短的名字,此变量名会用于前后端的变量
*
urlBase:你规划的子系统,最后访问路径是urlBase+变量名字
*
system: 存放sql目录的的名称
其他修改的地方有
字段信息的显示名字,这个用于前端列表,表单的显示,应当输入中文名字
作为搜索,可以勾选几个搜索条件,系统自动生成一个搜索配置类
\ No newline at end of file
admin-console/pom.xml
View file @
7fecf4df
...
@@ -12,12 +12,7 @@
...
@@ -12,12 +12,7 @@
</parent>
</parent>
<dependencies>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<dependency>
<groupId>
com.ibeetl
</groupId>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-core
</artifactId>
<artifactId>
admin-core
</artifactId>
...
...
admin-console/src/main/java/com/ibeetl/admin/console/entity/CmsBlog.java
View file @
7fecf4df
...
@@ -17,7 +17,7 @@ import com.ibeetl.admin.core.entity.BaseEntity;
...
@@ -17,7 +17,7 @@ import com.ibeetl.admin.core.entity.BaseEntity;
/*
/*
*
*
* gen by Spring Boot2 Admin 2018-02-
17
* gen by Spring Boot2 Admin 2018-02-
24
*/
*/
public
class
CmsBlog
extends
BaseEntity
{
public
class
CmsBlog
extends
BaseEntity
{
...
...
admin-console/src/main/java/com/ibeetl/admin/console/web/CmsBlogController.java
View file @
7fecf4df
...
@@ -40,6 +40,7 @@ public class CmsBlogController{
...
@@ -40,6 +40,7 @@ public class CmsBlogController{
@GetMapping
(
MODEL
+
"/index.do"
)
@GetMapping
(
MODEL
+
"/index.do"
)
@Function
(
"cmsBlog.query"
)
@Function
(
"cmsBlog.query"
)
@ResponseBody
public
ModelAndView
index
()
{
public
ModelAndView
index
()
{
ModelAndView
view
=
new
ModelAndView
(
"/admin/cmsBlog/index.html"
)
;
ModelAndView
view
=
new
ModelAndView
(
"/admin/cmsBlog/index.html"
)
;
view
.
addObject
(
"search"
,
CmsBlogQuery
.
class
.
getName
());
view
.
addObject
(
"search"
,
CmsBlogQuery
.
class
.
getName
());
...
@@ -48,7 +49,8 @@ public class CmsBlogController{
...
@@ -48,7 +49,8 @@ public class CmsBlogController{
@GetMapping
(
MODEL
+
"/edit.do"
)
@GetMapping
(
MODEL
+
"/edit.do"
)
@Function
(
"cmsBlog.edit"
)
@Function
(
"cmsBlog.edit"
)
public
ModelAndView
edit
(
Long
id
)
{
@ResponseBody
public
ModelAndView
edit
(
Integer
id
)
{
ModelAndView
view
=
new
ModelAndView
(
"/admin/cmsBlog/edit.html"
);
ModelAndView
view
=
new
ModelAndView
(
"/admin/cmsBlog/edit.html"
);
CmsBlog
cmsBlog
=
cmsBlogService
.
queryById
(
id
);
CmsBlog
cmsBlog
=
cmsBlogService
.
queryById
(
id
);
view
.
addObject
(
"cmsBlog"
,
cmsBlog
);
view
.
addObject
(
"cmsBlog"
,
cmsBlog
);
...
@@ -57,6 +59,7 @@ public class CmsBlogController{
...
@@ -57,6 +59,7 @@ public class CmsBlogController{
@GetMapping
(
MODEL
+
"/add.do"
)
@GetMapping
(
MODEL
+
"/add.do"
)
@Function
(
"cmsBlog.add"
)
@Function
(
"cmsBlog.add"
)
@ResponseBody
public
ModelAndView
add
()
{
public
ModelAndView
add
()
{
ModelAndView
view
=
new
ModelAndView
(
"/admin/cmsBlog/add.html"
);
ModelAndView
view
=
new
ModelAndView
(
"/admin/cmsBlog/add.html"
);
return
view
;
return
view
;
...
@@ -77,7 +80,7 @@ public class CmsBlogController{
...
@@ -77,7 +80,7 @@ public class CmsBlogController{
@PostMapping
(
MODEL
+
"/add.json"
)
@PostMapping
(
MODEL
+
"/add.json"
)
@Function
(
"cmsBlog.add"
)
@Function
(
"cmsBlog.add"
)
@ResponseBody
@ResponseBody
public
JsonResult
add
CmsBlog
(
@Validated
(
ValidateConfig
.
ADD
.
class
)
CmsBlog
cmsBlog
)
public
JsonResult
add
(
@Validated
(
ValidateConfig
.
ADD
.
class
)
CmsBlog
cmsBlog
)
{
{
cmsBlogService
.
save
(
cmsBlog
);
cmsBlogService
.
save
(
cmsBlog
);
return
new
JsonResult
().
success
();
return
new
JsonResult
().
success
();
...
@@ -100,8 +103,8 @@ public class CmsBlogController{
...
@@ -100,8 +103,8 @@ public class CmsBlogController{
@GetMapping
(
MODEL
+
"/view.json"
)
@GetMapping
(
MODEL
+
"/view.json"
)
@Function
(
"cmsBlog.query"
)
@Function
(
"cmsBlog.query"
)
@ResponseBody
@ResponseBody
public
JsonResult
<
CmsBlog
>
queryInfo
(
Long
id
)
{
public
JsonResult
<
CmsBlog
>
queryInfo
(
Integer
id
)
{
CmsBlog
cmsBlog
=
cmsBlogService
.
queryById
(
id
);
CmsBlog
cmsBlog
=
cmsBlogService
.
queryById
(
id
);
return
JsonResult
.
success
(
cmsBlog
);
return
JsonResult
.
success
(
cmsBlog
);
}
}
...
...
admin-console/src/main/resources/application.properties
View file @
7fecf4df
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/starter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/starter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
123456
spring.datasource.password
=
123456
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
# 1,1 是管理员密码,相当于启动后就登录,方便测试,系统需要取消这俩个配置
# 1,1 是管理员密码,相当于启动后就登录,方便测试,系统需要取消这俩个配置
user.id
=
1
user.id
=
1
user.orgId
=
1
user.orgId
=
1
...
@@ -17,6 +17,7 @@ server.port=8080
...
@@ -17,6 +17,7 @@ server.port=8080
#html视图交给beetl渲染
#html视图交给beetl渲染
beetl.suffix
=
html
beetl.suffix
=
html
beetlsql.dbStyle
=
org.beetl.sql.core.db.MySqlStyle
beetlsql.dbStyle
=
org.beetl.sql.core.db.MySqlStyle
#beetlsql.basePackage=com.ibeetl,com.xxx.yourpackage
beetlsql.basePackage
=
com.ibeetl
beetlsql.basePackage
=
com.ibeetl
app.name
=
Spring Boot开发平台
app.name
=
Spring Boot开发平台
logging.pattern.console
=
%-4relative [%thread] %-5level %logger{256} %M %L - %msg%n
logging.pattern.console
=
%-4relative [%thread] %-5level %logger{256} %M %L - %msg%n
\ No newline at end of file
admin-console/src/main/resources/sql/console/cmsBlog.md
View file @
7fecf4df
...
@@ -10,9 +10,6 @@ queryByCondition
...
@@ -10,9 +10,6 @@ queryByCondition
where 1=1
where 1=1
@//数据权限,该sql语句功能点
@//数据权限,该sql语句功能点
and #function("cmsBlog.query")#
and #function("cmsBlog.query")#
@if(!isEmpty(id)){
and t.id =#id#
@}
...
@@ -22,5 +19,5 @@ batchDelCmsBlogByIds
...
@@ -22,5 +19,5 @@ batchDelCmsBlogByIds
*
批量逻辑删除
*
批量逻辑删除
update cms_blog set del_flag = 1 where id in( #join(ids)#)
update cms_blog set del_flag = 1 where id
in( #join(ids)#)
admin-console/src/main/resources/static/js/admin/cmsBlog/add.js
0 → 100644
View file @
7fecf4df
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
,
'
cmsBlogApi
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
cmsBlogApi
=
layui
.
cmsBlogApi
;
var
index
=
layui
.
index
;
var
view
=
{
init
:
function
(){
Lib
.
initGenrealForm
(
$
(
"
#addForm
"
),
form
);
this
.
initSubmit
();
},
initSubmit
:
function
(){
$
(
"
#addButton
"
).
click
(
function
(){
cmsBlogApi
.
addCmsBlog
(
$
(
'
#addForm
'
),
function
(){
parent
.
window
.
dataReload
();
Common
.
info
(
"
添加成功
"
);
Lib
.
closeFrame
();
});
});
$
(
"
#addButton-cancel
"
).
click
(
function
(){
Lib
.
closeFrame
();
});
}
}
exports
(
'
add
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/cmsBlog/cmsBlogApi.js
0 → 100644
View file @
7fecf4df
/*访问后台的代码*/
layui
.
define
([],
function
(
exports
)
{
var
api
=
{
updateCmsBlog
:
function
(
form
,
callback
){
Lib
.
submitForm
(
"
/admin/cmsBlog/update.json
"
,
form
,{},
callback
)
},
addCmsBlog
:
function
(
form
,
callback
){
Lib
.
submitForm
(
"
/admin/cmsBlog/add.json
"
,
form
,{},
callback
)
},
del
:
function
(
ids
,
callback
){
Common
.
post
(
"
/admin/cmsBlog/delete.json
"
,{
"
ids
"
:
ids
},
function
(){
callback
();
})
}
};
exports
(
'
cmsBlogApi
'
,
api
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/cmsBlog/del.js
0 → 100644
View file @
7fecf4df
layui
.
define
([
'
table
'
,
'
cmsBlogApi
'
],
function
(
exports
)
{
var
cmsBlogApi
=
layui
.
cmsBlogApi
;
var
table
=
layui
.
table
;
var
view
=
{
init
:
function
(){
},
delBatch
:
function
(){
var
data
=
Common
.
getMoreDataFromTable
(
table
,
"
cmsBlogTable
"
);
if
(
data
==
null
){
return
;
}
Common
.
openConfirm
(
"
确认要删除这些CmsBlog?
"
,
function
(){
var
ids
=
Common
.
concatBatchId
(
data
,
"
id
"
);
cmsBlogApi
.
del
(
ids
,
function
(){
Common
.
info
(
"
删除成功
"
);
dataReload
();
})
})
}
}
exports
(
'
del
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/cmsBlog/edit.js
0 → 100644
View file @
7fecf4df
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
,
'
cmsBlogApi
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
cmsBlogApi
=
layui
.
cmsBlogApi
;
var
index
=
layui
.
index
;
var
view
=
{
init
:
function
(){
Lib
.
initGenrealForm
(
$
(
"
#updateForm
"
),
form
);
this
.
initSubmit
();
},
initSubmit
:
function
(){
$
(
"
#updateButton
"
).
click
(
function
(){
cmsBlogApi
.
updateCmsBlog
(
$
(
'
#updateForm
'
),
function
(){
parent
.
window
.
dataReload
();
Common
.
info
(
"
更新成功
"
);
Lib
.
closeFrame
();
});
});
$
(
"
#updateButton-cancel
"
).
click
(
function
(){
Lib
.
closeFrame
();
});
}
}
exports
(
'
edit
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/cmsBlog/index.js
0 → 100644
View file @
7fecf4df
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
table
=
layui
.
table
;
var
cmsBlogTable
=
null
;
var
view
=
{
init
:
function
(){
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
(){
Lib
.
doSearchForm
(
$
(
"
#searchForm
"
),
cmsBlogTable
,
form
)
}
},
initTable
:
function
(){
cmsBlogTable
=
table
.
render
({
elem
:
'
#cmsBlogTable
'
,
height
:
Lib
.
getTableHeight
(
1
),
method
:
'
post
'
,
url
:
Common
.
CTX
+
'
/admin/cmsBlog/list.json
'
// 数据接口
,
page
:
Lib
.
tablePage
// 开启分页
,
limit
:
10
,
cols
:
[
[
// 表头
{
type
:
'
checkbox
'
,
fixed
:
'
left
'
,
},
{
field
:
'
id
'
,
title
:
'
id
'
,
fixed
:
'
left
'
,
width
:
100
,
},
{
field
:
'
title
'
,
title
:
'
title
'
,
width
:
100
,
},
{
field
:
'
content
'
,
title
:
'
content
'
,
width
:
100
,
},
{
field
:
'
createTime
'
,
title
:
'
createTime
'
,
width
:
100
,
},
{
field
:
'
createUserId
'
,
title
:
'
createUserId
'
,
width
:
100
,
},
{
field
:
'
type
'
,
title
:
'
type
'
,
width
:
100
,
}
]
]
});
},
initSearchForm
:
function
(){
Lib
.
initSearchForm
(
$
(
"
#searchForm
"
),
cmsBlogTable
,
form
);
},
initToolBar
:
function
(){
toolbar
=
{
add
:
function
()
{
// 获取选中数据
var
url
=
"
/admin/cmsBlog/add.do
"
;
Common
.
openDlg
(
url
,
"
CmsBlog管理>新增
"
);
},
edit
:
function
()
{
// 获取选中数目
var
data
=
Common
.
getOneFromTable
(
table
,
"
cmsBlogTable
"
);
if
(
data
==
null
){
return
;
}
var
url
=
"
/admin/cmsBlog/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
CmsBlog管理>
"
+
data
.
title
+
"
>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
(){
var
delView
=
layui
.
del
delView
.
delBatch
();
});
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
}
exports
(
'
index
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/function/functionApi.js
View file @
7fecf4df
...
@@ -2,15 +2,13 @@
...
@@ -2,15 +2,13 @@
layui
.
define
([],
function
(
exports
)
{
layui
.
define
([],
function
(
exports
)
{
var
api
=
{
var
api
=
{
updateFunction
:
function
(
callback
){
updateFunction
:
function
(
callback
){
Lib
.
submitForm
(
$
(
'
#updateForm
'
),{},
callback
)
Lib
.
submitForm
(
"
/admin/function/update.json
"
,
$
(
'
#updateForm
'
),{},
callback
)
},
},
addFunction
:
function
(
callback
){
addFunction
:
function
(
callback
){
Lib
.
submitForm
(
$
(
'
#addForm
'
),{},
callback
)
Lib
.
submitForm
(
"
/admin/function/add.json
"
,
$
(
'
#addForm
'
),{},
callback
)
},
},
del
:
function
(
ids
,
callback
){
del
:
function
(
ids
,
callback
){
Common
.
post
(
"
/admin/function/batchDel.json
"
,{
"
ids
"
:
ids
},
function
(){
Common
.
post
(
"
/admin/function/batchDel.json
"
,{
"
ids
"
:
ids
},
callback
)
callback
();
})
}
}
...
...
admin-console/src/main/resources/static/js/admin/menu/menuApi.js
View file @
7fecf4df
...
@@ -2,15 +2,13 @@
...
@@ -2,15 +2,13 @@
layui
.
define
([],
function
(
exports
)
{
layui
.
define
([],
function
(
exports
)
{
var
api
=
{
var
api
=
{
updateMenu
:
function
(
callback
){
updateMenu
:
function
(
callback
){
Lib
.
submitForm
(
$
(
'
#updateForm
'
),{},
callback
)
Lib
.
submitForm
(
"
/admin/menu/update.json
"
,
$
(
'
#updateForm
'
),{},
callback
)
},
},
addMenu
:
function
(
callback
){
addMenu
:
function
(
callback
){
Lib
.
submitForm
(
$
(
'
#addForm
'
),{},
callback
)
Lib
.
submitForm
(
"
/admin/menu/save.json
"
,
$
(
'
#addForm
'
),{},
callback
)
},
},
del
:
function
(
ids
,
callback
){
del
:
function
(
ids
,
callback
){
Common
.
post
(
"
/admin/menu/batchDel.json
"
,{
"
ids
"
:
ids
},
function
(){
Common
.
post
(
"
/admin/menu/batchDel.json
"
,{
"
ids
"
:
ids
},
callback
)
callback
();
})
}
}
...
...
admin-console/src/main/resources/templates/admin/cmsBlog/add.html
View file @
7fecf4df
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/cmsBlog/"}){ -->
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/cmsBlog/"}){ -->
<form
class=
"layui-form layui-form-pane"
id=
"addForm"
<form
class=
"layui-form layui-form-pane"
id=
"addForm"
>
action=
"/admin/cmsBlog/save.json"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
...
@@ -71,5 +70,4 @@ layui.use(['add'], function(){
...
@@ -71,5 +70,4 @@ layui.use(['add'], function(){
var
cmsBlogAdd
=
layui
.
add
var
cmsBlogAdd
=
layui
.
add
cmsBlogAdd
.
init
();
cmsBlogAdd
.
init
();
});
});
</script>
</script>
admin-console/src/main/resources/templates/admin/cmsBlog/edit.html
View file @
7fecf4df
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/cmsBlog/"}){ -->
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/cmsBlog/"}){ -->
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
>
action=
"/admin/cmsBlog/update.json"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
title
</label>
<label
class=
"layui-form-label"
>
title
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
...
@@ -12,8 +10,6 @@
...
@@ -12,8 +10,6 @@
class=
"layui-input"
>
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
content
</label>
<label
class=
"layui-form-label"
>
content
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
...
@@ -21,13 +17,10 @@
...
@@ -21,13 +17,10 @@
class=
"layui-input"
>
class=
"layui-input"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
createTime
</label>
<label
class=
"layui-form-label"
>
createTime
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
...
@@ -35,8 +28,6 @@
...
@@ -35,8 +28,6 @@
class=
"layui-input"
>
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
createUserId
</label>
<label
class=
"layui-form-label"
>
createUserId
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
...
@@ -44,13 +35,10 @@
...
@@ -44,13 +35,10 @@
class=
"layui-input"
>
class=
"layui-input"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
type
</label>
<label
class=
"layui-form-label"
>
type
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
...
@@ -58,9 +46,7 @@
...
@@ -58,9 +46,7 @@
class=
"layui-input"
>
class=
"layui-input"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<input
type=
"hidden"
name=
"id"
value=
${cmsBlog.id}
/>
<input
type=
"hidden"
name=
"id"
value=
${cmsBlog.id}
/>
...
@@ -69,8 +55,7 @@
...
@@ -69,8 +55,7 @@
<!--#} -->
<!--#} -->
<script>
<script>
layui
.
use
([
'
edit
'
],
function
(){
layui
.
use
([
'
edit
'
],
function
(){
var
cmsBlogEdit
=
layui
.
edit
var
cmsBlogEdit
=
layui
.
edit
cmsBlogEdit
.
init
();
cmsBlogEdit
.
init
();
});
});
</script>
</script>
admin-core/src/main/java/com/ibeetl/admin/core/conf/DataSourceConfig.java
View file @
7fecf4df
...
@@ -15,7 +15,7 @@ public class DataSourceConfig {
...
@@ -15,7 +15,7 @@ public class DataSourceConfig {
ds
.
setJdbcUrl
(
env
.
getProperty
(
"spring.datasource.url"
));
ds
.
setJdbcUrl
(
env
.
getProperty
(
"spring.datasource.url"
));
ds
.
setUsername
(
env
.
getProperty
(
"spring.datasource.username"
));
ds
.
setUsername
(
env
.
getProperty
(
"spring.datasource.username"
));
ds
.
setPassword
(
env
.
getProperty
(
"spring.datasource.password"
));
ds
.
setPassword
(
env
.
getProperty
(
"spring.datasource.password"
));
ds
.
setDriverClassName
(
env
.
getProperty
(
"spring.datasource.driver-class-name"
));
//
ds.setDriverClassName(env.getProperty("spring.datasource.driver-class-name"));
return
ds
;
return
ds
;
}
}
}
}
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/BaseEntity.java
View file @
7fecf4df
...
@@ -14,8 +14,8 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
...
@@ -14,8 +14,8 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
public
class
BaseEntity
extends
TailBean
implements
java
.
io
.
Serializable
{
public
class
BaseEntity
extends
TailBean
implements
java
.
io
.
Serializable
{
protected
final
static
String
ORACLE_CORE_SEQ_NAME
=
"core
-
seq"
;
protected
final
static
String
ORACLE_CORE_SEQ_NAME
=
"core
_
seq"
;
protected
final
static
String
ORACLE_AUDIT_SEQ_NAME
=
"audit
-
seq"
;
protected
final
static
String
ORACLE_AUDIT_SEQ_NAME
=
"audit
_
seq"
;
@JsonAnyGetter
@JsonAnyGetter
public
Map
<
String
,
Object
>
getTails
(){
public
Map
<
String
,
Object
>
getTails
(){
return
super
.
getTails
();
return
super
.
getTails
();
...
...
admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java
View file @
7fecf4df
package
com.ibeetl.admin.core.web
;
package
com.ibeetl.admin.core.web
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -73,23 +74,16 @@ public class CoreCodeGenController {
...
@@ -73,23 +74,16 @@ public class CoreCodeGenController {
@PostMapping
(
MODEL
+
"/gen.json"
)
@PostMapping
(
MODEL
+
"/gen.json"
)
@ResponseBody
@ResponseBody
public
JsonResult
gen
(
EntityInfo
data
,
String
path
)
{
public
JsonResult
gen
(
EntityInfo
data
,
String
path
)
{
Entity
info
=
data
.
getEntity
(
);
Entity
entity
=
getEntitiyInfo
(
data
);
String
urlBase
=
data
.
getUrlBase
();
String
urlBase
=
data
.
getUrlBase
();
String
basePackage
=
data
.
getBasePackage
();
String
basePackage
=
data
.
getBasePackage
();
Entity
entity
=
codeGenService
.
getEntityInfo
(
info
.
getTableName
());
entity
.
setCode
(
info
.
getCode
());
entity
.
setDisplayName
(
info
.
getDisplayName
());
entity
.
setSystem
(
info
.
getSystem
());
for
(
int
i
=
0
;
i
<
entity
.
getList
().
size
();
i
++)
{
entity
.
getList
().
get
(
i
).
setDisplayName
(
info
.
getList
().
get
(
i
).
getDisplayName
());
entity
.
getList
().
get
(
i
).
setShowInQuery
(
info
.
getList
().
get
(
i
).
isShowInQuery
());
}
if
(
StringUtils
.
isEmpty
(
entity
.
getCode
())
||
StringUtils
.
isEmpty
(
entity
.
getSystem
()))
{
return
JsonResult
.
failMessage
(
"code,system不能为空"
);
}
MavenProjectTarget
target
=
new
MavenProjectTarget
(
entity
,
basePackage
);
MavenProjectTarget
target
=
new
MavenProjectTarget
(
entity
,
basePackage
);
//生成到path目录下,按照maven工程解构生成
//生成到path目录下,按照maven工程解构生成
File
file
=
new
File
(
path
);
if
(!
file
.
exists
())
{
throw
new
PlatformException
(
"路径不存在 "
+
path
);
}
target
.
setTargetPath
(
path
);
target
.
setTargetPath
(
path
);
target
.
setUrlBase
(
urlBase
);
target
.
setUrlBase
(
urlBase
);
...
...
admin-core/src/main/resources/templates/core/codeGen/edit.html
View file @
7fecf4df
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<button
class=
"layui-btn ext-toolbar"
data-type=
"cancel"
>
取消
</button>
<button
class=
"layui-btn ext-toolbar"
data-type=
"cancel"
>
取消
</button>
</div>
</div>
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
action=
"/core/codeGen/gen.json"
>
>
<fieldset
class=
"layui-elem-field layui-field-title"
style=
"margin-top: 30px;"
>
<fieldset
class=
"layui-elem-field layui-field-title"
style=
"margin-top: 30px;"
>
<legend>
主健字段
</legend>
<legend>
主健字段
</legend>
...
...
doc/readme/codeoverview.png
0 → 100644
View file @
7fecf4df
71.7 KB
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment