package com.njcn.prepare.harmonic.controller.line;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.service.mysql.line.ReportService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
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;

/**
 * 自定义报表
 * @author qijian
 * @date 2022/10/20
 */
@Slf4j
@RestController
@RequestMapping("/report")
@Api(tags = "自定义报表")
@AllArgsConstructor
public class ReportController extends BaseController {

    private final ReportService reportService;

    /**
     * 批量处理报表
     * @author qijian
     * @date 2022/10/19
     */
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/batchReport")
    @ApiOperation("批量处理报表")
    @ApiImplicitParam(name = "reportParam", value = "查询体", required = true)
    public HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam){
        String methodDescribe = getMethodDescribe("batchReport");
        reportService.batchReport(reportParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
    }



}
