package com.xy.service;

import com.xy.dto.SimInfoDto;
import com.xy.service.factory.sim.SimInfoFactory;
import com.xy.utils.FactoryUtils;
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.RequestBody;

/**
 * <p>
 * 物联网卡服务
 * </p>
 *
 * @author hechunping
 * @since 2024/8/20
 */
@Service
@AllArgsConstructor
@Api(tags = "物联网卡服务")
public class SimInfoServiceImpl implements SimInfoService {

    @Override
    @ApiOperation("物联网卡信息")
    public R<SimInfoDto.InfoVo> info(@RequestBody @Validated SimInfoDto.BaseDto dto) {
        return FactoryUtils.getServiceRoute(SimInfoFactory.class, dto.getIsp()).info(dto);
    }

    @Override
    @ApiOperation("刷新网络")
    public R<String> refreshNet(SimInfoDto.RefreshNetDto dto) {
        return FactoryUtils.getServiceRoute(SimInfoFactory.class,dto.getIsp()).refreshNet(dto);
    }
}
