diff --git a/src/main/kotlin/top/fatweb/api/controller/system/StatisticsController.kt b/src/main/kotlin/top/fatweb/api/controller/system/StatisticController.kt similarity index 83% rename from src/main/kotlin/top/fatweb/api/controller/system/StatisticsController.kt rename to src/main/kotlin/top/fatweb/api/controller/system/StatisticController.kt index cbab4c8..017972a 100644 --- a/src/main/kotlin/top/fatweb/api/controller/system/StatisticsController.kt +++ b/src/main/kotlin/top/fatweb/api/controller/system/StatisticController.kt @@ -6,21 +6,21 @@ import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController import top.fatweb.api.entity.common.ResponseResult -import top.fatweb.api.service.system.IStatisticsService +import top.fatweb.api.service.system.IStatisticService import top.fatweb.api.vo.system.* /** - * Statistics controller + * Statistic controller * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 - * @see IStatisticsService + * @see IStatisticService */ @Tag(name = "统计接口", description = "系统信息统计相关接口") -@RequestMapping("/system/statistics") +@RequestMapping("/system/statistic") @RestController -class StatisticsController( - private val statisticsService: IStatisticsService +class StatisticController( + private val statisticService: IStatisticService ) { /** * Get software information @@ -33,7 +33,7 @@ class StatisticsController( */ @Operation(summary = "获取软件信息") @GetMapping("/software") - fun software(): ResponseResult = ResponseResult.success(data = statisticsService.software()) + fun software(): ResponseResult = ResponseResult.success(data = statisticService.software()) /** * Get hardware information @@ -46,7 +46,7 @@ class StatisticsController( */ @Operation(summary = "获取硬件信息") @GetMapping("/hardware") - fun hardware(): ResponseResult = ResponseResult.success(data = statisticsService.hardware()) + fun hardware(): ResponseResult = ResponseResult.success(data = statisticService.hardware()) /** * Get CPU information @@ -59,7 +59,7 @@ class StatisticsController( */ @Operation(summary = "获取 CPU 信息") @GetMapping("/cpu") - fun cpu(): ResponseResult = ResponseResult.success(data = statisticsService.cpu()) + fun cpu(): ResponseResult = ResponseResult.success(data = statisticService.cpu()) /** * Get storage information @@ -72,5 +72,5 @@ class StatisticsController( */ @Operation(summary = "获取存储信息") @GetMapping("/storage") - fun storage(): ResponseResult = ResponseResult.success(data = statisticsService.storage()) + fun storage(): ResponseResult = ResponseResult.success(data = statisticService.storage()) } \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/service/system/IStatisticsService.kt b/src/main/kotlin/top/fatweb/api/service/system/IStatisticService.kt similarity index 94% rename from src/main/kotlin/top/fatweb/api/service/system/IStatisticsService.kt rename to src/main/kotlin/top/fatweb/api/service/system/IStatisticService.kt index a6c9397..7f37b35 100644 --- a/src/main/kotlin/top/fatweb/api/service/system/IStatisticsService.kt +++ b/src/main/kotlin/top/fatweb/api/service/system/IStatisticService.kt @@ -3,12 +3,12 @@ package top.fatweb.api.service.system import top.fatweb.api.vo.system.* /** - * Statistics service interface + * Statistic service interface * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ -interface IStatisticsService { +interface IStatisticService { /** * Get software information * diff --git a/src/main/kotlin/top/fatweb/api/service/system/impl/StatisticsServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/system/impl/StatisticServiceImpl.kt similarity index 98% rename from src/main/kotlin/top/fatweb/api/service/system/impl/StatisticsServiceImpl.kt rename to src/main/kotlin/top/fatweb/api/service/system/impl/StatisticServiceImpl.kt index 771dcfe..fb141d9 100644 --- a/src/main/kotlin/top/fatweb/api/service/system/impl/StatisticsServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/system/impl/StatisticServiceImpl.kt @@ -4,7 +4,7 @@ import org.springframework.stereotype.Service import oshi.SystemInfo import oshi.hardware.CentralProcessor import top.fatweb.api.properties.ServerProperties -import top.fatweb.api.service.system.IStatisticsService +import top.fatweb.api.service.system.IStatisticService import top.fatweb.api.util.ByteUtil import top.fatweb.api.vo.system.* import java.time.LocalDateTime @@ -13,13 +13,13 @@ import java.util.* import java.util.concurrent.TimeUnit /** - * Statistics service implement + * Statistic service implement * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ @Service -class StatisticsServiceImpl : IStatisticsService { +class StatisticServiceImpl : IStatisticService { private val systemProperties: Properties = System.getProperties() private val systemInfo: SystemInfo = SystemInfo() private val runtime: Runtime = Runtime.getRuntime()