package com.xy.controller;

import com.xy.annotate.RestMappingController;
import com.xy.dto.DeviceAlgorithmChargingDto;
import com.xy.service.DeviceAlgorithmChargingServiceImpl;
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-algorithm-charging")
public class DeviceAlgorithmChargingController {

    private DeviceAlgorithmChargingServiceImpl deviceAlgorithmChargingService;

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

}
