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-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.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.modules.mnt.service.dto
;
import
lombok.Data
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.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.modules.mnt.service.dto
;
import
lombok.Data
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.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.modules.mnt.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 zhanghouying
* @date 2019-08-24
*/
@Data
public
class
ServerDeployDto
implements
Serializable
{
@Getter
@Setter
public
class
ServerDeployDto
extends
BaseDTO
implements
Serializable
{
private
Long
id
;
...
...
@@ -23,6 +39,4 @@ public class ServerDeployDto implements Serializable {
private
String
account
;
private
String
password
;
private
Timestamp
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.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.modules.mnt.service.dto
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.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.modules.mnt.service.impl
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.mnt.domain.App
;
import
me.zhengjie.modules.mnt.repository.AppRepository
;
...
...
@@ -25,17 +41,12 @@ import java.util.*;
* @date 2019-08-24
*/
@Service
@RequiredArgsConstructor
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
AppServiceImpl
implements
AppService
{
private
AppRepository
appRepository
;
private
AppMapper
appMapper
;
public
AppServiceImpl
(
AppRepository
appRepository
,
AppMapper
appMapper
)
{
this
.
appMapper
=
appMapper
;
this
.
appRepository
=
appRepository
;
}
private
final
AppRepository
appRepository
;
private
final
AppMapper
appMapper
;
@Override
public
Object
queryAll
(
AppQueryCriteria
criteria
,
Pageable
pageable
){
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.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.modules.mnt.service.impl
;
import
cn.hutool.core.util.IdUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.modules.mnt.domain.Database
;
import
me.zhengjie.modules.mnt.repository.DatabaseRepository
;
...
...
@@ -18,7 +34,6 @@ import org.springframework.data.domain.Pageable;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.*
;
...
...
@@ -27,19 +42,14 @@ import java.util.*;
* @author zhanghouying
* @date 2019-08-24
*/
@Service
@Slf4j
@Service
@RequiredArgsConstructor
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
DatabaseServiceImpl
implements
DatabaseService
{
private
DatabaseRepository
databaseRepository
;
private
DatabaseMapper
databaseMapper
;
public
DatabaseServiceImpl
(
DatabaseRepository
databaseRepository
,
DatabaseMapper
databaseMapper
){
this
.
databaseMapper
=
databaseMapper
;
this
.
databaseRepository
=
databaseRepository
;
}
private
final
DatabaseRepository
databaseRepository
;
private
final
DatabaseMapper
databaseMapper
;
@Override
public
Object
queryAll
(
DatabaseQueryCriteria
criteria
,
Pageable
pageable
){
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.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.modules.mnt.service.impl
;
import
cn.hutool.core.util.IdUtil
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.modules.mnt.domain.DeployHistory
;
import
me.zhengjie.modules.mnt.repository.DeployHistoryRepository
;
import
me.zhengjie.modules.mnt.service.DeployHistoryService
;
...
...
@@ -16,7 +32,6 @@ import org.springframework.data.domain.Pageable;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.*
;
...
...
@@ -26,18 +41,13 @@ import java.util.*;
* @date 2019-08-24
*/
@Service
@RequiredArgsConstructor
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
DeployHistoryServiceImpl
implements
DeployHistoryService
{
private
final
DeployHistoryRepository
deployhistoryRepository
;
private
final
DeployHistoryMapper
deployhistoryMapper
;
public
DeployHistoryServiceImpl
(
DeployHistoryRepository
deployhistoryRepository
,
DeployHistoryMapper
deployhistoryMapper
)
{
this
.
deployhistoryRepository
=
deployhistoryRepository
;
this
.
deployhistoryMapper
=
deployhistoryMapper
;
}
@Override
public
Object
queryAll
(
DeployHistoryQueryCriteria
criteria
,
Pageable
pageable
){
Page
<
DeployHistory
>
page
=
deployhistoryRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.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.modules.mnt.service.impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.mnt.domain.App
;
...
...
@@ -35,29 +51,18 @@ import java.util.*;
*/
@Slf4j
@Service
@RequiredArgsConstructor
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
DeployServiceImpl
implements
DeployService
{
private
final
String
FILE_SEPARATOR
=
"/"
;
private
final
DeployRepository
deployRepository
;
private
final
DeployMapper
deployMapper
;
private
final
ServerDeployService
serverDeployService
;
private
final
DeployHistoryService
deployHistoryService
;
// 循环次数
private
final
Integer
count
=
30
;
public
DeployServiceImpl
(
DeployRepository
deployRepository
,
DeployMapper
deployMapper
,
ServerDeployService
serverDeployService
,
DeployHistoryService
deployHistoryService
)
{
this
.
deployRepository
=
deployRepository
;
this
.
deployMapper
=
deployMapper
;
this
.
serverDeployService
=
serverDeployService
;
this
.
deployHistoryService
=
deployHistoryService
;
}
@Override
public
Object
queryAll
(
DeployQueryCriteria
criteria
,
Pageable
pageable
)
{
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.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.modules.mnt.service.impl
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.modules.mnt.domain.ServerDeploy
;
import
me.zhengjie.modules.mnt.repository.ServerDeployRepository
;
import
me.zhengjie.modules.mnt.service.ServerDeployService
;
...
...
@@ -25,17 +41,12 @@ import java.util.*;
* @date 2019-08-24
*/
@Service
@RequiredArgsConstructor
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
ServerDeployServiceImpl
implements
ServerDeployService
{
private
ServerDeployRepository
serverDeployRepository
;
private
ServerDeployMapper
serverDeployMapper
;
public
ServerDeployServiceImpl
(
ServerDeployRepository
serverDeployRepository
,
ServerDeployMapper
serverDeployMapper
){
this
.
serverDeployRepository
=
serverDeployRepository
;
this
.
serverDeployMapper
=
serverDeployMapper
;
}
private
final
ServerDeployRepository
serverDeployRepository
;
private
final
ServerDeployMapper
serverDeployMapper
;
@Override
public
Object
queryAll
(
ServerDeployQueryCriteria
criteria
,
Pageable
pageable
){
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapper/AppMapper.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.modules.mnt.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapper/DatabaseMapper.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.modules.mnt.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapper/DeployHistoryMapper.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.modules.mnt.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapper/DeployMapper.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.modules.mnt.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapper/ServerDeployMapper.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.modules.mnt.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.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.modules.mnt.util
;
import
cn.hutool.core.io.IoUtil
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.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.modules.mnt.util
;
import
ch.ethz.ssh2.Connection
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.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.modules.mnt.util
;
import
cn.hutool.crypto.SecureUtil
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ZipUtils.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.modules.mnt.util
;
import
java.io.*
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.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.modules.mnt.websocket
;
/**
* @author
:
ZhangHouYing
* @date
:
2019-08-10 9:56
* @author ZhangHouYing
* @date 2019-08-10 9:56
*/
public
enum
MsgType
{
/** 连接 */
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.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.modules.mnt.websocket
;
import
lombok.Data
;
/**
* @author
:
ZhangHouYing
* @date
:
2019-08-10 9:55
* @author ZhangHouYing
* @date 2019-08-10 9:55
*/
@Data
public
class
SocketMsg
{
...
...
Prev
1
2
3
4
5
6
7
8
9
10
…
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