package com.xy.controller;

import cn.hutool.core.collection.CollUtil;
import com.xy.annotate.RestMappingController;
import com.xy.dto.DeviceSimChargeDto;
import com.xy.dto.DeviceSimDto;
import com.xy.dto.MercFeeConfigAlgorithmTypeDto;
import com.xy.dto.MercFeeConfigSimCardDto;
import com.xy.service.DeviceSimChargeServiceImpl;
import com.xy.service.DeviceSimServiceImpl;
import com.xy.service.MercFeeConfigSimCardServiceImpl;
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.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@AllArgsConstructor
@Api(tags = "小程序-设备流量卡费用")
@RestMappingController("merc-mini/deviceSimPay")
public class DeviceSimPayController {

    private MercFeeConfigSimCardServiceImpl mercFeeConfigSimCardService;


    @PostMapping("query")
    @ApiOperation("流量卡支付费用查询")
    public R<List<MercFeeConfigSimCardDto.DeviceSimPayVO>> query(@RequestBody @Validated MercFeeConfigAlgorithmTypeDto.SimPayQueryDTO dto) {
        dto.setMercId(MercAuthUtils.getMercId());
        return mercFeeConfigSimCardService.paySimCardFee(dto);
    }
}
