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
Eladmin
Commits
8c4fd97e
"eladmin-system/src/main/vscode:/vscode.git/clone" did not exist on "7cbca07b208c588943b1d385b42cbae6831961f9"
Commit
8c4fd97e
authored
Jan 20, 2019
by
郑杰
Browse files
v1.5 beta版发布,详细查看发行版说明
parent
b066bb99
Changes
198
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/resources/template/generator/admin/Controller.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.rest;
import
me.zhengjie.aop.log.Log;
import
me.zhengjie.exception.BadRequestException;
import
$
{
package
}
.domain.$
{
className
}
;
import
$
{
package
}
.service.$
{
className
}
Service;
import
$
{
package
}
.service.dto.$
{
className
}
DTO;
import
$
{
package
}
.service.query.$
{
className
}
QueryService;
import
org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Pageable;
import
org.springframework.http.HttpStatus;
import
org.springframework.http.ResponseEntity;
import
org.springframework.security.access.prepost.PreAuthorize;
import
org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.
*
;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
@
RestController
@
RequestMapping
("
api
")
public
class $
{
className
}
Controller
{
@
A
utowired
private
$
{
className
}
S
ervice
$
{
changeClassName
}
S
ervice
;
@
A
utowired
private
$
{
className
}
Q
ueryService
$
{
changeClassName
}
Q
ueryService
;
private
static
final
S
tring
ENTITY
_
NAME
=
"${changeClassName}"
;
@
G
etMapping
(
value
=
"/${changeClassName}/{id}"
)
@
P
reAuthorize
(
"hasAnyRole('ADMIN')"
)
public
R
esponseEntity
get
$
{
className
}(
@
P
athVariable
$
{
pkColumnType
}
id
){
return
new
R
esponseEntity
(
$
{
changeClassName
}
S
ervice
.findById
(
id
),
H
ttpStatus
.OK
)
;
}
@
L
og
(
"查询${className}"
)
@
G
etMapping
(
value
=
"/${changeClassName}"
)
@
P
reAuthorize
(
"hasAnyRole('ADMIN')"
)
public
R
esponseEntity
get
$
{
className
}
s
(
$
{
className
}
DTO
resources
,
P
ageable
pageable
){
return
new
R
esponseEntity
(
$
{
changeClassName
}
Q
ueryService
.queryAll
(
resources
,
pageable
),
H
ttpStatus
.OK
)
;
}
@
L
og
(
"新增${className}"
)
@
P
ostMapping
(
value
=
"/${changeClassName}"
)
@
P
reAuthorize
(
"hasAnyRole('ADMIN')"
)
public
R
esponseEntity
create
(
@
V
alidated
@
R
equestBody
$
{
className
}
resources
){
if
(
resources
.getId
()
!=
null
)
{
throw
new
B
adRequestException
(
"A new "
+
ENTITY
_
NAME
+
" cannot already have an ID"
)
;
}
return
new
R
esponseEntity
(
$
{
changeClassName
}
S
ervice
.create
(
resources
),
H
ttpStatus
.CREATED
)
;
}
@
L
og
(
"修改${className}"
)
@
P
utMapping
(
value
=
"/${changeClassName}"
)
@
P
reAuthorize
(
"hasAnyRole('ADMIN')"
)
public
R
esponseEntity
update
(
@
V
alidated
@
R
equestBody
$
{
className
}
resources
){
if
(
resources
.getId
()
==
null
)
{
throw
new
B
adRequestException
(
ENTITY
_
NAME
+
" ID Can not be empty"
)
;
}
$
{
changeClassName
}
S
ervice
.update
(
resources
)
;
return
new
R
esponseEntity
(
H
ttpStatus
.NO_CONTENT
)
;
}
@
L
og
(
"删除${className}"
)
@
D
eleteMapping
(
value
=
"/${changeClassName}/{id}"
)
@
P
reAuthorize
(
"hasAnyRole('ADMIN')"
)
public
R
esponseEntity
delete
(
@
P
athVariable
L
ong
id
){
$
{
changeClassName
}
S
ervice
.delete
(
id
)
;
return
new
R
esponseEntity
(
H
ttpStatus
.OK
)
;
}
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Dto.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.service.dto;
import
lombok.Data;
<#
if
hasTimestamp>
import
java.sql.Timestamp;
</#
if
>
<#
if
hasBigDecimal>
import
java.math.BigDecimal;
</#
if
>
import
java.io.Serializable;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
@
Data
public
class $
{
className
}
DTO implements Serializable
{
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnComment
!=
''>
/
**
*
$
{
column
.columnComment
}
*
/
</#
if
>
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
list
>
</#
if
>
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Entity.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.domain;
import
lombok.Data;
import
javax.persistence.
*
;
<#
if
hasTimestamp>
import
java.sql.Timestamp;
</#
if
>
<#
if
hasBigDecimal>
import
java.math.BigDecimal;
</#
if
>
import
java.io.Serializable;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
@
Entity
@
Data
@
Table
(
name
=
"$
{
tableName
}
")
public
class $
{
className
}
implements Serializable
{
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnComment
!=
''>
/
**
*
$
{
column
.columnComment
}
*
/
</#
if
>
<#
if
column
.columnKey
=
'
PRI
'>
@
I
d
@
G
eneratedValue
(
strategy
=
G
enerationType
.IDENTITY
)
</#
if
>
@
C
olumn
(
name
=
"${column.columnName}"
<#
if
column
.columnKey
=
'
UNI
'>
,
unique
=
true
</#
if
><#
if
column
.isNullable
=
'
NO
'
&&
column
.columnKey
!=
'
PRI
'>
,
nullable
=
false
</#
if
>
)
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
</#
list
>
</#
if
>
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Mapper.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.service.mapper;
import
me.zhengjie.mapper.EntityMapper;
import
$
{
package
}
.domain.$
{
className
}
;
import
$
{
package
}
.service.dto.$
{
className
}
DTO;
import
org.mapstruct.Mapper;
import
org.mapstruct.ReportingPolicy;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
@
Mapper
(
componentModel
=
"spring",uses =
{}
,unmappedTargetPolicy = ReportingPolicy.IGNORE)
public
interface $
{
className
}
Mapper extends EntityMapper<$
{
className
}
DTO, $
{
className
}
>
{
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/QueryService.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.service.query;
import
me.zhengjie.utils.PageUtil;
import
$
{
package
}
.domain.$
{
className
}
;
import
$
{
package
}
.service.dto.$
{
className
}
DTO;
import
$
{
package
}
.repository.$
{
className
}
Repository;
import
$
{
package
}
.service.mapper.$
{
className
}
Mapper;
import
org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.cache.annotation.CacheConfig;
import
org.springframework.cache.annotation.Cacheable;
import
org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable;
import
org.springframework.data.jpa.domain.Specification;
import
org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.ObjectUtils;
import
javax.persistence.criteria.CriteriaBuilder;
import
javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate;
import
javax.persistence.criteria.Root;
import
java.util.ArrayList;
import
java.util.List;
/**
*
@author jie
*
@date 2018-12-03
*
/
@
Service
@
CacheConfig
(
cacheNames
=
"$
{
changeClassName
}
")
@
Transactional
(
propagation
=
Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public
class $
{
className
}
QueryService
{
@
A
utowired
private
$
{
className
}
R
epository
$
{
changeClassName
}
R
epository
;
@
A
utowired
private
$
{
className
}
M
apper
$
{
changeClassName
}
M
apper
;
/
**
*
分页
*
/
@
C
acheable
(
keyGenerator
=
"keyGenerator"
)
public
O
bject
queryAll
(
$
{
className
}
DTO
$
{
changeClassName
},
P
ageable
pageable
){
P
age
<$
{
className
}
>
page
=
$
{
changeClassName
}
R
epository
.findAll
(
new
S
pec
(
$
{
changeClassName
}),
pageable
)
;
return
P
ageUtil
.toPage
(
page
.map
(
$
{
changeClassName
}
M
apper
::
toDto
))
;
}
/
**
*
不分页
*
/
@
C
acheable
(
keyGenerator
=
"keyGenerator"
)
public
O
bject
queryAll
(
$
{
className
}
DTO
$
{
changeClassName
}){
return
$
{
changeClassName
}
M
apper
.toDto
(
$
{
changeClassName
}
R
epository
.findAll
(
new
S
pec
(
$
{
changeClassName
})))
;
}
class
S
pec
implements
S
pecification
<$
{
className
}
>
{
private
$
{
className
}
DTO
$
{
changeClassName
}
;
public
S
pec
(
$
{
className
}
DTO
$
{
changeClassName
}){
this
.$
{
changeClassName
}
=
$
{
changeClassName
}
;
}
@
O
verride
public
P
redicate
toPredicate
(
R
oot
<$
{
className
}
>
root
,
C
riteriaQuery
<?>
criteriaQuery
,
C
riteriaBuilder
cb
)
{
L
ist
<
P
redicate
>
list
=
new
A
rrayList
<
P
redicate
>
()
;
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnQuery
??>
if
(
!
O
bjectUtils
.isEmpty
(
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}())){
<#
if
column
.columnQuery
=
'
1
'>
/
**
*
模糊
*
/
list
.add
(
cb
.like
(
root
.get
(
"${column.columnName}"
)
.as
(
$
{
column
.columnType
}
.class
),
"%"
+$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}()
+
"%"
))
;
</#
if
>
<#
if
column
.columnQuery
=
'
2
'>
/
**
*
精确
*
/
list
.add
(
cb
.equal
(
root
.get
(
"${column.columnName}"
)
.as
(
$
{
column
.columnType
}
.class
),
$
{
changeClassName
}
.get
$
{
column
.capitalColumnName
}()))
;
</#
if
>
}
</#
if
>
</#
list
>
</#
if
>
P
redicate
[]
p
=
new
P
redicate
[
list
.size
()
];
return
cb
.and
(
list
.toArray
(
p
))
;
}
}
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Repository.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.repository;
import
$
{
package
}
.domain.$
{
className
}
;
import
org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
public
interface $
{
className
}
Repository extends JpaRepository<$
{
className
}
, $
{
pkColumnType
}
>, JpaSpecificationExecutor
{
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnKey
=
'
UNI
'>
/
**
*
findBy
$
{
column
.capitalColumnName
}
*
@
param
$
{
column
.columnName
}
*
@
return
*
/
$
{
className
}
findBy
$
{
column
.capitalColumnName
}(
$
{
column
.columnType
}
$
{
column
.columnName
})
;
</#
if
>
</#
list
>
</#
if
>
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Service.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.service;
import
$
{
package
}
.domain.$
{
className
}
;
import
$
{
package
}
.service.dto.$
{
className
}
DTO;
import
org.springframework.cache.annotation.CacheConfig;
import
org.springframework.cache.annotation.CacheEvict;
import
org.springframework.cache.annotation.Cacheable;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
@
CacheConfig
(
cacheNames
=
"$
{
changeClassName
}
")
public
interface $
{
className
}
Service
{
/
**
*
findById
*
@
param
id
*
@
return
*
/
@
C
acheable
(
key
=
"#p0"
)
$
{
className
}
DTO
findById
(
$
{
pkColumnType
}
id
)
;
/
**
*
create
*
@
param
resources
*
@
return
*
/
@
C
acheEvict
(
allEntries
=
true
)
$
{
className
}
DTO
create
(
$
{
className
}
resources
)
;
/
**
*
update
*
@
param
resources
*
/
@
C
acheEvict
(
allEntries
=
true
)
void
update
(
$
{
className
}
resources
)
;
/
**
*
delete
*
@
param
id
*
/
@
C
acheEvict
(
allEntries
=
true
)
void
delete
(
L
ong
id
)
;
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/ServiceImpl.ftl
0 → 100644
View file @
8c4fd97e
package
$
{
package
}
.service.impl;
import
$
{
package
}
.domain.$
{
className
}
;
<#
if
columns??>
<#list columns as column>
<#if column.columnKey = 'UNI'>
<#if column_index = 1>
import
me.zhengjie.exception.EntityExistException;
</#if>
</#if>
</#list>
</#
if
>
import
me.zhengjie.utils.ValidationUtil;
import
$
{
package
}
.repository.$
{
className
}
Repository;
import
$
{
package
}
.service.$
{
className
}
Service;
import
$
{
package
}
.service.dto.$
{
className
}
DTO;
import
$
{
package
}
.service.mapper.$
{
className
}
Mapper;
import
org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional;
import
java.util.Optional;
/**
*
@author $
{
author
}
*
@date $
{
date
}
*/
@
Service
@
Transactional
(
propagation
=
Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public
class $
{
className
}
ServiceImpl implements $
{
className
}
Service
{
@
A
utowired
private
$
{
className
}
R
epository
$
{
changeClassName
}
R
epository
;
@
A
utowired
private
$
{
className
}
M
apper
$
{
changeClassName
}
M
apper
;
@
O
verride
public
$
{
className
}
DTO
findById
(
$
{
pkColumnType
}
id
)
{
O
ptional
<$
{
className
}
>
$
{
changeClassName
}
=
$
{
changeClassName
}
R
epository
.findById
(
id
)
;
V
alidationUtil
.isNull
(
$
{
changeClassName
},
"${className}"
,
"id"
,
id
)
;
return
$
{
changeClassName
}
M
apper
.toDto
(
$
{
changeClassName
}
.get
())
;
}
@
O
verride
@
T
ransactional
(
rollbackFor
=
E
xception
.class
)
public
$
{
className
}
DTO
create
(
$
{
className
}
resources
)
{
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnKey
=
'
UNI
'>
if
(
$
{
changeClassName
}
R
epository
.findBy
$
{
column
.capitalColumnName
}(
resources
.get
$
{
column
.capitalColumnName
}())
!=
null
){
throw
new
E
ntityExistException
(
$
{
className
}
.class
,
"${column.columnName}"
,
resources
.get
$
{
column
.capitalColumnName
}())
;
}
</#
if
>
</#
list
>
</#
if
>
return
$
{
changeClassName
}
M
apper
.toDto
(
$
{
changeClassName
}
R
epository
.save
(
resources
))
;
}
@
O
verride
@
T
ransactional
(
rollbackFor
=
E
xception
.class
)
public
void
update
(
$
{
className
}
resources
)
{
O
ptional
<$
{
className
}
>
optional
$
{
className
}
=
$
{
changeClassName
}
R
epository
.findById
(
resources
.getId
())
;
V
alidationUtil
.isNull
(
optional
$
{
className
},
"${className}"
,
"id"
,
resources
.getId
())
;
$
{
className
}
$
{
changeClassName
}
=
optional
$
{
className
}
.get
()
;
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnKey
=
'
UNI
'>
<#
if
column_index
=
1
>
$
{
className
}
$
{
changeClassName
}
1
=
null
;
</#
if
>
$
{
changeClassName
}
1
=
$
{
changeClassName
}
R
epository
.findBy
$
{
column
.capitalColumnName
}(
resources
.get
$
{
column
.capitalColumnName
}())
;
if
(
$
{
changeClassName
}
1
!=
null
&&
!$
{
changeClassName
}
1
.getId
()
.equals
(
$
{
changeClassName
}
.getId
())){
throw
new
E
ntityExistException
(
$
{
className
}
.class
,
"${column.columnName}"
,
resources
.get
$
{
column
.capitalColumnName
}())
;
}
</#
if
>
</#
list
>
</#
if
>
//
此处需自己修改
resources
.setId
(
$
{
changeClassName
}
.getId
())
;
$
{
changeClassName
}
R
epository
.save
(
resources
)
;
}
@
O
verride
@
T
ransactional
(
rollbackFor
=
E
xception
.class
)
public
void
delete
(
L
ong
id
)
{
$
{
changeClassName
}
R
epository
.deleteById
(
id
)
;
}
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/front/api.ftl
0 → 100644
View file @
8c4fd97e
import
request from '@/utils/request'
export
function add(data)
{
return
request
({
url
:
'
api
/$
{
changeClassName
}
'
,
method
:
'
post
'
,
data
})
}
export
function del(id)
{
return
request
({
url
:
'
api
/$
{
changeClassName
}
/'
+
id
,
method
:
'
delete
'
})
}
export
function edit(data)
{
return
request
({
url
:
'
api
/$
{
changeClassName
}
'
,
method
:
'
put
'
,
data
})
}
eladmin-system/src/main/resources/template/generator/front/eForm.ftl
0 → 100644
View file @
8c4fd97e
<
template
>
<el-dialog :append-to-body="true" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<#
if
columns??>
<#list columns as column>
<#if column.changeColumnName != 'id'>
<el-form-item label="<#if column.columnComment != ''>$
{
column
.columnComment
}
<#else>$
{
column
.changeColumnName
}
</#if>">
<el-input v-model="form.$
{
column
.changeColumnName
}
" style="width: 370px;"/>
</el-form-item>
</#if>
</#list>
</#
if
>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
add
,
edit
}
from '@/api/$
{
changeClassName
}
'
export
default
{
props
:
{
isAdd
:
{
type
:
B
oolean
,
required
:
true
},
sup_this
:
{
type
:
O
bject
,
default
:
null
}
},
data
()
{
return
{
loading
:
false
,
dialog
:
false
,
form
:
{
<#
if
columns
??>
<#
list
columns
as
column
>
$
{
column
.changeColumnName
}:
''<#
if
column_has_next
>
,
</#
if
>
</#
list
>
</#
if
>
}
}
},
methods
:
{
cancel
()
{
this
.resetForm
()
},
doSubmit
()
{
this
.loading
=
true
if
(
this
.isAdd
)
{
this
.doAdd
()
}
else
this
.doEdit
()
},
doAdd
()
{
add
(
this
.form
)
.then
(
res
=>
{
this
.resetForm
()
this
.
$notify
({
title
:
'添加成功'
,
type
:
'
success
'
,
duration
:
2500
})
this
.loading
=
false
this
.
$parent
.
$parent
.init
()
})
.catch
(
err
=>
{
this
.loading
=
false
console
.log
(
err
.response.data.message
)
})
},
doEdit
()
{
edit
(
this
.form
)
.then
(
res
=>
{
this
.resetForm
()
this
.
$notify
({
title
:
'修改成功'
,
type
:
'
success
'
,
duration
:
2500
})
this
.loading
=
false
this
.sup_this.init
()
})
.catch
(
err
=>
{
this
.loading
=
false
console
.log
(
err
.response.data.message
)
})
},
resetForm
()
{
this
.dialog
=
false
this
.
$refs
['
form
']
.resetFields
()
this
.form
=
{
<#
if
columns
??>
<#
list
columns
as
column
>
$
{
column
.changeColumnName
}:
''<#
if
column_has_next
>
,
</#
if
>
</#
list
>
</#
if
>
}
}
}
}
</
script
>
<
style
scoped>
</
style
>
eladmin-system/src/main/resources/template/generator/front/edit.ftl
0 → 100644
View file @
8c4fd97e
<
template
>
<div>
<el-button size="mini" type="success" @click="to">编辑</el-button>
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
</div>
</
template
>
<
script
>
import
eForm from './form'
export
default
{
components
:
{
eForm
},
props
:
{
data
:
{
type
:
O
bject
,
required
:
true
},
sup_this
:
{
type
:
O
bject
,
required
:
true
}
},
methods
:
{
to
()
{
const
_
this
=
this
.
$refs
.form
_
this
.form
=
{
<#
if
columns
??>
<#
list
columns
as
column
>
$
{
column
.changeColumnName
}:
this
.data
.$
{
column
.changeColumnName
}
<#
if
column_has_next
>
,
</#
if
>
</#
list
>
</#
if
>
}
_
this
.dialog
=
true
}
}
}
</
script
>
<
style
scoped>
div
{
display
:
inline-block
;
margin-right
:
3
px
;
}
</
style
>
eladmin-system/src/main/resources/template/generator/front/header.ftl
0 → 100644
View file @
8c4fd97e
<
template
>
<div class="head-container">
<#
if
hasQuery>
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-search" @click="toQuery">搜索</el-button>
</#
if
>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-if="checkPermission(['ADMIN'])"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="$refs.form.dialog = true">新增</el-button>
<eForm ref="form" :is-add="true"/>
</div>
</div>
</
template
>
<
script
>
import
checkPermission from '@/utils/permission' // 权限判断函数
import
eForm from './form'
export
default
{
components
:
{
eForm
},
props
:
{
query
:
{
type
:
O
bject
,
required
:
true
}
},
data
()
{
return
{
downloadLoading
:
false
<#
if
hasQuery
>
,
queryTypeOptions
:
[
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.columnQuery
??>
{
key
:
'$
{
column
.changeColumnName
}
'
,
display_name
:
'<#
if
column
.columnComment
!=
''>$
{
column
.columnComment
}
<#
else
>$
{
column
.changeColumnName
}
</#
if
>'
}
<#
if
column_has_next
>
,
</#
if
>
</#
if
>
</#
list
>
</#
if
>
]
</#
if
>
}
},
methods
:
{
checkPermission
<#
if
hasQuery
>
,
toQuery
()
{
this
.
$parent
.page
=
0
this
.
$parent
.init
()
}
</#
if
>
}
}
</
script
>
eladmin-system/src/main/resources/template/generator/front/index.ftl
0 → 100644
View file @
8c4fd97e
<#-
-noinspection
ALL-->
<
template
>
<div class="app-container">
<eHeader :query="query"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" border style="width: 100%;">
<#if columns??>
<#list columns as column>
<#if column.columnShow = 'true'>
<#if column.columnType != 'Timestamp'>
<el-table-column prop="$
{
column
.changeColumnName
}
" label="<#if column.columnComment != ''>$
{
column
.columnComment
}
<#else>$
{
column
.changeColumnName
}
</#if>"/>
<#else>
<el-table-column prop="$
{
column
.changeColumnName
}
" label="<#if column.columnComment != ''>$
{
column
.columnComment
}
<#else>$
{
column
.changeColumnName
}
</#if>">
<template slot-scope="scope">
<span>
{{
parseTime
(
scope
.row
.$
{
column
.changeColumnName
})
}}
</span>
</template>
</el-table-column>
</#if>
</#if>
</#list>
</#if>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<edit v-if="checkPermission(['ADMIN'])" :data="scope.row" :sup_this="sup_this"/>
<el-popover
v-if="checkPermission(['ADMIN'])"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" size="mini">删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</
template
>
<
script
>
import
checkPermission from '@/utils/permission'
import
initData from '@/mixins/initData'
import
{
del
}
from '@/api/$
{
changeClassName
}
'
<#
if
hasTimestamp>
import
{
parseTime
}
from '@/utils/index'
</#
if
>
import
eHeader from './module/header'
import
edit from './module/edit'
export
default
{
components
:
{
eHeader
,
edit
},
mixins
:
[
initData
]
,
data
()
{
return
{
delLoading
:
false
,
sup_this
:
this
}
},
created
()
{
this
.
$nextTick
(()
=>
{
this
.init
()
})
},
methods
:
{
<#
if
hasTimestamp
>
parseTime
,
</#
if
>
checkPermission
,
beforeInit
()
{
this
.url
=
'
api
/$
{
changeClassName
}
'
const
sort
=
'
id
,
desc
'
this
.params
=
{
page
:
this
.page
,
size
:
this
.size
,
sort
:
sort
}
<#
if
hasQuery
>
const
query
=
this
.query
const
type
=
query
.type
const
value
=
query
.value
if
(
type
&&
value
)
{
this
.params
[
type
]
= value
}
</#
if
>
return
true
},
subDelete
(
id
)
{
this
.delLoading
=
true
del
(
id
)
.then
(
res
=>
{
this
.delLoading
=
false
this
.
$refs
[
id
]
.doClose()
this
.init
()
this
.
$notify
({
title
:
'删除成功'
,
type
:
'
success
'
,
duration
:
2500
})
})
.catch
(
err
=>
{
this
.delLoading
=
false
this
.
$refs
[
id
]
.doClose()
console
.log
(
err
.response.data.message
)
})
}
}
}
</
script
>
<
style
scoped>
</
style
>
eladmin-system/src/test/java/me/zhengjie/EladminSystemApplicationTests.java
0 → 100644
View file @
8c4fd97e
package
me.zhengjie
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
EladminSystemApplicationTests
{
@Test
public
void
contextLoads
()
{
}
}
eladmin-tools/eladmin-tools.iml
0 → 100644
View file @
8c4fd97e
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
</facet>
<facet
type=
"web"
name=
"Web"
>
<configuration>
<webroots
/>
</configuration>
</facet>
</component>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_8"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"module"
module-name=
"eladmin-logging"
/>
<orderEntry
type=
"module"
module-name=
"eladmin-common"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.mail:mail:1.4.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:activation:1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.qiniu:qiniu-java-sdk:7.2.18"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.squareup.okhttp3:okhttp:3.11.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.squareup.okio:okio:1.14.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.code.gson:gson:2.8.5"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alipay.sdk:alipay-sdk-java:3.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-logging:commons-logging:1.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-aop:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.aspectj:aspectjweaver:1.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jdbc:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.transaction:javax.transaction-api:1.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hibernate:hibernate-core:5.3.7.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.jboss.logging:jboss-logging:3.3.2.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.persistence:javax.persistence-api:2.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.javassist:javassist:3.23.1-GA"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.bytebuddy:byte-buddy:1.9.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: antlr:antlr:2.7.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.jboss:jandex:2.0.5.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.dom4j:dom4j:2.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hibernate.common:hibernate-commons-annotations:5.0.4.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.data:spring-data-jpa:2.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.data:spring-data-commons:2.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-orm:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-tx:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-beans:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-aspects:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-web:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-logging:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: ch.qos.logback:logback-classic:1.2.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: ch.qos.logback:logback-core:1.2.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.logging.log4j:log4j-api:2.11.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.slf4j:jul-to-slf4j:1.7.25"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.annotation:javax.annotation-api:1.3.2"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"RUNTIME"
name=
"Maven: org.yaml:snakeyaml:1.23"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-json:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.core:jackson-core:2.9.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hibernate.validator:hibernate-validator:6.0.13.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.validation:validation-api:2.0.1.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-web:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-webmvc:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-expression:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-starter-test:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-test:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: com.jayway.jsonpath:json-path:2.4.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.minidev:json-smart:2.3"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.minidev:accessors-smart:1.2"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.ow2.asm:asm:5.0.4"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: junit:junit:4.12"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.assertj:assertj-core:3.11.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.mockito:mockito-core:2.23.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: net.bytebuddy:byte-buddy-agent:1.9.3"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.objenesis:objenesis:2.6"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.hamcrest:hamcrest-core:1.3"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.hamcrest:hamcrest-library:1.3"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.skyscreamer:jsonassert:1.5.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-core:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework:spring-test:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-security:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-aop:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.security:spring-security-config:5.1.1.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.security:spring-security-core:5.1.1.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.security:spring-security-web:5.1.1.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-cache:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-context:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-context-support:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.data:spring-data-redis:2.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.data:spring-data-keyvalue:2.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-oxm:5.1.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: redis.clients:jedis:2.9.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-pool2:2.5.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-lang3:3.8.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-swagger2:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.swagger:swagger-annotations:1.5.20"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.swagger:swagger-models:1.5.20"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-spi:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-core:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-schema:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-swagger-common:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-spring-web:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.guava:guava:20.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml:classmate:1.4.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.slf4j:slf4j-api:1.7.25"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mapstruct:mapstruct:1.2.0.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.springfox:springfox-swagger-ui:2.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"RUNTIME"
name=
"Maven: mysql:mysql-connector-java:8.0.13"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:druid-spring-boot-starter:1.1.10"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:druid:1.1.10"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.0.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.projectlombok:lombok:1.18.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: cn.hutool:hutool-all:4.4.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:fastjson:1.2.54"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mapstruct:mapstruct-jdk8:1.2.0.Final"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"PROVIDED"
name=
"Maven: org.mapstruct:mapstruct-processor:1.2.0.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.inject:javax.inject:1"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
eladmin-tools/pom.xml
0 → 100644
View file @
8c4fd97e
<?xml version="1.0" encoding="UTF-8"?>
<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"
>
<parent>
<artifactId>
eladmin
</artifactId>
<groupId>
me.zhengjie
</groupId>
<version>
1.5
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
eladmin-tools
</artifactId>
<properties>
<mail.version>
1.4.7
</mail.version>
<qiniu.version>
[7.2.0, 7.2.99]
</qiniu.version>
<alipay.version>
3.1.0
</alipay.version>
</properties>
<dependencies>
<!-- 同时需要common模块和logging模块只需要引入logging模块即可 -->
<dependency>
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin-logging
</artifactId>
<version>
1.5
</version>
</dependency>
<!--邮件依赖-->
<dependency>
<groupId>
javax.mail
</groupId>
<artifactId>
mail
</artifactId>
<version>
${mail.version}
</version>
</dependency>
<!--七牛云存储-->
<dependency>
<groupId>
com.qiniu
</groupId>
<artifactId>
qiniu-java-sdk
</artifactId>
<version>
${qiniu.version}
</version>
</dependency>
<!--支付宝依赖-->
<dependency>
<groupId>
com.alipay.sdk
</groupId>
<artifactId>
alipay-sdk-java
</artifactId>
<version>
${alipay.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
src/main/java/me/zhengjie/
tools/
config/MultipartConfig.java
→
eladmin-tools/
src/main/java/me/zhengjie/config/MultipartConfig.java
View file @
8c4fd97e
package
me.zhengjie.
tools.
config
;
package
me.zhengjie.config
;
import
org.springframework.boot.web.servlet.MultipartConfigFactory
;
import
org.springframework.boot.web.servlet.MultipartConfigFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
javax.servlet.MultipartConfigElement
;
import
javax.servlet.MultipartConfigElement
;
import
java.io.File
;
import
java.io.File
;
...
...
src/main/java/me/zhengjie/
tools/
domain/AlipayConfig.java
→
eladmin-tools/
src/main/java/me/zhengjie/domain/AlipayConfig.java
View file @
8c4fd97e
package
me.zhengjie.
tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.*
;
import
javax.persistence.*
;
...
@@ -23,30 +23,33 @@ public class AlipayConfig implements Serializable {
...
@@ -23,30 +23,33 @@ public class AlipayConfig implements Serializable {
* 应用ID,APPID,收款账号既是APPID对应支付宝账号
* 应用ID,APPID,收款账号既是APPID对应支付宝账号
*/
*/
@NotBlank
@NotBlank
@Column
(
name
=
"app_id"
)
private
String
appID
;
private
String
appID
;
/**
/**
* 商户私钥,您的PKCS8格式RSA2私钥
* 商户私钥,您的PKCS8格式RSA2私钥
*/
*/
@NotBlank
@NotBlank
@Column
(
length
=
2000
)
@Column
(
name
=
"private_key"
,
columnDefinition
=
"text"
)
private
String
privateKey
;
private
String
privateKey
;
/**
/**
* 支付宝公钥
* 支付宝公钥
*/
*/
@NotBlank
@NotBlank
@Column
(
length
=
2000
)
@Column
(
name
=
"public_key"
,
columnDefinition
=
"text"
)
private
String
publicKey
;
private
String
publicKey
;
/**
/**
* 签名方式,固定格式
* 签名方式,固定格式
*/
*/
@Column
(
name
=
"sign_type"
)
private
String
signType
=
"RSA2"
;
private
String
signType
=
"RSA2"
;
/**
/**
* 支付宝开放安全地址,一般不会变
* 支付宝开放安全地址,一般不会变
*/
*/
@Column
(
name
=
"gateway_url"
)
private
String
gatewayUrl
=
"https://openapi.alipaydev.com/gateway.do"
;
private
String
gatewayUrl
=
"https://openapi.alipaydev.com/gateway.do"
;
/**
/**
...
@@ -58,12 +61,14 @@ public class AlipayConfig implements Serializable {
...
@@ -58,12 +61,14 @@ public class AlipayConfig implements Serializable {
* 异步通知地址
* 异步通知地址
*/
*/
@NotBlank
@NotBlank
@Column
(
name
=
"notify_url"
)
private
String
notifyUrl
;
private
String
notifyUrl
;
/**
/**
* 订单完成后返回的页面
* 订单完成后返回的页面
*/
*/
@NotBlank
@NotBlank
@Column
(
name
=
"return_url"
)
private
String
returnUrl
;
private
String
returnUrl
;
/**
/**
...
@@ -75,6 +80,7 @@ public class AlipayConfig implements Serializable {
...
@@ -75,6 +80,7 @@ public class AlipayConfig implements Serializable {
* 商户号
* 商户号
*/
*/
@NotBlank
@NotBlank
@Column
(
name
=
"sys_service_provider_id"
)
private
String
sysServiceProviderId
;
private
String
sysServiceProviderId
;
}
}
src/main/java/me/zhengjie/
tools/
domain/EmailConfig.java
→
eladmin-tools/
src/main/java/me/zhengjie/domain/EmailConfig.java
View file @
8c4fd97e
package
me.zhengjie.
tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -41,8 +42,9 @@ public class EmailConfig implements Serializable {
...
@@ -41,8 +42,9 @@ public class EmailConfig implements Serializable {
private
String
pass
;
private
String
pass
;
/**
/**
*
发
件人
*
收
件人
*/
*/
@NotBlank
@NotBlank
@Column
(
name
=
"from_user"
)
private
String
fromUser
;
private
String
fromUser
;
}
}
src/main/java/me/zhengjie/
tools/
domain/Picture.java
→
eladmin-tools/
src/main/java/me/zhengjie/domain/Picture.java
View file @
8c4fd97e
package
me.zhengjie.
tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
lombok.Data
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.CreationTimestamp
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
...
@@ -40,6 +41,7 @@ public class Picture implements Serializable {
...
@@ -40,6 +41,7 @@ public class Picture implements Serializable {
private
String
username
;
private
String
username
;
@CreationTimestamp
@CreationTimestamp
@Column
(
name
=
"create_time"
)
private
Timestamp
createTime
;
private
Timestamp
createTime
;
@Override
@Override
...
...
Prev
1
…
4
5
6
7
8
9
10
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