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-monitor/src/main/java/me/zhengjie/res/ServerMonitorController.java
deleted
100644 → 0
View file @
d35ffc9d
package
me.zhengjie.res
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
oshi.SystemInfo
;
import
oshi.hardware.CentralProcessor
;
import
oshi.hardware.GlobalMemory
;
import
oshi.hardware.HardwareAbstractionLayer
;
import
oshi.hardware.VirtualMemory
;
import
oshi.software.os.OSFileStore
;
import
oshi.software.os.OperatingSystem
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* @author Zhang houying
* @date 2019-11-03
*/
@RestController
@RequestMapping
(
"/api/serverMonitor"
)
public
class
ServerMonitorController
{
private
static
final
double
GB
=
1024
*
1024
*
1024.00
;
@GetMapping
public
ResponseEntity
<
Object
>
getServerInfo
()
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
8
);
try
{
SystemInfo
si
=
new
SystemInfo
();
HardwareAbstractionLayer
hal
=
si
.
getHardware
();
CentralProcessor
processor
=
hal
.
getProcessor
();
long
[]
prevTicks
=
processor
.
getSystemCpuLoadTicks
();
TimeUnit
.
SECONDS
.
sleep
(
1
);
resultMap
.
put
(
"cpuRate"
,
processor
.
getSystemCpuLoadBetweenTicks
(
prevTicks
));
resultMap
.
put
(
"cpuCore"
,
processor
.
getLogicalProcessorCount
());
GlobalMemory
memory
=
hal
.
getMemory
();
resultMap
.
put
(
"memTotal"
,
memory
.
getTotal
()
/
GB
);
resultMap
.
put
(
"memUsed"
,
(
memory
.
getTotal
()
-
memory
.
getAvailable
())
/
GB
);
double
diskTotal
=
0
;
double
diskUsable
=
0
;
OperatingSystem
os
=
si
.
getOperatingSystem
();
OSFileStore
[]
fsArray
=
os
.
getFileSystem
().
getFileStores
();
for
(
OSFileStore
fs
:
fsArray
)
{
long
usable
=
fs
.
getUsableSpace
();
long
total
=
fs
.
getTotalSpace
();
diskTotal
+=
total
/
GB
;
diskUsable
+=
usable
/
GB
;
}
resultMap
.
put
(
"diskTotal"
,
diskTotal
);
resultMap
.
put
(
"diskUsed"
,
diskTotal
-
diskUsable
);
VirtualMemory
vm
=
memory
.
getVirtualMemory
();
resultMap
.
put
(
"swapTotal"
,
vm
.
getSwapTotal
()
/
GB
);
resultMap
.
put
(
"swapUsed"
,
vm
.
getSwapUsed
()
/
GB
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
new
ResponseEntity
<>(
resultMap
,
HttpStatus
.
OK
);
}
}
eladmin-monitor/src/main/resources/banner.txt
deleted
100644 → 0
View file @
d35ffc9d
_ _ _
| | | | (_)
___| |______ __ _ __| |_ __ ___ _ _ __
/ _ | |______/ _` |/ _` | '_ ` _ \| | '_ \
| __| | | (_| | (_| | | | | | | | | | |
\___|_| \__,_|\__,_|_| |_| |_|_|_| |_|
:: Spring Boot :: (v2.1.0.RELEASE)
\ No newline at end of file
eladmin-monitor/src/main/resources/config/application.yml
deleted
100644 → 0
View file @
d35ffc9d
server
:
port
:
8777
eladmin-monitor/src/main/resources/logback.xml
deleted
100644 → 0
View file @
d35ffc9d
<?xml version="1.0" encoding="UTF-8"?>
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<contextName>
elAdmin Monitor
</contextName>
<!--输出到控制台-->
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)
</pattern>
<charset>
utf-8
</charset>
</encoder>
</appender>
<!--普通日志输出到控制台-->
<root
level=
"info"
>
<appender-ref
ref=
"console"
/>
</root>
</configuration>
eladmin-monitor/src/test/java/me/zhengjie/SystemInfoTest.java
deleted
100644 → 0
View file @
d35ffc9d
/**
* MIT License
* <p>
* Copyright (c) 2010 - 2020 The OSHI Project Contributors: https://github.com/oshi/oshi/graphs/contributors
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package
me.zhengjie
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
java.time.Instant
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.junit.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
oshi.PlatformEnum
;
import
oshi.SystemInfo
;
import
oshi.hardware.CentralProcessor
;
import
oshi.hardware.CentralProcessor.TickType
;
import
oshi.hardware.ComputerSystem
;
import
oshi.hardware.Display
;
import
oshi.hardware.GlobalMemory
;
import
oshi.hardware.HWDiskStore
;
import
oshi.hardware.HWPartition
;
import
oshi.hardware.HardwareAbstractionLayer
;
import
oshi.hardware.NetworkIF
;
import
oshi.hardware.PhysicalMemory
;
import
oshi.hardware.PowerSource
;
import
oshi.hardware.Sensors
;
import
oshi.hardware.SoundCard
;
import
oshi.hardware.UsbDevice
;
import
oshi.hardware.VirtualMemory
;
import
oshi.software.os.FileSystem
;
import
oshi.software.os.NetworkParams
;
import
oshi.software.os.OSFileStore
;
import
oshi.software.os.OSProcess
;
import
oshi.software.os.OSService
;
import
oshi.software.os.OperatingSystem
;
import
oshi.software.os.OperatingSystem.ProcessSort
;
import
oshi.util.FormatUtil
;
import
oshi.util.Util
;
/**
* A demonstration of access to many of OSHI's capabilities
*/
public
class
SystemInfoTest
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SystemInfoTest
.
class
);
static
List
<
String
>
oshi
=
new
ArrayList
<>();
/**
* Test that this platform is implemented..
*/
@Test
public
void
testPlatformEnum
()
{
assertFalse
(
PlatformEnum
.
UNKNOWN
.
equals
(
SystemInfo
.
getCurrentPlatformEnum
()));
// Exercise the main method
main
(
null
);
}
/**
* The main method, demonstrating use of classes.
*
* @param args the arguments (unused)
*/
public
static
void
main
(
String
[]
args
)
{
logger
.
info
(
"Initializing System..."
);
SystemInfo
si
=
new
SystemInfo
();
HardwareAbstractionLayer
hal
=
si
.
getHardware
();
OperatingSystem
os
=
si
.
getOperatingSystem
();
printOperatingSystem
(
os
);
logger
.
info
(
"Checking computer system..."
);
printComputerSystem
(
hal
.
getComputerSystem
());
logger
.
info
(
"Checking Processor..."
);
printProcessor
(
hal
.
getProcessor
());
logger
.
info
(
"Checking Memory..."
);
printMemory
(
hal
.
getMemory
());
logger
.
info
(
"Checking CPU..."
);
printCpu
(
hal
.
getProcessor
());
logger
.
info
(
"Checking Processes..."
);
printProcesses
(
os
,
hal
.
getMemory
());
logger
.
info
(
"Checking Services..."
);
printServices
(
os
);
logger
.
info
(
"Checking Sensors..."
);
printSensors
(
hal
.
getSensors
());
logger
.
info
(
"Checking Power sources..."
);
printPowerSources
(
hal
.
getPowerSources
());
logger
.
info
(
"Checking Disks..."
);
printDisks
(
hal
.
getDiskStores
());
logger
.
info
(
"Checking File System..."
);
printFileSystem
(
os
.
getFileSystem
());
logger
.
info
(
"Checking Network interfaces..."
);
printNetworkInterfaces
(
hal
.
getNetworkIFs
());
logger
.
info
(
"Checking Network parameters..."
);
printNetworkParameters
(
os
.
getNetworkParams
());
// hardware: displays
logger
.
info
(
"Checking Displays..."
);
printDisplays
(
hal
.
getDisplays
());
// hardware: USB devices
logger
.
info
(
"Checking USB Devices..."
);
printUsbDevices
(
hal
.
getUsbDevices
(
true
));
logger
.
info
(
"Checking Sound Cards..."
);
printSoundCards
(
hal
.
getSoundCards
());
StringBuilder
output
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
oshi
.
size
();
i
++)
{
output
.
append
(
oshi
.
get
(
i
));
if
(
oshi
.
get
(
i
)
!=
null
&&
!
oshi
.
get
(
i
).
endsWith
(
"\n"
))
{
output
.
append
(
'\n'
);
}
}
logger
.
info
(
"Printing Operating System and Hardware Info:{}{}"
,
'\n'
,
output
);
}
private
static
void
printOperatingSystem
(
final
OperatingSystem
os
)
{
oshi
.
add
(
String
.
valueOf
(
os
));
oshi
.
add
(
"Booted: "
+
Instant
.
ofEpochSecond
(
os
.
getSystemBootTime
()));
oshi
.
add
(
"Uptime: "
+
FormatUtil
.
formatElapsedSecs
(
os
.
getSystemUptime
()));
oshi
.
add
(
"Running with"
+
(
os
.
isElevated
()
?
""
:
"out"
)
+
" elevated permissions."
);
}
private
static
void
printComputerSystem
(
final
ComputerSystem
computerSystem
)
{
oshi
.
add
(
"system: "
+
computerSystem
.
toString
());
oshi
.
add
(
" firmware: "
+
computerSystem
.
getFirmware
().
toString
());
oshi
.
add
(
" baseboard: "
+
computerSystem
.
getBaseboard
().
toString
());
}
private
static
void
printProcessor
(
CentralProcessor
processor
)
{
oshi
.
add
(
processor
.
toString
());
}
private
static
void
printMemory
(
GlobalMemory
memory
)
{
oshi
.
add
(
"Memory: \n "
+
memory
.
toString
());
VirtualMemory
vm
=
memory
.
getVirtualMemory
();
oshi
.
add
(
"Swap: \n "
+
vm
.
toString
());
PhysicalMemory
[]
pmArray
=
memory
.
getPhysicalMemory
();
if
(
pmArray
.
length
>
0
)
{
oshi
.
add
(
"Physical Memory: "
);
for
(
PhysicalMemory
pm
:
pmArray
)
{
oshi
.
add
(
" "
+
pm
.
toString
());
}
}
}
private
static
void
printCpu
(
CentralProcessor
processor
)
{
oshi
.
add
(
"Context Switches/Interrupts: "
+
processor
.
getContextSwitches
()
+
" / "
+
processor
.
getInterrupts
());
long
[]
prevTicks
=
processor
.
getSystemCpuLoadTicks
();
long
[][]
prevProcTicks
=
processor
.
getProcessorCpuLoadTicks
();
oshi
.
add
(
"CPU, IOWait, and IRQ ticks @ 0 sec:"
+
Arrays
.
toString
(
prevTicks
));
// Wait a second...
Util
.
sleep
(
1000
);
long
[]
ticks
=
processor
.
getSystemCpuLoadTicks
();
oshi
.
add
(
"CPU, IOWait, and IRQ ticks @ 1 sec:"
+
Arrays
.
toString
(
ticks
));
long
user
=
ticks
[
TickType
.
USER
.
getIndex
()]
-
prevTicks
[
TickType
.
USER
.
getIndex
()];
long
nice
=
ticks
[
TickType
.
NICE
.
getIndex
()]
-
prevTicks
[
TickType
.
NICE
.
getIndex
()];
long
sys
=
ticks
[
TickType
.
SYSTEM
.
getIndex
()]
-
prevTicks
[
TickType
.
SYSTEM
.
getIndex
()];
long
idle
=
ticks
[
TickType
.
IDLE
.
getIndex
()]
-
prevTicks
[
TickType
.
IDLE
.
getIndex
()];
long
iowait
=
ticks
[
TickType
.
IOWAIT
.
getIndex
()]
-
prevTicks
[
TickType
.
IOWAIT
.
getIndex
()];
long
irq
=
ticks
[
TickType
.
IRQ
.
getIndex
()]
-
prevTicks
[
TickType
.
IRQ
.
getIndex
()];
long
softirq
=
ticks
[
TickType
.
SOFTIRQ
.
getIndex
()]
-
prevTicks
[
TickType
.
SOFTIRQ
.
getIndex
()];
long
steal
=
ticks
[
TickType
.
STEAL
.
getIndex
()]
-
prevTicks
[
TickType
.
STEAL
.
getIndex
()];
long
totalCpu
=
user
+
nice
+
sys
+
idle
+
iowait
+
irq
+
softirq
+
steal
;
oshi
.
add
(
String
.
format
(
"User: %.1f%% Nice: %.1f%% System: %.1f%% Idle: %.1f%% IOwait: %.1f%% IRQ: %.1f%% SoftIRQ: %.1f%% Steal: %.1f%%"
,
100
d
*
user
/
totalCpu
,
100
d
*
nice
/
totalCpu
,
100
d
*
sys
/
totalCpu
,
100
d
*
idle
/
totalCpu
,
100
d
*
iowait
/
totalCpu
,
100
d
*
irq
/
totalCpu
,
100
d
*
softirq
/
totalCpu
,
100
d
*
steal
/
totalCpu
));
oshi
.
add
(
String
.
format
(
"CPU load: %.1f%%"
,
processor
.
getSystemCpuLoadBetweenTicks
(
prevTicks
)
*
100
));
double
[]
loadAverage
=
processor
.
getSystemLoadAverage
(
3
);
oshi
.
add
(
"CPU load averages:"
+
(
loadAverage
[
0
]
<
0
?
" N/A"
:
String
.
format
(
" %.2f"
,
loadAverage
[
0
]))
+
(
loadAverage
[
1
]
<
0
?
" N/A"
:
String
.
format
(
" %.2f"
,
loadAverage
[
1
]))
+
(
loadAverage
[
2
]
<
0
?
" N/A"
:
String
.
format
(
" %.2f"
,
loadAverage
[
2
])));
// per core CPU
StringBuilder
procCpu
=
new
StringBuilder
(
"CPU load per processor:"
);
double
[]
load
=
processor
.
getProcessorCpuLoadBetweenTicks
(
prevProcTicks
);
for
(
double
avg
:
load
)
{
procCpu
.
append
(
String
.
format
(
" %.1f%%"
,
avg
*
100
));
}
oshi
.
add
(
procCpu
.
toString
());
long
freq
=
processor
.
getProcessorIdentifier
().
getVendorFreq
();
if
(
freq
>
0
)
{
oshi
.
add
(
"Vendor Frequency: "
+
FormatUtil
.
formatHertz
(
freq
));
}
freq
=
processor
.
getMaxFreq
();
if
(
freq
>
0
)
{
oshi
.
add
(
"Max Frequency: "
+
FormatUtil
.
formatHertz
(
freq
));
}
long
[]
freqs
=
processor
.
getCurrentFreq
();
if
(
freqs
[
0
]
>
0
)
{
StringBuilder
sb
=
new
StringBuilder
(
"Current Frequencies: "
);
for
(
int
i
=
0
;
i
<
freqs
.
length
;
i
++)
{
if
(
i
>
0
)
{
sb
.
append
(
", "
);
}
sb
.
append
(
FormatUtil
.
formatHertz
(
freqs
[
i
]));
}
oshi
.
add
(
sb
.
toString
());
}
}
private
static
void
printProcesses
(
OperatingSystem
os
,
GlobalMemory
memory
)
{
oshi
.
add
(
"My PID: "
+
os
.
getProcessId
()
+
" with affinity "
+
Long
.
toBinaryString
(
os
.
getProcessAffinityMask
(
os
.
getProcessId
())));
oshi
.
add
(
"Processes: "
+
os
.
getProcessCount
()
+
", Threads: "
+
os
.
getThreadCount
());
// Sort by highest CPU
List
<
OSProcess
>
procs
=
Arrays
.
asList
(
os
.
getProcesses
(
5
,
ProcessSort
.
CPU
));
oshi
.
add
(
" PID %CPU %MEM VSZ RSS Name"
);
for
(
int
i
=
0
;
i
<
procs
.
size
()
&&
i
<
5
;
i
++)
{
OSProcess
p
=
procs
.
get
(
i
);
oshi
.
add
(
String
.
format
(
" %5d %5.1f %4.1f %9s %9s %s"
,
p
.
getProcessID
(),
100
d
*
(
p
.
getKernelTime
()
+
p
.
getUserTime
())
/
p
.
getUpTime
(),
100
d
*
p
.
getResidentSetSize
()
/
memory
.
getTotal
(),
FormatUtil
.
formatBytes
(
p
.
getVirtualSize
()),
FormatUtil
.
formatBytes
(
p
.
getResidentSetSize
()),
p
.
getName
()));
}
}
private
static
void
printServices
(
OperatingSystem
os
)
{
oshi
.
add
(
"Services: "
);
oshi
.
add
(
" PID State Name"
);
// DO 5 each of running and stopped
int
i
=
0
;
for
(
OSService
s
:
os
.
getServices
())
{
if
(
s
.
getState
().
equals
(
OSService
.
State
.
RUNNING
)
&&
i
++
<
5
)
{
oshi
.
add
(
String
.
format
(
" %5d %7s %s"
,
s
.
getProcessID
(),
s
.
getState
(),
s
.
getName
()));
}
}
i
=
0
;
for
(
OSService
s
:
os
.
getServices
())
{
if
(
s
.
getState
().
equals
(
OSService
.
State
.
STOPPED
)
&&
i
++
<
5
)
{
oshi
.
add
(
String
.
format
(
" %5d %7s %s"
,
s
.
getProcessID
(),
s
.
getState
(),
s
.
getName
()));
}
}
}
private
static
void
printSensors
(
Sensors
sensors
)
{
oshi
.
add
(
"Sensors: "
+
sensors
.
toString
());
}
private
static
void
printPowerSources
(
PowerSource
[]
powerSources
)
{
StringBuilder
sb
=
new
StringBuilder
(
"Power Sources: "
);
if
(
powerSources
.
length
==
0
)
{
sb
.
append
(
"Unknown"
);
}
for
(
PowerSource
powerSource
:
powerSources
)
{
sb
.
append
(
"\n "
).
append
(
powerSource
.
toString
());
}
oshi
.
add
(
sb
.
toString
());
}
private
static
void
printDisks
(
HWDiskStore
[]
diskStores
)
{
oshi
.
add
(
"Disks:"
);
for
(
HWDiskStore
disk
:
diskStores
)
{
oshi
.
add
(
" "
+
disk
.
toString
());
HWPartition
[]
partitions
=
disk
.
getPartitions
();
for
(
HWPartition
part
:
partitions
)
{
oshi
.
add
(
" |-- "
+
part
.
toString
());
}
}
}
private
static
void
printFileSystem
(
FileSystem
fileSystem
)
{
oshi
.
add
(
"File System:"
);
oshi
.
add
(
String
.
format
(
" File Descriptors: %d/%d"
,
fileSystem
.
getOpenFileDescriptors
(),
fileSystem
.
getMaxFileDescriptors
()));
OSFileStore
[]
fsArray
=
fileSystem
.
getFileStores
();
for
(
OSFileStore
fs
:
fsArray
)
{
long
usable
=
fs
.
getUsableSpace
();
long
total
=
fs
.
getTotalSpace
();
oshi
.
add
(
String
.
format
(
" %s (%s) [%s] %s of %s free (%.1f%%), %s of %s files free (%.1f%%) is %s "
+
(
fs
.
getLogicalVolume
()
!=
null
&&
fs
.
getLogicalVolume
().
length
()
>
0
?
"[%s]"
:
"%s"
)
+
" and is mounted at %s"
,
fs
.
getName
(),
fs
.
getDescription
().
isEmpty
()
?
"file system"
:
fs
.
getDescription
(),
fs
.
getType
(),
FormatUtil
.
formatBytes
(
usable
),
FormatUtil
.
formatBytes
(
fs
.
getTotalSpace
()),
100
d
*
usable
/
total
,
FormatUtil
.
formatValue
(
fs
.
getFreeInodes
(),
""
),
FormatUtil
.
formatValue
(
fs
.
getTotalInodes
(),
""
),
100
d
*
fs
.
getFreeInodes
()
/
fs
.
getTotalInodes
(),
fs
.
getVolume
(),
fs
.
getLogicalVolume
(),
fs
.
getMount
()));
}
}
private
static
void
printNetworkInterfaces
(
NetworkIF
[]
networkIFs
)
{
StringBuilder
sb
=
new
StringBuilder
(
"Network Interfaces:"
);
if
(
networkIFs
.
length
==
0
)
{
sb
.
append
(
" Unknown"
);
}
for
(
NetworkIF
net
:
networkIFs
)
{
sb
.
append
(
"\n "
).
append
(
net
.
toString
());
}
oshi
.
add
(
sb
.
toString
());
}
private
static
void
printNetworkParameters
(
NetworkParams
networkParams
)
{
oshi
.
add
(
"Network parameters:\n "
+
networkParams
.
toString
());
}
private
static
void
printDisplays
(
Display
[]
displays
)
{
oshi
.
add
(
"Displays:"
);
int
i
=
0
;
for
(
Display
display
:
displays
)
{
oshi
.
add
(
" Display "
+
i
+
":"
);
oshi
.
add
(
String
.
valueOf
(
display
));
i
++;
}
}
private
static
void
printUsbDevices
(
UsbDevice
[]
usbDevices
)
{
oshi
.
add
(
"USB Devices:"
);
for
(
UsbDevice
usbDevice
:
usbDevices
)
{
oshi
.
add
(
String
.
valueOf
(
usbDevice
));
}
}
private
static
void
printSoundCards
(
SoundCard
[]
cards
)
{
oshi
.
add
(
"Sound Cards:"
);
for
(
SoundCard
card
:
cards
)
{
oshi
.
add
(
" "
+
String
.
valueOf
(
card
));
}
}
}
\ No newline at end of file
eladmin-system/pom.xml
View file @
7c35a79c
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
<properties>
<properties>
<jjwt.version>
0.10.6
</jjwt.version>
<jjwt.version>
0.10.6
</jjwt.version>
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 -->
<jna.version>
5.5.0
</jna.version>
</properties>
</properties>
<dependencies>
<dependencies>
...
@@ -77,6 +79,12 @@
...
@@ -77,6 +79,12 @@
<version>
0.1.55
</version>
<version>
0.1.55
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.oshi
</groupId>
<artifactId>
oshi-core
</artifactId>
<version>
4.7.1
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
eladmin-system/src/main/java/me/zhengjie/AppRun.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
;
package
me.zhengjie
;
import
io.swagger.annotations.Api
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.utils.SpringContextHolder
;
import
me.zhengjie.utils.SpringContextHolder
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
...
@@ -20,9 +36,10 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -20,9 +36,10 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@EnableAsync
@EnableAsync
@RestController
@RestController
@
EnableJpaAuditing
(
auditorAwareRef
=
"auditorAware"
)
@
Api
(
hidden
=
true
)
@SpringBootApplication
@SpringBootApplication
@EnableTransactionManagement
@EnableTransactionManagement
@EnableJpaAuditing
(
auditorAwareRef
=
"auditorAware"
)
public
class
AppRun
{
public
class
AppRun
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.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.config
;
package
me.zhengjie.config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
...
eladmin-system/src/main/java/me/zhengjie/config/DataScope.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.config
;
package
me.zhengjie.config
;
import
me.zhengjie.modules.system.domain.Dept
;
import
me.zhengjie.modules.system.domain.Dept
;
...
...
eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.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.config
;
package
me.zhengjie.config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
...
eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskExecutePool.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.config.thread
;
package
me.zhengjie.config.thread
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.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.config.thread
;
package
me.zhengjie.config.thread
;
import
lombok.Data
;
import
lombok.Data
;
...
...
eladmin-system/src/main/java/me/zhengjie/config/thread/TheadFactoryName.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.config.thread
;
package
me.zhengjie.config.thread
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
...
eladmin-system/src/main/java/me/zhengjie/config/thread/ThreadPoolExecutorUtil.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.config.thread
;
package
me.zhengjie.config.thread
;
import
me.zhengjie.utils.SpringContextHolder
;
import
me.zhengjie.utils.SpringContextHolder
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.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.domain
;
package
me.zhengjie.modules.mnt.domain
;
import
lombok.Data
;
import
io.swagger.annotations.ApiModelProperty
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
org.hibernate.annotations.CreationTimestamp
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseEntity
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
/**
* @author zhanghouying
* @author zhanghouying
* @date 2019-08-24
* @date 2019-08-24
*/
*/
@Entity
@Entity
@Data
@Getter
@Setter
@Table
(
name
=
"mnt_app"
)
@Table
(
name
=
"mnt_app"
)
public
class
App
implements
Serializable
{
public
class
App
extends
BaseEntity
implements
Serializable
{
/**
* 应用编号
*/
@Id
@Id
@Column
(
name
=
"app_id"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
/**
@ApiModelProperty
(
value
=
"名称"
)
* 应用名称
*/
@Column
(
name
=
"name"
)
private
String
name
;
private
String
name
;
/**
@ApiModelProperty
(
value
=
"端口"
)
* 端口
*/
@Column
(
name
=
"port"
)
private
int
port
;
private
int
port
;
/**
@ApiModelProperty
(
value
=
"上传路径"
)
* 上传目录
*/
@Column
(
name
=
"upload_path"
)
private
String
uploadPath
;
private
String
uploadPath
;
/**
@ApiModelProperty
(
value
=
"部署路径"
)
* 部署目录
*/
@Column
(
name
=
"deploy_path"
)
private
String
deployPath
;
private
String
deployPath
;
/**
@ApiModelProperty
(
value
=
"备份路径"
)
* 备份目录
*/
@Column
(
name
=
"backup_path"
)
private
String
backupPath
;
private
String
backupPath
;
/**
@ApiModelProperty
(
value
=
"启动脚本"
)
* 启动脚本
*/
@Column
(
name
=
"start_script"
)
private
String
startScript
;
private
String
startScript
;
/**
@ApiModelProperty
(
value
=
"部署脚本"
)
* 部署脚本
*/
@Column
(
name
=
"deploy_script"
)
private
String
deployScript
;
private
String
deployScript
;
@CreationTimestamp
private
Timestamp
createTime
;
public
void
copy
(
App
source
){
public
void
copy
(
App
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.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.domain
;
package
me.zhengjie.modules.mnt.domain
;
import
lombok.Data
;
import
io.swagger.annotations.ApiModelProperty
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
org.hibernate.annotations.CreationTimestamp
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseEntity
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
/**
* @author zhanghouying
* @author zhanghouying
* @date 2019-08-24
* @date 2019-08-24
*/
*/
@Entity
@Entity
@Data
@Getter
@Setter
@Table
(
name
=
"mnt_database"
)
@Table
(
name
=
"mnt_database"
)
public
class
Database
implements
Serializable
{
public
class
Database
extends
BaseEntity
implements
Serializable
{
/**
* id
*/
@Id
@Id
@Column
(
name
=
"id"
)
@Column
(
name
=
"db_id"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
private
String
id
;
private
String
id
;
/**
@ApiModelProperty
(
value
=
"数据库名称"
)
* 数据库名称
*/
@Column
(
name
=
"name"
,
nullable
=
false
)
private
String
name
;
private
String
name
;
/**
@ApiModelProperty
(
value
=
"数据库连接地址"
)
* 数据库连接地址
*/
@Column
(
name
=
"jdbc_url"
,
nullable
=
false
)
private
String
jdbcUrl
;
private
String
jdbcUrl
;
/**
@ApiModelProperty
(
value
=
"数据库密码"
)
* 数据库密码
*/
@Column
(
name
=
"pwd"
,
nullable
=
false
)
private
String
pwd
;
private
String
pwd
;
/**
@ApiModelProperty
(
value
=
"用户名"
)
* 用户名
*/
@Column
(
name
=
"user_name"
,
nullable
=
false
)
private
String
userName
;
private
String
userName
;
@CreationTimestamp
private
Timestamp
createTime
;
public
void
copy
(
Database
source
){
public
void
copy
(
Database
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.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.domain
;
package
me.zhengjie.modules.mnt.domain
;
import
lombok.Data
;
import
io.swagger.annotations.ApiModelProperty
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
org.hibernate.annotations.CreationTimestamp
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseEntity
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.Set
;
import
java.util.Set
;
/**
/**
...
@@ -15,34 +30,29 @@ import java.util.Set;
...
@@ -15,34 +30,29 @@ import java.util.Set;
* @date 2019-08-24
* @date 2019-08-24
*/
*/
@Entity
@Entity
@Data
@Getter
@Setter
@Table
(
name
=
"mnt_deploy"
)
@Table
(
name
=
"mnt_deploy"
)
public
class
Deploy
implements
Serializable
{
public
class
Deploy
extends
BaseEntity
implements
Serializable
{
/**
* 部署编号
*/
@Id
@Id
@Column
(
name
=
"deploy_id"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
/**
@ManyToMany
* 应用编号
@ApiModelProperty
(
name
=
"服务器"
,
hidden
=
true
)
*/
@JoinTable
(
name
=
"mnt_deploy_server"
,
joinColumns
=
{
@JoinColumn
(
name
=
"deploy_id"
,
referencedColumnName
=
"deploy_id"
)},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"server_id"
,
referencedColumnName
=
"server_id"
)})
private
Set
<
ServerDeploy
>
deploys
;
@ManyToOne
@ManyToOne
@JoinColumn
(
name
=
"app_id"
)
@JoinColumn
(
name
=
"app_id"
)
@ApiModelProperty
(
value
=
"应用编号"
)
private
App
app
;
private
App
app
;
/**
* 服务器
*/
@ManyToMany
@JoinTable
(
name
=
"mnt_deploy_server"
,
joinColumns
=
{
@JoinColumn
(
name
=
"deploy_id"
,
referencedColumnName
=
"id"
)},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"server_id"
,
referencedColumnName
=
"id"
)})
private
Set
<
ServerDeploy
>
deploys
;
@CreationTimestamp
private
Timestamp
createTime
;
public
void
copy
(
Deploy
source
){
public
void
copy
(
Deploy
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.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.domain
;
package
me.zhengjie.modules.mnt.domain
;
import
lombok.Data
;
import
io.swagger.annotations.ApiModelProperty
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
lombok.Getter
;
import
lombok.Setter
;
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
;
...
@@ -14,46 +30,30 @@ import java.sql.Timestamp;
...
@@ -14,46 +30,30 @@ import java.sql.Timestamp;
* @date 2019-08-24
* @date 2019-08-24
*/
*/
@Entity
@Entity
@Data
@Getter
@Setter
@Table
(
name
=
"mnt_deploy_history"
)
@Table
(
name
=
"mnt_deploy_history"
)
public
class
DeployHistory
implements
Serializable
{
public
class
DeployHistory
implements
Serializable
{
/**
* 编号
*/
@Id
@Id
@Column
(
name
=
"id"
)
@Column
(
name
=
"history_id"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
private
String
id
;
private
String
id
;
/**
@ApiModelProperty
(
value
=
"应用名称"
)
* 应用名称
*/
@Column
(
name
=
"app_name"
,
nullable
=
false
)
private
String
appName
;
private
String
appName
;
/**
@ApiModelProperty
(
value
=
"IP"
)
* 部署IP
*/
@Column
(
name
=
"ip"
,
nullable
=
false
)
private
String
ip
;
private
String
ip
;
/**
* 部署时间
*/
@Column
(
name
=
"deploy_date"
)
@CreationTimestamp
@CreationTimestamp
@ApiModelProperty
(
value
=
"部署时间"
)
private
Timestamp
deployDate
;
private
Timestamp
deployDate
;
/**
@ApiModelProperty
(
value
=
"部署者"
)
* 部署人员
*/
@Column
(
name
=
"deploy_user"
,
nullable
=
false
)
private
String
deployUser
;
private
String
deployUser
;
/**
@ApiModelProperty
(
value
=
"部署ID"
)
* 部署编号
*/
@Column
(
name
=
"deploy_id"
,
nullable
=
false
)
private
Long
deployId
;
private
Long
deployId
;
public
void
copy
(
DeployHistory
source
){
public
void
copy
(
DeployHistory
source
){
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.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.domain
;
package
me.zhengjie.modules.mnt.domain
;
import
lombok.Data
;
import
io.swagger.annotations.ApiModelProperty
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
org.hibernate.annotations.CreationTimestamp
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseEntity
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
/**
* @author zhanghouying
* @author zhanghouying
* @date 2019-08-24
* @date 2019-08-24
*/
*/
@Entity
@Entity
@Data
@Getter
@Setter
@Table
(
name
=
"mnt_server"
)
@Table
(
name
=
"mnt_server"
)
public
class
ServerDeploy
implements
Serializable
{
public
class
ServerDeploy
extends
BaseEntity
implements
Serializable
{
@Id
@Id
@Column
(
name
=
"server_id"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"服务器名称"
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
value
=
"IP"
)
private
String
ip
;
private
String
ip
;
@ApiModelProperty
(
value
=
"端口"
)
private
Integer
port
;
private
Integer
port
;
@ApiModelProperty
(
value
=
"账号"
)
private
String
account
;
private
String
account
;
@ApiModelProperty
(
value
=
"密码"
)
private
String
password
;
private
String
password
;
@CreationTimestamp
private
Timestamp
createTime
;
public
void
copy
(
ServerDeploy
source
){
public
void
copy
(
ServerDeploy
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.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.repository
;
package
me.zhengjie.modules.mnt.repository
;
import
me.zhengjie.modules.mnt.domain.App
;
import
me.zhengjie.modules.mnt.domain.App
;
...
...
Prev
1
2
3
4
5
6
7
8
…
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