package com.multictrl.modules.business.controller;

import com.multictrl.common.annotation.ApiOrder;
import com.multictrl.common.constant.Constant;
import com.multictrl.common.utils.Result;
import com.multictrl.modules.business.service.MiscService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * api接口
 *
 * @author Sdy
 * @since 1.0.0 2026/5/10
 */
@RestController
@RequestMapping("business/misc")
@Tag(name = "api接口")
@ApiOrder(0)
@RequiredArgsConstructor
public class MiscController {
    private final MiscService miscService;

    //    @LogOperation("HMS健康日志")
    @GetMapping("/getHmsLog")
    @Operation(summary = "HMS健康日志")
    @Parameters({
            @Parameter(name = Constant.PAGE, description = "当前页码，从1开始"),
            @Parameter(name = Constant.LIMIT, description = "每页显示记录数"),
            @Parameter(name = "dockSn", description = "机库sn码"),
            @Parameter(name = "level", description = "告警等级 {0:通知,1:提醒,2:警告},默认查询所有")
    })
    @RequiresPermissions("bus:misc:getHmsLog")
    public Result<Object> getHmsLog(@Parameter(hidden = true) @RequestParam Map<String, Object> params) {

        return new Result<>().ok(miscService.pageHmsLog(params));
    }
}
