package com.hzs.system.config.provider;

import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.ext.BdRangeExt;
import com.hzs.system.config.IRangeServiceApi;
import com.hzs.system.config.dto.RangeDTO;
import com.hzs.system.config.service.IBdRangeService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * 极差配置
 **/
@DubboService
public class RangeServiceProvider implements IRangeServiceApi {

    @Autowired
    private IBdRangeService iBdRangeService;

    @Override
    public R<List<BdRangeExt>> queryRange(Integer pkCountry) {
        return R.ok(iBdRangeService.queryRange(pkCountry));
    }

    @Override
    public R<Map<String, RangeDTO>> queryRangeDto() {
        return R.ok(iBdRangeService.queryRangeDto());
    }

    @Override
    public R<RangeDTO> queryRangeDtoByCondition(Integer pkCountry, Integer rangeType, Integer pkLevel) {
        return R.ok(iBdRangeService.getRangeDTO(pkCountry, rangeType, pkLevel));
    }

}
