Add software and hardware statistics api

This commit is contained in:
2023-12-06 18:30:56 +08:00
parent d64fdcd5ca
commit c0e9380082
8 changed files with 125 additions and 12 deletions

View File

@@ -0,0 +1,26 @@
package top.fatweb.api.controller.system
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
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.vo.system.HardwareInfoVo
import top.fatweb.api.vo.system.SoftwareInfoVo
@Tag(name = "统计接口", description = "系统信息统计相关接口")
@RequestMapping("/system/statistics")
@RestController
class StatisticsController(
private val statisticsService: IStatisticsService
) {
@Operation(summary = "获取软件信息")
@GetMapping("/software")
fun software(): ResponseResult<SoftwareInfoVo> = ResponseResult.success(data = statisticsService.software())
@Operation(summary = "获取硬件信息")
@GetMapping("/hardware")
fun hardware(): ResponseResult<HardwareInfoVo> = ResponseResult.success(data = statisticsService.hardware())
}