package com.xy.controller;

import com.xy.annotate.RestMappingController;
import com.xy.dto.DeviceChargingHistoryDto;
import com.xy.service.DeviceChargingHistoryServiceImpl;
import com.xy.utils.MercAuthUtils;
import com.xy.utils.PageBean;
import com.xy.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@AllArgsConstructor
@Api(tags = "小程序-设备计费历史表")
@RestMappingController("merc-mini/device-charging-history")
public class DeviceChargingHistoryController {

    private DeviceChargingHistoryServiceImpl deviceChargingHistoryService;

    @PostMapping("page")
    @ApiOperation("分页查询")
    public R<PageBean<DeviceChargingHistoryDto.Vo>> page(@RequestBody @Validated DeviceChargingHistoryDto.Page page) {
        page.setMercId(MercAuthUtils.getMercId());
        return deviceChargingHistoryService.page(page);
    }
}
