package com.yeejoin.amos.boot.module.statistcs.biz.controller;

import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.ComprehensiveStatisticalAnalysisServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;

import java.util.List;
import java.util.Map;

/**
 * 综合统计分析API
 *
 * @author system_generator
 * @date 2025-06-24
 */
@RestController
@Api(tags = "综合统计分析API")
@RequestMapping(value = "/comprehensiveStatisticalAnalysis")
public class ComprehensiveStatisticalAnalysisController extends BaseController {

    @Autowired
    private ComprehensiveStatisticalAnalysisServiceImpl comprehensiveStatisticalAnalysisServiceImpl;

    /**
     * 查询设备分类
     *
     * @param category
     * @return
     */
    @TycloudOperation(ApiLevel = UserType.AGENCY)
    @PostMapping(value = "/select/equipmentCategory")
    @ApiOperation(httpMethod = "POST", value = "查询设备分类", notes = "查询设备分类")
    public ResponseModel<List<Map<String, Object>>> queryEquipmentCategory(@RequestBody JSONObject category) {
        String key = category.getString("key") == null ? null : category.getString("key");
        return ResponseHelper.buildResponse(comprehensiveStatisticalAnalysisServiceImpl.queryEquipmentCategory(key));
    }


}
