This commit is contained in:
2023-12-11 14:12:50 +08:00
parent dafc0ac671
commit cebeaff054
8 changed files with 486 additions and 0 deletions

View File

@@ -2,12 +2,50 @@ package top.fatweb.api.service.system
import top.fatweb.api.vo.system.*
/**
* Statistics service interface
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
interface IStatisticsService {
/**
* Get software information
*
* @return SoftwareInfoVo object
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see SoftwareInfoVo
*/
fun software(): SoftwareInfoVo
/**
* Get hardware information
*
* @return HardwareInfoVo object
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see HardwareInfoVo
*/
fun hardware(): HardwareInfoVo
/**
* Get CPU information
*
* @return CpuInfoVo object
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see CpuInfoVo
*/
fun cpu(): CpuInfoVo
/**
* Get storage information
*
* @return StorageInfoVo object
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see StorageInfoVo
*/
fun storage(): StorageInfoVo
}

View File

@@ -12,6 +12,12 @@ import java.time.ZoneOffset
import java.util.*
import java.util.concurrent.TimeUnit
/**
* Statistics service implement
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Service
class StatisticsServiceImpl : IStatisticsService {
private val systemProperties: Properties = System.getProperties()