package com.huimv.modular.analysis.controller;

import com.huimv.core.annotion.DataScope;
import com.huimv.core.pojo.response.ResponseData;
import com.huimv.core.pojo.response.SuccessResponseData;
import com.huimv.modular.analysis.param.AnalysisParam;
import com.huimv.modular.analysis.service.AnalysisService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 数据分析控制器
 * </p>
 *
 * @author yinhao
 * @version 1.0
 * @date 2021/8/18 14:40
 */
@RestController
public class AnalysisController {

    @Resource
    private AnalysisService analysisService;

    @DataScope
    @GetMapping("/analysis/childPigStock")
    public ResponseData getChildPigStockByOrgId(@Validated(AnalysisParam.list.class) AnalysisParam analysisParam) {
        return new SuccessResponseData(analysisService.getChildPigStockByOrgId(analysisParam));
    }
}
