package com.contract.review.controller;

import com.contract.review.service.ContractService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 统计数据控制器
 */
@RestController
@RequestMapping("/api/statistics")
@Api(tags = "统计数据")
public class StatisticsController {
    
    @Autowired
    private ContractService contractService;
    
    /**
     * 获取统计数据
     * @return 统计数据
     */
    @GetMapping
    @ApiOperation("获取统计数据")
    public Map<String, Object> getStatistics() {
        Map<String, Object> statistics = contractService.getStatistics();
        
        Map<String, Object> result = new java.util.HashMap<>();
        result.put("code", 200);
        result.put("message", "success");
        result.put("data", statistics);
        
        return result;
    }
}
