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
7c35a79c
Commit
7c35a79c
authored
May 05, 2020
by
ZhengJie
Browse files
[新增功能](el-admin v2.5): v2.5 beta
详情
https://www.ydyno.com/archives/1225.html
parent
d35ffc9d
Changes
295
Hide whitespace changes
Inline
Side-by-side
eladmin-tools/src/main/java/me/zhengjie/service/VerificationCodeService.java
deleted
100644 → 0
View file @
d35ffc9d
package
me.zhengjie.service
;
import
me.zhengjie.domain.VerificationCode
;
import
me.zhengjie.domain.vo.EmailVo
;
/**
* @author Zheng Jie
* @date 2018-12-26
*/
public
interface
VerificationCodeService
{
/**
* 发送邮件验证码
* @param code 验证码
* @return EmailVo
*/
EmailVo
sendEmail
(
VerificationCode
code
);
/**
* 验证
* @param code 验证码
*/
void
validated
(
VerificationCode
code
);
}
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.dto
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseDTO
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
* @author Zheng Jie
* @date 2019-09-05
*/
@Data
public
class
LocalStorageDto
implements
Serializable
{
@Getter
@Setter
public
class
LocalStorageDto
extends
BaseDTO
implements
Serializable
{
private
Long
id
;
...
...
@@ -22,8 +39,4 @@ public class LocalStorageDto implements Serializable {
private
String
type
;
private
String
size
;
private
String
operate
;
private
Timestamp
createTime
;
}
\ No newline at end of file
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.dto
;
import
lombok.Data
;
...
...
@@ -13,7 +28,7 @@ import me.zhengjie.annotation.Query;
@Data
public
class
LocalStorageQueryCriteria
{
@Query
(
blurry
=
"name,suffix,type,
oper
ate,size"
)
@Query
(
blurry
=
"name,suffix,type,
cre
ate
By
,size"
)
private
String
blurry
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
...
...
eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.dto
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
...
...
eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.dto
;
import
lombok.Data
;
...
...
eladmin-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.impl
;
import
com.alipay.api.AlipayClient
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.request.AlipayTradePagePayRequest
;
import
com.alipay.api.request.AlipayTradeWapPayRequest
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.domain.vo.TradeVo
;
import
me.zhengjie.domain.AlipayConfig
;
import
me.zhengjie.exception.BadRequestException
;
...
...
@@ -22,6 +38,7 @@ import java.util.Optional;
* @date 2018-12-31
*/
@Service
@RequiredArgsConstructor
@CacheConfig
(
cacheNames
=
"alipay"
)
@SuppressWarnings
(
"all"
)
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
...
...
@@ -29,10 +46,6 @@ public class AliPayServiceImpl implements AliPayService {
private
final
AliPayRepository
alipayRepository
;
public
AliPayServiceImpl
(
AliPayRepository
alipayRepository
)
{
this
.
alipayRepository
=
alipayRepository
;
}
@Override
public
String
toPayAsPc
(
AlipayConfig
alipay
,
TradeVo
trade
)
throws
Exception
{
...
...
eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.impl
;
import
cn.hutool.extra.mail.Mail
;
import
cn.hutool.extra.mail.MailAccount
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.domain.EmailConfig
;
import
me.zhengjie.domain.vo.EmailVo
;
import
me.zhengjie.exception.BadRequestException
;
...
...
@@ -21,16 +37,13 @@ import java.util.Optional;
* @date 2018-12-26
*/
@Service
@RequiredArgsConstructor
@CacheConfig
(
cacheNames
=
"email"
)
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
EmailServiceImpl
implements
EmailService
{
private
final
EmailRepository
emailRepository
;
public
EmailServiceImpl
(
EmailRepository
emailRepository
)
{
this
.
emailRepository
=
emailRepository
;
}
@Override
@CachePut
(
key
=
"'1'"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.config.FileProperties
;
import
me.zhengjie.domain.LocalStorage
;
import
me.zhengjie.service.dto.LocalStorageDto
;
...
...
@@ -22,11 +38,9 @@ import java.util.ArrayList;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
/**
...
...
@@ -34,21 +48,15 @@ import javax.servlet.http.HttpServletResponse;
* @date 2019-09-05
*/
@Service
@RequiredArgsConstructor
@CacheConfig
(
cacheNames
=
"localStorage"
)
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
LocalStorageServiceImpl
implements
LocalStorageService
{
private
final
LocalStorageRepository
localStorageRepository
;
private
final
LocalStorageMapper
localStorageMapper
;
private
final
FileProperties
properties
;
public
LocalStorageServiceImpl
(
LocalStorageRepository
localStorageRepository
,
LocalStorageMapper
localStorageMapper
,
FileProperties
properties
)
{
this
.
localStorageRepository
=
localStorageRepository
;
this
.
localStorageMapper
=
localStorageMapper
;
this
.
properties
=
properties
;
}
@Override
@Cacheable
...
...
@@ -90,8 +98,7 @@ public class LocalStorageServiceImpl implements LocalStorageService {
suffix
,
file
.
getPath
(),
type
,
FileUtil
.
getSize
(
multipartFile
.
getSize
()),
SecurityUtils
.
getCurrentUsername
()
FileUtil
.
getSize
(
multipartFile
.
getSize
())
);
return
localStorageMapper
.
toDto
(
localStorageRepository
.
save
(
localStorage
));
}
catch
(
Exception
e
){
...
...
@@ -130,7 +137,7 @@ public class LocalStorageServiceImpl implements LocalStorageService {
map
.
put
(
"备注名"
,
localStorageDTO
.
getName
());
map
.
put
(
"文件类型"
,
localStorageDTO
.
getType
());
map
.
put
(
"文件大小"
,
localStorageDTO
.
getSize
());
map
.
put
(
"
操作人
"
,
localStorageDTO
.
get
Oper
ate
());
map
.
put
(
"
创建者
"
,
localStorageDTO
.
get
Cre
ate
By
());
map
.
put
(
"创建日期"
,
localStorageDTO
.
getCreateTime
());
list
.
add
(
map
);
}
...
...
eladmin-tools/src/main/java/me/zhengjie/service/impl/PictureServiceImpl.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.impl
;
import
cn.hutool.http.HttpRequest
;
...
...
@@ -5,6 +20,7 @@ import cn.hutool.http.HttpUtil;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.domain.Picture
;
import
me.zhengjie.repository.PictureRepository
;
...
...
@@ -29,6 +45,7 @@ import java.util.*;
* @date 2018-12-27
*/
@Slf4j
@RequiredArgsConstructor
@Service
(
value
=
"pictureService"
)
@CacheConfig
(
cacheNames
=
"picture"
)
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
...
...
@@ -36,19 +53,11 @@ public class PictureServiceImpl implements PictureService {
@Value
(
"${smms.token}"
)
private
String
token
;
private
final
PictureRepository
pictureRepository
;
private
static
final
String
SUCCESS
=
"success"
;
private
static
final
String
CODE
=
"code"
;
private
static
final
String
MSG
=
"message"
;
public
PictureServiceImpl
(
PictureRepository
pictureRepository
)
{
this
.
pictureRepository
=
pictureRepository
;
}
@Override
public
Object
queryAll
(
PictureQueryCriteria
criteria
,
Pageable
pageable
){
return
PageUtil
.
toPage
(
pictureRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
));
...
...
eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.impl
;
import
com.alibaba.fastjson.JSON
;
...
...
@@ -9,6 +24,7 @@ import com.qiniu.storage.UploadManager;
import
com.qiniu.storage.model.DefaultPutRet
;
import
com.qiniu.storage.model.FileInfo
;
import
com.qiniu.util.Auth
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.domain.QiniuConfig
;
import
me.zhengjie.domain.QiniuContent
;
import
me.zhengjie.repository.QiniuContentRepository
;
...
...
@@ -40,19 +56,14 @@ import java.util.*;
* @date 2018-12-31
*/
@Service
@RequiredArgsConstructor
@CacheConfig
(
cacheNames
=
"qiNiu"
)
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
QiNiuServiceImpl
implements
QiNiuService
{
private
final
QiNiuConfigRepository
qiNiuConfigRepository
;
private
final
QiniuContentRepository
qiniuContentRepository
;
public
QiNiuServiceImpl
(
QiNiuConfigRepository
qiNiuConfigRepository
,
QiniuContentRepository
qiniuContentRepository
)
{
this
.
qiNiuConfigRepository
=
qiNiuConfigRepository
;
this
.
qiniuContentRepository
=
qiniuContentRepository
;
}
@Value
(
"${qiniu.max-size}"
)
private
Long
maxSize
;
...
...
eladmin-tools/src/main/java/me/zhengjie/service/mapper/LocalStorageMapper.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
...
...
eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.utils
;
/**
...
...
eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.utils
;
import
com.alipay.api.AlipayApiException
;
...
...
eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
View file @
7c35a79c
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me.zhengjie.utils
;
import
com.qiniu.storage.Region
;
...
...
pom.xml
View file @
7c35a79c
...
...
@@ -14,7 +14,6 @@
<module>
eladmin-logging
</module>
<module>
eladmin-system
</module>
<module>
eladmin-tools
</module>
<module>
eladmin-monitor
</module>
<module>
eladmin-generator
</module>
</modules>
...
...
Prev
1
…
11
12
13
14
15
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