package com.tofly.watermeter.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.watermeter.custom.dto.ReadrecolrdDto;
import com.tofly.watermeter.service.ReadrecolrdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@AllArgsConstructor
@RequestMapping("/readrecolrd")
@Api(tags = "核查抄表数据")
public class ReadrecolrdController {

    private final ReadrecolrdService readrecolrdService;

    @PostMapping("/batchInsert")
    @ApiOperation("抄表记录上传")
    public ResultRespone batchInsert(@RequestBody ReadrecolrdDto dto) {
        return ResultRespone.success(readrecolrdService.batchInsert(dto));
    }

    @GetMapping("/getInfo")
    @ApiOperation("数据分页查询")
    public ResultRespone getInfo(Page page, ReadrecolrdDto dto) {
        return ResultRespone.success(readrecolrdService.getInfo(page, dto));
    }

}
