package com.red.circle.other.inner.endpoint.rocket.api;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.dto.rocket.RocketConfigDTO;
import com.red.circle.other.inner.model.dto.rocket.RocketStatisticsDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 火箭配置客户端API
 *
 * @author system
 * @date 2025-01-15
 */
public interface RocketConfigClientApi {

    String API_PREFIX = "/rocket-config/client";

    /**
     * 查询所有配置
     */
    @GetMapping("/queryAll")
    ResultResponse<List<RocketConfigDTO>> queryAll(@RequestParam(value = "status", required = false) Integer status);

    /**
     * 根据ID查询配置
     */
    @GetMapping("/queryById")
    ResultResponse<RocketConfigDTO> queryById(@RequestParam("id") Long id);

    /**
     * 根据等级查询配置
     */
    @GetMapping("/queryByLevel")
    ResultResponse<RocketConfigDTO> queryByLevel(@RequestParam("level") Integer level);

    /**
     * 更新配置
     */
    @PostMapping("/update")
    ResultResponse<Void> update(@RequestBody RocketConfigDTO dto);

    /**
     * 更新状态
     */
    @PostMapping("/updateStatus")
    ResultResponse<Void> updateStatus(@RequestParam("id") Long id, 
                                       @RequestParam("status") Integer status);

    /**
     * 查询统计数据
     */
    @GetMapping("/statistics")
    ResultResponse<RocketStatisticsDTO> queryStatistics();
}
