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
cabde2ef
Commit
cabde2ef
authored
Mar 01, 2018
by
xiandafu
Browse files
Merge branch 'master' of
https://gitee.com/xiandafu/springboot-plus
parents
a82522df
cc0c6fb8
Changes
30
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
cabde2ef
...
...
@@ -5,15 +5,23 @@
基本技术栈来源于我为电子工业出版社编写的的
[
<<Spring Boot 2 精髓 >>
](
http://ibeetl.com/sb2/#more
)
(
这本书每一章也有各种例子,但Springboot-plus
更偏向于应用而不是教学)
当前版本:1.0.0.Snapshot
技术交流群:219324263
开源地址:https://gitee.com/xiandafu/springboot-plus
视频介绍:https://pan.baidu.com/s/1dFPoaT7









# 1 使用说明
...
...
@@ -45,140 +53,16 @@ spring.datasource.password=123456
SpringBoot-plus 是一个适合大系统拆分成小系统的架构,或者是一个微服务系统,因此,如果你需要创建自己的业务系统,比如,一个CMS子系统,建议你不要在SpringBoot-Plus 添加代码,应该是新建立一个maven工程,依赖admin-core,或者依赖admin-console(如果你有后台管理需求,通常都有,但不是必须的)
创建一个业务子系统,需要如下方式
*
在IDE里创建一个Maven工程
*
将Maven工程改造为Spring Boot工程,如果你不熟悉Spring Boot,可以参考SpringBoot-plus 或者copy如下片段
~~~
xml
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.sample
</groupId>
<artifactId>
cms
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.0.0.RC1
</version>
</parent>
<!-- plus依赖 -->
<dependency>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-core
</artifactId>
<version>
1.0
</version>
</dependency>
<dependency>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-console
</artifactId>
<version>
1.0
</version>
</dependency>
<!-- 其他Spring Boot依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-cache
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
</dependency>
<!-- 其他你自己需要的类库 -->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
6.0.5
</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>
spring-snapshots
</id>
<url>
http://repo.spring.io/snapshot
</url>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
</repository>
<repository>
<id>
spring-milestones
</id>
<url>
http://repo.spring.io/milestone
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>
spring-snapshots
</id>
<url>
http://repo.spring.io/snapshot
</url>
</pluginRepository>
<pluginRepository>
<id>
spring-milestones
</id>
<url>
http://repo.spring.io/milestone
</url>
</pluginRepository>
</pluginRepositories>
</project>
~~~
### 1.2.1 创建启动程序
新创建一个CMSApplication 入口
~~~
java
package
com.sample.cms
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.web.WebApplicationInitializer
;
@SpringBootApplication
@EnableCaching
@ComponentScan
(
basePackages
=
{
"com.sample.cms"
,
"com.ibeetl.admin"
})
public
class
CMSApplication
extends
SpringBootServletInitializer
implements
WebApplicationInitializer
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
CMSApplication
.
class
,
args
);
}
}
~~~
运行此程序,然后再次访问http://127.0.0.1:8080/ 你会发现你的的CMS子系统已经具备了所有基础功能,你只需要向此工程添加跟CMS相关功能即可
> 如果你不理解Spring Boot,建议你购买我的书来学习Spring Boot
创建子系统,可以进入代码生成>子系统生成, 输入maven项目路径,还有包名,就可以直接生成一个可运行的基于SpringBoot-Plus 的子系统
### 1.2.
2 创建Controller
### 1.2.
1 配置子系统
### 1.2.
3 创建Service
###
1.2.
2 添加代码
### 1.2.4 创建Dao
## 1.3 代码生成
## 1.3
业务
代码生成
在介绍如何利用Plus开发系统之前,先介绍代码生成功能,此功能可以生成前后端代码总计14个文件,你可以通过预览功能了解如何开发这个系统
...
...
admin-console/pom.xml
View file @
cabde2ef
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-console
</artifactId>
<version>
1.0
</version>
<packaging>
jar
</packaging>
<parent>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin
</artifactId>
<version>
1.0
</version>
</parent>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-console
</artifactId>
<version>
1.0
</version>
<packaging>
jar
</packaging>
<parent>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin
</artifactId>
<version>
1.0
</version>
</parent>
<dependencies>
<dependency>
<groupId>
org.jxls
</groupId>
<artifactId>
jxls
</artifactId>
<version>
2.4.3
</version>
<dependencies>
<dependency>
<groupId>
org.jxls
</groupId>
<artifactId>
jxls
</artifactId>
<version>
2.4.3
</version>
</dependency>
<dependency>
<groupId>
org.jxls
</groupId>
<artifactId>
jxls-reader
</artifactId>
<version>
2.0.3
</version>
</dependency>
<dependency>
<groupId>
org.jxls
</groupId>
<artifactId>
jxls-poi
</artifactId>
<version>
1.0.14
</version>
</dependency>
<dependency>
<groupId>
org.jxls
</groupId>
<artifactId>
jxls-poi
</artifactId>
<version>
1.0
.14
</version>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-core
</artifactId>
<version>
1.0
</version>
</dependency>
<dependency>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-core
</artifactId>
<version>
1.0
</version>
</dependency>
</dependencies>
</dependencies>
</project>
admin-console/src/main/java/com/ibeetl/admin/console/web/DictConsoleController.java
View file @
cabde2ef
...
...
@@ -3,28 +3,33 @@ package com.ibeetl.admin.console.web;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.util.Array
s
;
import
java.util.Array
List
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.beetl.sql.core.engine.PageQuery
;
import
org.jxls.common.Context
;
import
org.jxls.reader.ReaderBuilder
;
import
org.jxls.reader.XLSReadStatus
;
import
org.jxls.reader.XLSReader
;
import
org.jxls.util.JxlsHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.ibeetl.admin.console.service.DictConsoleService
;
import
com.ibeetl.admin.console.web.dto.UserExcelData
;
import
com.ibeetl.admin.console.web.query.CoreDictQuery
;
import
com.ibeetl.admin.console.web.query.UserQuery
;
import
com.ibeetl.admin.core.annotation.Function
;
...
...
@@ -157,5 +162,27 @@ public class DictConsoleController{
}
}
@PostMapping
(
MODEL
+
"/excel/import.do"
)
@Function
(
"dict.import"
)
@ResponseBody
public
JsonResult
importExcel
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
if
(
file
.
isEmpty
())
{
return
JsonResult
.
fail
();
}
String
fileName
=
file
.
getOriginalFilename
();
InputStream
ins
=
file
.
getInputStream
();
InputStream
inputXML
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
"excelTemplates/admin/dict/dict_mapping.xml"
);
XLSReader
mainReader
=
ReaderBuilder
.
buildFromXML
(
inputXML
);
InputStream
inputXLS
=
ins
;
List
<
CoreDict
>
dict
=
new
ArrayList
<
CoreDict
>();
Map
beans
=
new
HashMap
();
beans
.
put
(
"list"
,
dict
);
XLSReadStatus
readStatus
=
mainReader
.
read
(
inputXLS
,
beans
);
return
JsonResult
.
success
();
}
}
admin-console/src/main/java/com/ibeetl/admin/console/web/UserConsoleController.java
View file @
cabde2ef
...
...
@@ -308,5 +308,7 @@ public class UserConsoleController {
}
admin-console/src/main/resources/excelTemplates/admin/dict/dict_collection_template.xls
View file @
cabde2ef
No preview for this file type
admin-console/src/main/resources/excelTemplates/admin/dict/dict_mapping.xml
0 → 100644
View file @
cabde2ef
<?xml version="1.0" encoding="utf-8"?>
<workbook>
<worksheet
name=
"Sheet1"
>
<section
startRow=
"0"
endRow=
"0"
>
</section>
<loop
startRow=
"1"
endRow=
"1"
items=
"list"
var=
"dict"
varType=
"com.ibeetl.admin.entity.CoreDict"
>
<section
startRow=
"3"
endRow=
"3"
>
<mapping
row=
"3"
col=
"0"
></mapping>
<mapping
row=
"1"
col=
"1"
>
dict.name
</mapping>
<mapping
row=
"1"
col=
"2"
>
dict.value
</mapping>
</section>
<loopbreakcondition>
<rowcheck
offset=
"0"
>
<cellcheck
offset=
"0"
></cellcheck>
</rowcheck>
</loopbreakcondition>
</loop>
</worksheet>
</workbook>
\ No newline at end of file
admin-console/src/main/resources/excelTemplates/admin/dict/dict_upload_template.xls
0 → 100644
View file @
cabde2ef
File added
admin-console/src/main/resources/static/js/admin/dict/index.js
View file @
cabde2ef
...
...
@@ -114,6 +114,15 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
})
});
},
importExcel
:
function
(){
//上传路径
var
uploadUrl
=
Common
.
ctxPath
+
"
/admin/dict/excel/import.do
"
;
//模板
var
templatePath
=
"
/admin/dict/dict_upload_template.xls
"
;
//公共的简单上传文件处理
var
url
=
"
/core/file/simpleUpload.do?uploadUrl=
"
+
uploadUrl
+
"
&templatePath=
"
+
templatePath
;
Common
.
openDlg
(
url
,
"
字典数据管理>上传
"
);
}
};
...
...
admin-core/src/main/java/com/ibeetl/admin/core/file/LocaFileService.java
View file @
cabde2ef
...
...
@@ -63,6 +63,8 @@ public class LocaFileService implements FileService {
}
}
private
String
suffixTemp
()
{
// TODO,改成唯一算法
...
...
admin-core/src/main/java/com/ibeetl/admin/core/util/FileUtil.java
0 → 100644
View file @
cabde2ef
package
com.ibeetl.admin.core.util
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
public
class
FileUtil
{
public
static
void
copy
(
InputStream
input
,
OutputStream
os
)
{
try
{
byte
[]
buf
=
new
byte
[
1024
];
int
bytesRead
;
while
((
bytesRead
=
input
.
read
(
buf
))
>
0
)
{
os
.
write
(
buf
,
0
,
bytesRead
);
}
}
catch
(
Exception
ex
)
{
throw
new
PlatformException
(
"文件复制出错"
+
ex
);
}
finally
{
try
{
input
.
close
();
os
.
close
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
}
}
admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java
View file @
cabde2ef
package
com.ibeetl.admin.core.web
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.beetl.core.Configuration
;
import
org.beetl.core.GroupTemplate
;
import
org.beetl.core.Template
;
import
org.beetl.core.resource.ClasspathResourceLoader
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -52,6 +62,114 @@ public class CoreCodeGenController {
return
view
;
}
@GetMapping
(
MODEL
+
"/project.do"
)
public
ModelAndView
project
()
{
ModelAndView
view
=
new
ModelAndView
(
"/core/codeGen/project.html"
);
File
file
=
new
File
(
MavenProjectTarget
.
detectRootPath
());
String
root
=
file
.
getParent
();
//设置生成项目为当前运行项目的上一级项目
view
.
addObject
(
"path"
,
root
+
File
.
separator
+
"sample"
);
view
.
addObject
(
"basePackage"
,
"com.corp.xxx"
);
return
view
;
}
@PostMapping
(
MODEL
+
"/projectGen.json"
)
@ResponseBody
public
JsonResult
project
(
String
path
,
String
basePackage
,
String
includeConsole
)
throws
IOException
{
//includeConsole 当前版本忽略,总是添加一个系统管理功能,可以在pom中移除console
//生成maven项目结构
File
maven
=
new
File
(
path
);
maven
.
mkdirs
();
File
src
=
new
File
(
maven
,
"src"
);
src
.
mkdirs
();
File
main
=
new
File
(
src
,
"main"
);
main
.
mkdir
();
File
test
=
new
File
(
src
,
"test"
);
test
.
mkdir
();
File
javsSource
=
new
File
(
main
,
"java"
);
javsSource
.
mkdir
();
File
resource
=
new
File
(
main
,
"resources"
);
resource
.
mkdir
();
File
sql
=
new
File
(
resource
,
"sql"
);
sql
.
mkdir
();
File
staticFile
=
new
File
(
resource
,
"static"
);
staticFile
.
mkdir
();
File
templatesFile
=
new
File
(
resource
,
"templates"
);
templatesFile
.
mkdir
();
String
codePath
=
basePackage
.
replace
(
"."
,
"/"
);
File
codeFile
=
new
File
(
javsSource
,
codePath
);
codeFile
.
mkdirs
();
Configuration
conf
=
Configuration
.
defaultConfiguration
();
String
tempalteRoot
=
"codeTemplate/maven/"
;
ClasspathResourceLoader
loader
=
new
ClasspathResourceLoader
(
Thread
.
currentThread
().
getContextClassLoader
(),
tempalteRoot
);
GroupTemplate
gt
=
new
GroupTemplate
(
loader
,
conf
);
FileWriter
fw
=
null
;
//先生成入口程序
Template
mainJavaTempalte
=
gt
.
getTemplate
(
"/main.java"
);
mainJavaTempalte
.
binding
(
"basePackage"
,
basePackage
);
fw
=
new
FileWriter
(
new
File
(
codeFile
,
"MainApplication.java"
));
mainJavaTempalte
.
renderTo
(
fw
);
//生成pom文件
Template
pomTemplate
=
gt
.
getTemplate
(
"/pomTemplate.xml"
);
int
index
=
basePackage
.
lastIndexOf
(
"."
);
String
projectGrop
=
basePackage
.
substring
(
0
,
index
);
String
projectName
=
basePackage
.
substring
(
index
+
1
);
pomTemplate
.
binding
(
"group"
,
projectGrop
);
pomTemplate
.
binding
(
"project"
,
projectName
);
fw
=
new
FileWriter
(
new
File
(
maven
,
"pom.xml"
));
pomTemplate
.
renderTo
(
fw
);
//复制当前项目的配置文件
File
config
=
copy
(
resource
,
"application.properties"
);
copy
(
resource
,
"beetl.properties"
);
copy
(
resource
,
"btsql-ext.properties"
);
copy
(
resource
,
"banner.txt"
);
//修改application.properties的配置,改成手工添加
// Properties ps = new Properties();
// ps.load(new FileReader(config));
//// String str = ps.getProperty("beetlsql.basePackag");
// ps.put("beetlsql.basePackag", "ibeetl.com,"+basePackage);
// ps.store(new FileWriter(config), "");
//
return
JsonResult
.
success
();
}
private
File
copy
(
File
root
,
String
fileName
)
throws
IOException
{
ClassLoader
loader
=
Thread
.
currentThread
().
getContextClassLoader
();
InputStream
input
=
loader
.
getResourceAsStream
(
fileName
);
if
(
input
==
null
)
{
log
.
info
(
"copy "
+
fileName
+
" error,不存在"
);
return
null
;
}
File
target
=
new
File
(
root
,
fileName
);
FileOutputStream
output
=
new
FileOutputStream
(
target
);
try
{
byte
[]
buf
=
new
byte
[
1024
];
int
bytesRead
;
while
((
bytesRead
=
input
.
read
(
buf
))
>
0
)
{
output
.
write
(
buf
,
0
,
bytesRead
);
}
}
finally
{
input
.
close
();
output
.
close
();
}
return
target
;
}
@PostMapping
(
MODEL
+
"/table.json"
)
@ResponseBody
...
...
@@ -219,6 +337,9 @@ public class CoreCodeGenController {
return
entity
;
}
@GetMapping
(
MODEL
+
"/{table}/test.json"
)
@ResponseBody
...
...
admin-core/src/main/java/com/ibeetl/admin/core/web/FileSystemContorller.java
View file @
cabde2ef
package
com.ibeetl.admin.core.web
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -8,11 +10,14 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.ibeetl.admin.core.file.FileItem
;
import
com.ibeetl.admin.core.file.FileService
;
import
com.ibeetl.admin.core.util.FileUtil
;
import
com.ibeetl.admin.core.util.PlatformException
;
@Controller
public
class
FileSystemContorller
{
...
...
@@ -28,4 +33,29 @@ public class FileSystemContorller {
fileService
.
copyTemp
(
id
,
response
.
getOutputStream
());
return
null
;
}
@GetMapping
(
MODEL
+
"/downloadTemplate.do"
)
public
ModelAndView
dowloadTemplate
(
HttpServletResponse
response
,
String
path
)
throws
IOException
{
response
.
setContentType
(
"text/html; charset = UTF-8"
);
int
start1
=
path
.
lastIndexOf
(
"\\"
);
int
start2
=
path
.
lastIndexOf
(
"/"
);
if
(
start2
>
start1
)
{
start1
=
start2
;
}
String
file
=
path
.
substring
(
start1
+
1
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
file
);
InputStream
input
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
"excelTemplates/"
+
path
);
FileUtil
.
copy
(
input
,
response
.
getOutputStream
());
return
null
;
}
@GetMapping
(
MODEL
+
"/simpleUpload.do"
)
public
ModelAndView
simpleUploadPage
(
String
uploadUrl
,
String
templatePath
,
String
fileType
)
throws
IOException
{
ModelAndView
view
=
new
ModelAndView
(
"/common/simpleUpload.html"
);
view
.
addObject
(
"uploadUrl"
,
uploadUrl
);
view
.
addObject
(
"templatePath"
,
templatePath
);
view
.
addObject
(
"fileType"
,
fileType
);
return
view
;
}
}
admin-core/src/main/resources/codeTemplate/maven/main.java
0 → 100644
View file @
cabde2ef
package
${
basePackage
};
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.web.WebApplicationInitializer
;
@SpringBootApplication
@EnableCaching
@ComponentScan
(
basePackages
=
{
"${basePackage}"
,
"com.ibeetl.admin"
})
public
class
MainApplication
extends
SpringBootServletInitializer
implements
WebApplicationInitializer
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
MainApplication
.
class
,
args
);
}
}
\ No newline at end of file
admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml
0 → 100644
View file @
cabde2ef
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
${group}
</groupId>
<artifactId>
${project}
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<commons-lang3.version>
3.3.2
</commons-lang3.version>
</properties>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.0.0.RC1
</version>
</parent>
<!-- Add typical dependencies for a web application -->
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-cache
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
6.0.5
</version>
</dependency>
<dependency>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-core
</artifactId>
<version>
1.0
</version>
</dependency>
<dependency>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-console
</artifactId>
<version>
1.0
</version>
</dependency>
</dependencies>
<!-- Add Spring repositories -->
<!-- (you don't need this if you are using a .RELEASE version) -->
<repositories>
<repository>
<id>
spring-snapshots
</id>
<url>
http://repo.spring.io/snapshot
</url>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
</repository>
<repository>
<id>
spring-milestones
</id>
<url>
http://repo.spring.io/milestone
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>
spring-snapshots
</id>
<url>
http://repo.spring.io/snapshot
</url>
</pluginRepository>
<pluginRepository>
<id>
spring-milestones
</id>
<url>
http://repo.spring.io/milestone
</url>
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
admin-core/src/main/resources/static/js/common.js
View file @
cabde2ef
...
...
@@ -76,13 +76,18 @@ var Common = {
});
layer
.
full
(
index
);
},
openConfirm
:
function
(
content
,
callback
){
openConfirm
:
function
(
content
,
callback
,
callBackNo
){
var
index
=
layer
.
confirm
(
content
,
{
btn
:
[
'
确认
'
,
'
取消
'
]
//按钮
},
function
(){
callback
();
if
(
callback
!=
null
){
callback
();
}
layer
.
close
(
index
);
},
function
(){
if
(
callBackNo
!=
null
){
callBackNo
()
}
layer
.
close
(
index
);
});
...
...
admin-core/src/main/resources/static/js/core/codeGen/codeApi.js
View file @
cabde2ef
...
...
@@ -28,8 +28,11 @@ layui.define([], function(exports) {
var
form
=
$
(
'
#updateForm
'
);
var
formPara
=
form
.
serializeJson
();
Common
.
post
(
"
/core/codeGen/sql.json
"
,
formPara
,
callback
);
},
genProject
:
function
(
form
,
callback
){
var
formPara
=
form
.
serializeJson
();
Common
.
post
(
"
/core/codeGen/projectGen.json
"
,
formPara
,
callback
);
}
};
...
...
admin-core/src/main/resources/static/js/core/codeGen/project.js
0 → 100644
View file @
cabde2ef
layui
.
define
([
'
form
'
,
'
codeApi
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
codeApi
=
layui
.
codeApi
;
var
view
=
{
init
:
function
(){
this
.
initSubmit
();
},
initSubmit
:
function
(){
$
(
"
#genProject
"
).
click
(
function
(){
codeApi
.
genProject
(
$
(
'
#projectForm
'
),
function
(){
Common
.
info
(
"
生成项目成功,请用IDE导入新的项目
"
);
});
});
$
(
"
#genProject-cancel
"
).
click
(
function
(){
Lib
.
closeFrame
();
});
}
}
exports
(
'
project
'
,
view
);
});
\ No newline at end of file
admin-core/src/main/resources/templates/common/layout.html
View file @
cabde2ef
...
...
@@ -36,7 +36,7 @@
function
(
e
)
{
if
(
e
.
which
===
27
)
{
Common
.
openConfirm
(
"
是否放弃治疗回到主页?
"
,
function
(){
layer
.
closeAll
();
layer
.
closeAll
();
})
}
...
...
admin-core/src/main/resources/templates/common/simpleUpload.html
0 → 100644
View file @
cabde2ef
<!--# layout("/common/layout.html",{"jsBase":"/js/"}){ -->
<!--# if(isNotEmpty(templatePath)){ -->
<blockquote
class=
"layui-elem-quote"
>
<u><a
href=
"${ctxPath}/core/file/downloadTemplate.do?path=${templatePath}"
>
点击下载模板
</a></u>
</blockquote>
<!--#} -->
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
>
<fieldset
class=
"layui-elem-field layui-field-title"
style=
"margin-top: 30px;"
>
<legend>
拖拽上传
</legend>
</fieldset>
<div
class=
"layui-upload-drag"
id=
"test10"
>
<i
class=
"layui-icon"
>
</i>
<p>
点击上传,或将文件拖拽到此处
</p>
</div>
</form>
<!--#} -->
<script>
layui
.
use
(
'
upload
'
,
function
(){
var
upload
=
layui
.
upload
;
upload
.
render
({
elem
:
'
#test10
'
,
accept
:
'
${fileType!"file"}
'
//默认所有文件都允许
,
url
:
'
${uploadUrl}
'
,
done
:
function
(
res
){
if
(
res
.
code
==
0
){
Common
.
openConfirm
(
"
上传成功,是否继续上传?
"
,
null
,
function
(){
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//先得到当前iframe层的索引
parent
.
layer
.
close
(
index
);
//再执行关闭
})
}
}
,
error
:
function
(){
Common
.
error
(
"
系统错误,无法访问服务器
"
)
}
});
});
</script>
admin-core/src/main/resources/templates/common/tag/submitButtons.tag.html
View file @
cabde2ef
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
style=
"position:absolute;right:10px;bottom:0px;"
>
<button
class=
"layui-btn layui-btn-danger"
type=
"button"
id=
"${id}"
>
保存
</button>
<button
class=
"layui-btn layui-btn-danger"
type=
"button"
id=
"${id}"
>
${text!"保存"}
</button>
<button
class=
"layui-btn"
type=
"button"
id=
"${id}-cancel"
>
取消
</button>
</div>
</div>
\ No newline at end of file
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