Skip to content

Commit 7b11e81

Browse files
committed
添加运维系统
1 parent f81b4fd commit 7b11e81

58 files changed

Lines changed: 3064 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eladmin-system/pom.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
<version>2.3</version>
2626
</dependency>
2727

28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-websocket</artifactId>
31+
</dependency>
32+
2833
<!--jwt-->
2934
<dependency>
3035
<groupId>io.jsonwebtoken</groupId>
@@ -38,6 +43,18 @@
3843
<artifactId>quartz</artifactId>
3944
</dependency>
4045

46+
<dependency>
47+
<groupId>ch.ethz.ganymed</groupId>
48+
<artifactId>ganymed-ssh2</artifactId>
49+
<version>build210</version>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>com.jcraft</groupId>
54+
<artifactId>jsch</artifactId>
55+
<version>0.1.55</version>
56+
</dependency>
57+
4158
</dependencies>
4259

4360
<build>
@@ -56,4 +73,4 @@
5673
</plugin>
5774
</plugins>
5875
</build>
59-
</project>
76+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package me.zhengjie.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
6+
7+
/**
8+
* @author: ZhangHouYing
9+
* @date: 2019-08-24 15:44
10+
*/
11+
@Configuration
12+
public class WebSocketConfig {
13+
14+
@Bean
15+
public ServerEndpointExporter serverEndpointExporter() {
16+
return new ServerEndpointExporter();
17+
}
18+
19+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package me.zhengjie.modules.mnt.domain;
2+
3+
import lombok.Data;
4+
import cn.hutool.core.bean.BeanUtil;
5+
import cn.hutool.core.bean.copier.CopyOptions;
6+
import javax.persistence.*;
7+
import java.io.Serializable;
8+
9+
/**
10+
* @author zhanghouying
11+
* @date 2019-08-24
12+
*/
13+
@Entity
14+
@Data
15+
@Table(name="mnt_app")
16+
public class App implements Serializable {
17+
18+
/**
19+
* 应用编号
20+
*/
21+
@Id
22+
@Column(name = "id")
23+
private String id;
24+
25+
/**
26+
* 应用名称
27+
*/
28+
@Column(name = "name")
29+
private String name;
30+
31+
/**
32+
* 端口
33+
*/
34+
@Column(name = "port")
35+
private int port;
36+
37+
/**
38+
* 上传目录
39+
*/
40+
@Column(name = "upload_path")
41+
private String uploadPath;
42+
43+
/**
44+
* 部署目录
45+
*/
46+
@Column(name = "deploy_path")
47+
private String deployPath;
48+
49+
/**
50+
* 备份目录
51+
*/
52+
@Column(name = "backup_path")
53+
private String backupPath;
54+
55+
/**
56+
* 启动脚本
57+
*/
58+
@Column(name = "start_script")
59+
private String startScript;
60+
61+
/**
62+
* 部署脚本
63+
*/
64+
@Column(name = "deploy_script")
65+
private String deployScript;
66+
67+
public void copy(App source){
68+
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
69+
}
70+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package me.zhengjie.modules.mnt.domain;
2+
3+
import lombok.Data;
4+
import cn.hutool.core.bean.BeanUtil;
5+
import cn.hutool.core.bean.copier.CopyOptions;
6+
import javax.persistence.*;
7+
import java.io.Serializable;
8+
9+
/**
10+
* @author zhanghouying
11+
* @date 2019-08-24
12+
*/
13+
@Entity
14+
@Data
15+
@Table(name="mnt_database")
16+
public class Database implements Serializable {
17+
18+
/**
19+
* id
20+
*/
21+
@Id
22+
@Column(name = "id")
23+
private String id;
24+
25+
/**
26+
* 数据库名称
27+
*/
28+
@Column(name = "name",nullable = false)
29+
private String name;
30+
31+
/**
32+
* 数据库连接地址
33+
*/
34+
@Column(name = "jdbc_url",nullable = false)
35+
private String jdbcUrl;
36+
37+
/**
38+
* 数据库密码
39+
*/
40+
@Column(name = "pwd",nullable = false)
41+
private String pwd;
42+
43+
/**
44+
* 用户名
45+
*/
46+
@Column(name = "user_name",nullable = false)
47+
private String userName;
48+
49+
50+
public void copy(Database source){
51+
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
52+
}
53+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package me.zhengjie.modules.mnt.domain;
2+
3+
import lombok.Data;
4+
import cn.hutool.core.bean.BeanUtil;
5+
import cn.hutool.core.bean.copier.CopyOptions;
6+
import javax.persistence.*;
7+
import java.io.Serializable;
8+
9+
/**
10+
* @author zhanghouying
11+
* @date 2019-08-24
12+
*/
13+
@Entity
14+
@Data
15+
@Table(name="mnt_deploy")
16+
public class Deploy implements Serializable {
17+
18+
/**
19+
* 部署编号
20+
*/
21+
@Id
22+
@Column(name = "id")
23+
private String id;
24+
25+
/**
26+
* 应用编号
27+
*/
28+
@Column(name = "app_id")
29+
private String appId;
30+
31+
/**
32+
* IP列表
33+
*/
34+
@Column(name = "ip")
35+
private String ip;
36+
37+
public void copy(Deploy source){
38+
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
39+
}
40+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package me.zhengjie.modules.mnt.domain;
2+
3+
import lombok.Data;
4+
import cn.hutool.core.bean.BeanUtil;
5+
import cn.hutool.core.bean.copier.CopyOptions;
6+
import javax.persistence.*;
7+
import java.io.Serializable;
8+
9+
/**
10+
* @author zhanghouying
11+
* @date 2019-08-24
12+
*/
13+
@Entity
14+
@Data
15+
@Table(name="mnt_deploy_history")
16+
public class DeployHistory implements Serializable {
17+
18+
/**
19+
* 编号
20+
*/
21+
@Id
22+
@Column(name = "id")
23+
private String id;
24+
25+
/**
26+
* 应用名称
27+
*/
28+
@Column(name = "app_name",nullable = false)
29+
private String appName;
30+
31+
/**
32+
* 部署IP
33+
*/
34+
@Column(name = "ip",nullable = false)
35+
private String ip;
36+
37+
/**
38+
* 部署时间
39+
*/
40+
@Column(name = "deploy_date",nullable = false)
41+
private String deployDate;
42+
43+
/**
44+
* 部署人员
45+
*/
46+
@Column(name = "deploy_user",nullable = false)
47+
private String deployUser;
48+
49+
/**
50+
* 部署编号
51+
*/
52+
@Column(name = "deploy_id",nullable = false)
53+
private String deployId;
54+
55+
public void copy(DeployHistory source){
56+
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
57+
}
58+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package me.zhengjie.modules.mnt.domain;
2+
3+
import lombok.Data;
4+
import cn.hutool.core.bean.BeanUtil;
5+
import cn.hutool.core.bean.copier.CopyOptions;
6+
import javax.persistence.*;
7+
import java.io.Serializable;
8+
9+
/**
10+
* @author zhanghouying
11+
* @date 2019-08-24
12+
*/
13+
@Entity
14+
@Data
15+
@Table(name="mnt_server_account")
16+
public class ServerAccount implements Serializable {
17+
18+
/**
19+
* 编号
20+
*/
21+
@Id
22+
@Column(name = "id")
23+
private String id;
24+
25+
/**
26+
* 名称
27+
*/
28+
@Column(name = "name")
29+
private String name;
30+
31+
/**
32+
* 账号
33+
*/
34+
@Column(name = "account")
35+
private String account;
36+
37+
/**
38+
* 密码
39+
*/
40+
@Column(name = "password")
41+
private String password;
42+
43+
public void copy(ServerAccount source){
44+
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
45+
}
46+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package me.zhengjie.modules.mnt.domain;
2+
3+
import lombok.Data;
4+
import cn.hutool.core.bean.BeanUtil;
5+
import cn.hutool.core.bean.copier.CopyOptions;
6+
import javax.persistence.*;
7+
import java.io.Serializable;
8+
9+
/**
10+
* @author zhanghouying
11+
* @date 2019-08-24
12+
*/
13+
@Entity
14+
@Data
15+
@Table(name="mnt_server")
16+
public class ServerDeploy implements Serializable {
17+
18+
/**
19+
* 服务器IP
20+
*/
21+
@Id
22+
@Column(name = "id")
23+
private String id;
24+
25+
/**
26+
* 服务器账号
27+
*/
28+
@Column(name = "account_id")
29+
private String accountId;
30+
31+
public void copy(ServerDeploy source){
32+
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
33+
}
34+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package me.zhengjie.modules.mnt.repository;
2+
3+
import me.zhengjie.modules.mnt.domain.App;
4+
import org.springframework.data.jpa.repository.JpaRepository;
5+
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6+
7+
/**
8+
* @author zhanghouying
9+
* @date 2019-08-24
10+
*/
11+
public interface AppRepository extends JpaRepository<App, String>, JpaSpecificationExecutor<App> {
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package me.zhengjie.modules.mnt.repository;
2+
3+
import me.zhengjie.modules.mnt.domain.Database;
4+
import org.springframework.data.jpa.repository.JpaRepository;
5+
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6+
7+
/**
8+
* @author zhanghouying
9+
* @date 2019-08-24
10+
*/
11+
public interface DatabaseRepository extends JpaRepository<Database, String>, JpaSpecificationExecutor {
12+
}

0 commit comments

Comments
 (0)